Class ClassloaderRuntimeRepository

    • Field Detail

      • REPOSITORY_XML_ELEMENT

        public static final java.lang.String REPOSITORY_XML_ELEMENT
        Name of the xml element representing the product component registry.
        See Also:
        Constant Field Values
      • TABLE_OF_CONTENTS_FILE

        public static final java.lang.String TABLE_OF_CONTENTS_FILE
        The default name of the file describing the registry's contents.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ClassloaderRuntimeRepository

        public ClassloaderRuntimeRepository​(java.lang.ClassLoader cl,
                                            java.lang.String basePackage)
        Creates a new repository that loads its contents from the given classloader and the given package. Uses the default toc resource name. Uses the default document builder available via DocumentBuilderFactory.newInstance() to parse the xml files.
        Throws:
        java.lang.NullPointerException - if cl or basePackage are null.
        java.lang.IllegalArgumentException - if the basePackage does not contain the table of contents file.
        java.lang.RuntimeException - if the registry's table of contents file can't be read.
        See Also:
        TABLE_OF_CONTENTS_FILE
      • ClassloaderRuntimeRepository

        public ClassloaderRuntimeRepository​(java.lang.ClassLoader cl,
                                            java.lang.String basePackage,
                                            java.lang.String pathToToc)
        Creates a new repository that loads its contents from the given classloader and the given package and toc resource using the default document builder.
        Parameters:
        cl - The classloader to use.
        basePackage - The name of the base package that contains the data.
        pathToToc - Path from the base package to the resource containing the toc, e.g. "faktorips-repository-toc.xml" or "motor/motor-repository-toc.xml"
        Throws:
        java.lang.NullPointerException - if any argument is null.
        java.lang.IllegalArgumentException - if the basePackage does not contain the table of contents file.
        java.lang.RuntimeException - if the registry's table of contents file can't be read.
      • ClassloaderRuntimeRepository

        public ClassloaderRuntimeRepository​(java.lang.ClassLoader cl,
                                            java.lang.String basePackage,
                                            java.lang.String pathToToc,
                                            ICacheFactory cacheFactory)
        Creates a new repository that loads its contents from the given classloader and the given package using the given xml document builder.
        Parameters:
        cl - The classloader to use.
        basePackage - The name of the base package that contains the data.
        pathToToc - Path from the base package to the resource containing the toc, e.g. "faktorips-repository-toc.xml" or "motor/motor-repository-toc.xml"
        Throws:
        java.lang.NullPointerException - if any argument is null.
        java.lang.IllegalArgumentException - if the basePackage does not contain the table of contents file.
        java.lang.RuntimeException - if the registry's table of contents file can't be read.
    • Method Detail

      • create

        public static final ClassloaderRuntimeRepository create​(java.lang.String tocResource)
        Creates a new repository that loads it's contents from the given toc resource using this class' classloader and the default xml document builder to parse the xml data.
        Parameters:
        tocResource - Path to the resource containing the toc file. E.g. "org/faktorips/sample/internal/faktorips-repository-toc.xml"
        Throws:
        java.lang.NullPointerException - if any argument is null.
        java.lang.RuntimeException - if the registry's table of contents file can't be read.
      • create

        public static final ClassloaderRuntimeRepository create​(java.lang.String tocResource,
                                                                ICacheFactory cacheFactory)
        Creates a new repository that loads it's contents from the given toc resource using this class' classloader and the default xml document builder to parse the xml data.
        Parameters:
        tocResource - Path to the resource containing the toc file. E.g. "org/faktorips/sample/internal/faktorips-repository-toc.xml"
        cacheFactory - The CacheFactory used to create the cache objects in the repository
        Throws:
        java.lang.NullPointerException - if any argument is null.
        java.lang.RuntimeException - if the registry's table of contents file can't be read.
      • create

        public static final ClassloaderRuntimeRepository create​(java.lang.String tocResource,
                                                                java.lang.ClassLoader cl)
        Creates a new repository that loads it's contents from the given toc resource and classloader using the default document builder to parse the xml data.
        Parameters:
        tocResource - Path to the resource containing the toc file. E.g. "org/faktorips/sample/internal/faktorips-repository-toc.xml"
        cl - The classloader to use.
        Throws:
        java.lang.NullPointerException - if any argument is null.
        java.lang.RuntimeException - if the registry's table of contents file can't be read.
      • create

        public static final ClassloaderRuntimeRepository create​(java.lang.String tocResource,
                                                                java.lang.ClassLoader cl,
                                                                ICacheFactory cacheFactory)
        Creates a new repository that loads it's contents from the given toc resource and classloader using the default document builder to parse the xml data.
        Parameters:
        tocResource - Path to the resource containing the toc file. E.g. "org/faktorips/sample/internal/faktorips-repository-toc.xml"
        cl - The classloader to use.
        cacheFactory - The CacheFactory used to create the cache objects in the repository
        Throws:
        java.lang.NullPointerException - if any argument is null.
        java.lang.RuntimeException - if the registry's table of contents file can't be read.
      • getDocumentBuilder

        protected javax.xml.parsers.DocumentBuilder getDocumentBuilder()
      • isModifiable

        public boolean isModifiable()
        Description copied from interface: IRuntimeRepository
        Returns true if the repository's content is modifiable. This feature is mainly targeted for writing test cases that need to setup a repository with a test specific content programmatically. Returns false otherwise.