Class AbstractRuntimeRepository
- java.lang.Object
-
- org.faktorips.runtime.internal.AbstractRuntimeRepository
-
- All Implemented Interfaces:
IRuntimeRepository
- Direct Known Subclasses:
AbstractCachingRuntimeRepository,InMemoryRuntimeRepository
public abstract class AbstractRuntimeRepository extends java.lang.Object implements IRuntimeRepository
Abstract implementation of runtime repository.- Author:
- Jan Ortmann
-
-
Constructor Summary
Constructors Constructor Description AbstractRuntimeRepository(java.lang.String name)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddDirectlyReferencedRepository(IRuntimeRepository repository)Adds a repository this repository depends on because the one to add contains product data that is referenced from this repository.voidaddEnumValueLookupService(IEnumValueLookupService<?> lookup)Adds the service to lookup enumeration values for the enumeration type specified byIEnumValueLookupService.getEnumTypeClass().java.util.List<java.lang.Class<?>>getAllEnumClasses()Returns all classes for that define enumerations in this repository.protected abstract voidgetAllEnumClasses(java.util.LinkedHashSet<java.lang.Class<?>> result)Same asgetAllEnumClasses()but searches only in this repository and not the ones this repository depends on.protected abstract java.util.List<javax.xml.bind.annotation.adapters.XmlAdapter<?,?>>getAllInternalEnumXmlAdapters(IRuntimeRepository repository)Returns all enumeration XmlAdapters available in this repository that generated by Faktor-IPS.protected abstract voidgetAllIpsTestCases(java.util.List<IpsTest2> result, IRuntimeRepository runtimeRepository)Same asgetAllIpsTestCases(IRuntimeRepository)but searches only in this repository and not the ones this repository depends on.java.util.List<IpsTest2>getAllIpsTestCases(IRuntimeRepository runtimeRepository)Returns a list of all test cases stored in the repository and all repositories this one references.java.util.Set<java.lang.String>getAllModelTypeImplementationClasses()Returns a set containing the Java Class names of the implementation classes for all model types available in this repository (either directly or via a referenced repository).protected abstract voidgetAllModelTypeImplementationClasses(java.util.Set<java.lang.String> result)Same asgetAllModelTypeImplementationClasses()but searches only in this repository and not the ones this repository depends on.java.util.List<java.lang.String>getAllProductComponentIds()Returns a list of the IDs of all product components held by this repository or any dependent repository.protected abstract voidgetAllProductComponentIds(java.util.List<java.lang.String> result)Same asgetAllProductComponentIds()but searches only in this repository and not the ones this repository depends on.java.util.List<IProductComponent>getAllProductComponents()Returns all product components available in this repository.<T extends IProductComponent>
java.util.List<T>getAllProductComponents(java.lang.Class<T> productCmptClass)Returns all product components that are instances of the indicated class.java.util.List<IProductComponent>getAllProductComponents(java.lang.String kindId)Returns all product components that belong to the indicated product component kind.protected abstract voidgetAllProductComponents(java.lang.String kindId, java.util.List<IProductComponent> result)Same as getAllProductComponent(String kindId) but searches only in this repository and not the ones this repository depends on.protected abstract voidgetAllProductComponents(java.util.List<IProductComponent> result)Same as getAllProductComponents() but searches only in this repository and not the ones this repository depends on.protected <T extends IProductComponent>
voidgetAllProductComponentsInternal(java.lang.Class<T> productCmptClass, java.util.List<T> result)Same asgetAllProductComponents(Class)but only searches in own repository not in referenced ones and adding result to parameter resultjava.util.List<IRuntimeRepository>getAllReferencedRepositories()Returns all repositories this one depends on directly or indirectly.java.util.List<ITable<?>>getAllTables()Returns all tables available in this repository.protected abstract voidgetAllTables(java.util.List<ITable<?>> result)Same asgetAllTables()but searches only in this repository and not the ones this repository depends on.java.lang.ClassLoadergetClassLoader()Returns the class loader that is used to load Java classes by this repository.<T> TgetCustomRuntimeObject(java.lang.Class<T> type, java.lang.String ipsObjectQualifiedName)Returns a object of typeT, identified by it's qualified name, ornullif no such object exists in this repository or it's referenced repositories.protected abstract <T> TgetCustomRuntimeObjectInternal(java.lang.Class<T> type, java.lang.String ipsObjectQualifiedName)Same asgetCustomRuntimeObject(Class, String)but searches only in this repository and not the ones this repository depends on.java.util.List<IRuntimeRepository>getDirectlyReferencedRepositories()Returns the runtime repositories this one directly depends on.<T> TgetEnumValue(java.lang.Class<T> clazz, java.lang.Object id)Returns the enumeration value for the provided enumeration class with the given id.java.lang.ObjectgetEnumValue(java.lang.String uniqueId)Deprecated.This method does only return valid enums if the id attribute of the enum is of typeString.<T> IEnumValueLookupService<T>getEnumValueLookupService(java.lang.Class<T> enumClazz)Returns the lookup service for the given enumeration type.<T> java.util.List<T>getEnumValues(java.lang.Class<T> clazz)Returns the type safeListof enumeration values of the provided Faktor-IPS generated enumeration class.protected <T> java.util.List<T>getEnumValuesDefinedInType(java.lang.Class<T> enumClass)Returns the values that are defined in the type by a constant called 'VALUES'.protected abstract <T> java.util.List<T>getEnumValuesInternal(java.lang.Class<T> clazz)Returns the list of enumeration values of the enumeration type that is identified by its class which is provided to it.<T> TgetExistingEnumValue(java.lang.Class<T> clazz, java.lang.Object id)Returns the enumeration value for the provided enumeration class with the given id.IProductComponentgetExistingProductComponent(java.lang.String id)Returns the product component identified by the given id.IProductComponentGenerationgetExistingProductComponentGeneration(java.lang.String id, java.util.Calendar effectiveDate)Returns the product component generation identified by the id and the effective date.IFormulaEvaluatorFactorygetFormulaEvaluatorFactory()For default there is no formula evaluation supported.IpsTest2getIpsTest(java.lang.String qName)Returns the test (either test case or suite) for the given qualified name.IpsTest2getIpsTest(java.lang.String qName, IRuntimeRepository runtimeRepository)Returns the test (either test case or suite) for the given qualified name.IpsTestCaseBasegetIpsTestCase(java.lang.String qName)Returns the test case for the given qualified name.IpsTestCaseBasegetIpsTestCase(java.lang.String qName, IRuntimeRepository runtimeRepository)Returns the test case for the given qualified name.protected abstract IpsTestCaseBasegetIpsTestCaseInternal(java.lang.String qName, IRuntimeRepository runtimeRepository)Same asgetIpsTestCase(String, IRuntimeRepository)but searches only in this repository and not the ones this repository depends on.protected abstract voidgetIpsTestCasesStartingWith(java.lang.String qNamePrefix, java.util.List<IpsTest2> result, IRuntimeRepository runtimeRepository)Gets all ips test cases starting with the given qualified name prefix.java.util.List<IpsTest2>getIpsTestCasesStartingWith(java.lang.String qNamePrefix, IRuntimeRepository runtimeRepository)Returns a list of test cases starting with the given qualified name prefix stored in the repository and all repositories this one references.IpsTestSuitegetIpsTestSuite(java.lang.String qNamePrefix)Returns a test suite that contains all tests that have qualified names starting with the given prefix.IpsTestSuitegetIpsTestSuite(java.lang.String qNamePrefix, IRuntimeRepository runtimeRepository)Returns a test suite that contains all tests that have qualified names starting with the given prefix.IProductComponentGenerationgetLatestProductComponentGeneration(IProductComponent productCmpt)Returns the latest product component generation of the provided product component.protected abstract IProductComponentGenerationgetLatestProductComponentGenerationInternal(IProductComponent productCmpt)TypegetModelType(java.lang.Class<?> modelObjectClass)Returns theIModelTypecontaining the meta information for the given model object class.PolicyCmptTypegetModelType(IModelObject modelObject)Returns theIModelTypecontaining the meta information for the given model object.ProductCmptTypegetModelType(IProductComponent productComponent)Returns theIModelTypecontaining the meta information for the given product component.java.lang.StringgetName()Returns the repository's name.IProductComponentGenerationgetNextProductComponentGeneration(IProductComponentGeneration generation)Returns the product component generation that follows the provided generation with respect to its valid from date.protected abstract IProductComponentGenerationgetNextProductComponentGenerationInternal(IProductComponentGeneration generation)intgetNumberOfProductComponentGenerations(IProductComponent productCmpt)Returns the number of product component generations of the provided product component.protected abstract intgetNumberOfProductComponentGenerationsInternal(IProductComponent productCmpt)IProductComponentGenerationgetPreviousProductComponentGeneration(IProductComponentGeneration generation)Returns the product component generation that is prior to the provided generation with respect to its valid from date.protected abstract IProductComponentGenerationgetPreviousProductComponentGenerationInternal(IProductComponentGeneration generation)IProductComponentgetProductComponent(java.lang.String id)Returns the product component identified by the given id.IProductComponentgetProductComponent(java.lang.String kindId, java.lang.String versionId)Returns the product component identified by the given KindId and versionId.IProductComponentGenerationgetProductComponentGeneration(java.lang.String id, java.util.Calendar effectiveDate)Returns the product component generation identified by the id and the effective date.protected abstract IProductComponentGenerationgetProductComponentGenerationInternal(java.lang.String id, java.util.Calendar effectiveDate)Same as getProductComponentGeneration(String id, Calendar effectiveDate) but searches only in this repository and not the ones this repository depends on.java.util.List<IProductComponentGeneration>getProductComponentGenerations(IProductComponent productCmpt)Returns all product component generations for the given product component.abstract voidgetProductComponentGenerations(IProductComponent productCmpt, java.util.List<IProductComponentGeneration> result)Same as getProductComponentGenerations() but searches only in this repository and not the ones this repository depends on.protected abstract IProductComponentgetProductComponentInternal(java.lang.String id)Same as getProductComponent(String id) but searches only in this repository and not the ones this repository depends on.protected abstract IProductComponentgetProductComponentInternal(java.lang.String kindId, java.lang.String versionId)Same as getProductComponent(String kindId, String versionId) but searches only in this repository and not the ones this repository depends on.IRuntimeRepositoryLookupgetRuntimeRepositoryLookup()Returns theIRuntimeRepositoryLookupthat was previously set usingIRuntimeRepository.setRuntimeRepositoryLookup(IRuntimeRepositoryLookup).<T extends ITable<?>>
TgetTable(java.lang.Class<T> tableClass)Returns the table contents for the given table class.ITable<?>getTable(java.lang.String qualifiedTableName)Returns the table contents for the given qualified table name.protected abstract <T extends ITable<?>>
TgetTableInternal(java.lang.Class<T> tableClass)Same asgetTable(Class)but searches only in this repository and not the ones this repository depends on.protected abstract ITable<?>getTableInternal(java.lang.String qualifiedTableName)Same asgetTable(String)) but searches only in this repository and not the ones this repository depends on.javax.xml.bind.JAXBContextnewJAXBContext()Creates a new JAXBContext that can marshall / unmarshall all model classes defined in this repository.javax.xml.bind.JAXBContextnewJAXBContext(javax.xml.bind.JAXBContext ctx)Creates aJAXBContextthat wraps the provided context and extends the marshaling methods to provide marshaling of Faktor-IPS enumerations and model objects configured by product components.voidremoveEnumValueLookupService(IEnumValueLookupService<?> lookup)Removes the lookup service registered for the given enumeration type.voidsetFormulaEvaluatorFactory(IFormulaEvaluatorFactory formulaEvaluatorFactory)If you want to support formula evaluation you can set aIFormulaEvaluatorFactory.voidsetRuntimeRepositoryLookup(IRuntimeRepositoryLookup repositoryLookup)Setting aIRuntimeRepositoryLookupis needed to enable serialization of policy components.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.faktorips.runtime.IRuntimeRepository
isModifiable
-
-
-
-
Method Detail
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Returns the class loader that is used to load Java classes by this repository.This default implementation returns the class loader with which this repository class has been loaded.
- Specified by:
getClassLoaderin interfaceIRuntimeRepository
-
getName
public java.lang.String getName()
Description copied from interface:IRuntimeRepositoryReturns the repository's name.- Specified by:
getNamein interfaceIRuntimeRepository
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
addDirectlyReferencedRepository
public final void addDirectlyReferencedRepository(IRuntimeRepository repository)
Description copied from interface:IRuntimeRepositoryAdds a repository this repository depends on because the one to add contains product data that is referenced from this repository. Access methods likegetProductComponent(..)include all repositories this one depends on in their search.- Specified by:
addDirectlyReferencedRepositoryin interfaceIRuntimeRepository- Parameters:
repository- The repository to add.
-
getDirectlyReferencedRepositories
public java.util.List<IRuntimeRepository> getDirectlyReferencedRepositories()
Description copied from interface:IRuntimeRepositoryReturns the runtime repositories this one directly depends on.- Specified by:
getDirectlyReferencedRepositoriesin interfaceIRuntimeRepository
-
getAllReferencedRepositories
public java.util.List<IRuntimeRepository> getAllReferencedRepositories()
Description copied from interface:IRuntimeRepositoryReturns all repositories this one depends on directly or indirectly. The order is defined by a breadth first search starting with this repository's direct dependencies. Each repository is only included once even if it is referenced from two others. The list is computed lazy on the first request.- Specified by:
getAllReferencedRepositoriesin interfaceIRuntimeRepository
-
getProductComponent
public final IProductComponent getProductComponent(java.lang.String id)
Description copied from interface:IRuntimeRepositoryReturns the product component identified by the given id. Returnsnullif the id isnullor no component with the indicated id can be found.Note
How the product component id is structured, is defined as part of the ips project. The definition is called a product component naming (and identification) strategy. The standard strategy is to use the id of the product component kind followed by a separator followed by component's versionId. However it is possible to use completly different strategies for example to create numeric identifiers to reduce the size of indices in a datatbase. In the latter case the product component id can't be derived from the product component kind id and it's version id.
- Specified by:
getProductComponentin interfaceIRuntimeRepository- Parameters:
id- The id of the product component to find.- Returns:
- The product component identified by the id or
null.
-
getExistingProductComponent
public IProductComponent getExistingProductComponent(java.lang.String id)
Description copied from interface:IRuntimeRepositoryReturns the product component identified by the given id. Same as getProductComponent(String id) but throws an exception if the product component is not found. This method never returns null.- Specified by:
getExistingProductComponentin interfaceIRuntimeRepository- Parameters:
id- The id of the product component to find.- Returns:
- The product component identified by the id
- See Also:
IRuntimeRepository.getProductComponent(String)
-
getProductComponentInternal
protected abstract IProductComponent getProductComponentInternal(java.lang.String id)
Same as getProductComponent(String id) but searches only in this repository and not the ones this repository depends on.
-
getProductComponent
public final IProductComponent getProductComponent(java.lang.String kindId, java.lang.String versionId)
Description copied from interface:IRuntimeRepositoryReturns the product component identified by the given KindId and versionId. If versionId isnullthe most recent version is returned. Returnsnullif the kindId isnullor no component with the indicated kindId and versionId can be found.- Specified by:
getProductComponentin interfaceIRuntimeRepository- Parameters:
kindId- The product component kind id, e.g. CollisionCoverageversionId- The versionId to find, e.g. 2005-01- Returns:
- The product component identified by the id or
null.
-
getProductComponentInternal
protected abstract IProductComponent getProductComponentInternal(java.lang.String kindId, java.lang.String versionId)
Same as getProductComponent(String kindId, String versionId) but searches only in this repository and not the ones this repository depends on.
-
getAllProductComponents
public final java.util.List<IProductComponent> getAllProductComponents(java.lang.String kindId)
Description copied from interface:IRuntimeRepositoryReturns all product components that belong to the indicated product component kind. Returns an empty array if either kindId isnullor no component with the indicated kind is found.- Specified by:
getAllProductComponentsin interfaceIRuntimeRepository- Parameters:
kindId- The product component kind id, e.g. CollisionCoverage
-
getAllProductComponents
protected abstract void getAllProductComponents(java.lang.String kindId, java.util.List<IProductComponent> result)Same as getAllProductComponent(String kindId) but searches only in this repository and not the ones this repository depends on. Adds the components found to the given result list.
-
getExistingProductComponentGeneration
public IProductComponentGeneration getExistingProductComponentGeneration(java.lang.String id, java.util.Calendar effectiveDate)
Description copied from interface:IRuntimeRepositoryReturns the product component generation identified by the id and the effective date. Same as getProductComponentGeneration(String id, Calendar effectiveDate) but throws an exception if the product component generation is not found. This method never returns null.- Specified by:
getExistingProductComponentGenerationin interfaceIRuntimeRepository- Parameters:
id- The product component's id.effectiveDate- The process' effective date- Returns:
- The product component generation
- See Also:
IRuntimeRepository.getProductComponentGeneration(String, Calendar)
-
getProductComponentGeneration
public final IProductComponentGeneration getProductComponentGeneration(java.lang.String id, java.util.Calendar effectiveDate)
Description copied from interface:IRuntimeRepositoryReturns the product component generation identified by the id and the effective date. Returnsnullif either the id isnull, the effectiveDate isnullor no generation with the indicated id can be found or the product component hasn't got a generation that is effective on the given date.- Specified by:
getProductComponentGenerationin interfaceIRuntimeRepository- Parameters:
id- The product component's id.effectiveDate- The process' effective date- Returns:
- The product component generation or
null.
-
getProductComponentGenerationInternal
protected abstract IProductComponentGeneration getProductComponentGenerationInternal(java.lang.String id, java.util.Calendar effectiveDate)
Same as getProductComponentGeneration(String id, Calendar effectiveDate) but searches only in this repository and not the ones this repository depends on.
-
getAllProductComponents
public final <T extends IProductComponent> java.util.List<T> getAllProductComponents(java.lang.Class<T> productCmptClass)
Description copied from interface:IRuntimeRepositoryReturns all product components that are instances of the indicated class. Returns an empty list if no such component exists.- Specified by:
getAllProductComponentsin interfaceIRuntimeRepository
-
getAllProductComponentsInternal
protected <T extends IProductComponent> void getAllProductComponentsInternal(java.lang.Class<T> productCmptClass, java.util.List<T> result)
Same asgetAllProductComponents(Class)but only searches in own repository not in referenced ones and adding result to parameter result- Parameters:
productCmptClass- The class you want to search product components forresult- adding the found product components to result list
-
getAllProductComponents
public final java.util.List<IProductComponent> getAllProductComponents()
Description copied from interface:IRuntimeRepositoryReturns all product components available in this repository. Returns an empty list if no component is available.Note that this is an expensive operation as all components have to be loaded into memory.
- Specified by:
getAllProductComponentsin interfaceIRuntimeRepository
-
getAllProductComponents
protected abstract void getAllProductComponents(java.util.List<IProductComponent> result)
Same as getAllProductComponents() but searches only in this repository and not the ones this repository depends on. Adds the components found to the given result list.
-
getProductComponentGenerations
public final java.util.List<IProductComponentGeneration> getProductComponentGenerations(IProductComponent productCmpt)
Description copied from interface:IRuntimeRepositoryReturns all product component generations for the given product component. Returns an empty list if no generation is available.The generations are ordered by valid from date in reverse order that means the latest generation (latest valid from date) is the first one, the oldest generation is the last one.
- Specified by:
getProductComponentGenerationsin interfaceIRuntimeRepository- Returns:
- The list of product component generations ordered by the valid from date in reverse order
-
getProductComponentGenerations
public abstract void getProductComponentGenerations(IProductComponent productCmpt, java.util.List<IProductComponentGeneration> result)
Same as getProductComponentGenerations() but searches only in this repository and not the ones this repository depends on. Adds the components found to the given result list.
-
getAllProductComponentIds
public final java.util.List<java.lang.String> getAllProductComponentIds()
Description copied from interface:IRuntimeRepositoryReturns a list of the IDs of all product components held by this repository or any dependent repository.- Specified by:
getAllProductComponentIdsin interfaceIRuntimeRepository- Returns:
- All valid product component IDs that are accessible by this repository.
-
getAllProductComponentIds
protected abstract void getAllProductComponentIds(java.util.List<java.lang.String> result)
Same asgetAllProductComponentIds()but searches only in this repository and not the ones this repository depends on. Adds the components found to the given result list.
-
getAllTables
public java.util.List<ITable<?>> getAllTables()
Description copied from interface:IRuntimeRepositoryReturns all tables available in this repository. Returns an empty list if no table is available.Note that this is an expensive operation as all tables have to be loaded into memory.
- Specified by:
getAllTablesin interfaceIRuntimeRepository
-
getAllTables
protected abstract void getAllTables(java.util.List<ITable<?>> result)
Same asgetAllTables()but searches only in this repository and not the ones this repository depends on. Adds the tables found to the given result list.
-
getTable
public final <T extends ITable<?>> T getTable(java.lang.Class<T> tableClass)
Description copied from interface:IRuntimeRepositoryReturns the table contents for the given table class.- Specified by:
getTablein interfaceIRuntimeRepository
-
getTableInternal
protected abstract <T extends ITable<?>> T getTableInternal(java.lang.Class<T> tableClass)
Same asgetTable(Class)but searches only in this repository and not the ones this repository depends on.
-
getTable
public ITable<?> getTable(java.lang.String qualifiedTableName)
Description copied from interface:IRuntimeRepositoryReturns the table contents for the given qualified table name.- Specified by:
getTablein interfaceIRuntimeRepository
-
getTableInternal
protected abstract ITable<?> getTableInternal(java.lang.String qualifiedTableName)
Same asgetTable(String)) but searches only in this repository and not the ones this repository depends on.
-
getAllIpsTestCases
public final java.util.List<IpsTest2> getAllIpsTestCases(IRuntimeRepository runtimeRepository)
Description copied from interface:IRuntimeRepositoryReturns a list of all test cases stored in the repository and all repositories this one references. Returns an empty list if none is found.- Specified by:
getAllIpsTestCasesin interfaceIRuntimeRepository
-
getIpsTestCasesStartingWith
public java.util.List<IpsTest2> getIpsTestCasesStartingWith(java.lang.String qNamePrefix, IRuntimeRepository runtimeRepository)
Description copied from interface:IRuntimeRepositoryReturns a list of test cases starting with the given qualified name prefix stored in the repository and all repositories this one references. Returns an empty list if none is found.- Specified by:
getIpsTestCasesStartingWithin interfaceIRuntimeRepository
-
getAllIpsTestCases
protected abstract void getAllIpsTestCases(java.util.List<IpsTest2> result, IRuntimeRepository runtimeRepository)
Same asgetAllIpsTestCases(IRuntimeRepository)but searches only in this repository and not the ones this repository depends on. Adds the components found to the given result list.
-
getIpsTestCasesStartingWith
protected abstract void getIpsTestCasesStartingWith(java.lang.String qNamePrefix, java.util.List<IpsTest2> result, IRuntimeRepository runtimeRepository)Gets all ips test cases starting with the given qualified name prefix.
-
getIpsTest
public IpsTest2 getIpsTest(java.lang.String qName)
Description copied from interface:IRuntimeRepositoryReturns the test (either test case or suite) for the given qualified name. If a test is found for the given qualified name, the test is returned. Otherwise a test suite containing all tests that starts with the given qualified name is returned. Returns an empty test suite if no tests are found for the given qualified name.- Specified by:
getIpsTestin interfaceIRuntimeRepository
-
getIpsTest
public IpsTest2 getIpsTest(java.lang.String qName, IRuntimeRepository runtimeRepository)
Description copied from interface:IRuntimeRepositoryReturns the test (either test case or suite) for the given qualified name. If a test is found for the given qualified name, the test is returned. Otherwise a test suite containing all tests that starts with the given qualified name is returned. Returns an empty test suite if no tests are found for the given qualified name. The given runtime repository is the repository which will be used to instantiate the test cases.- Specified by:
getIpsTestin interfaceIRuntimeRepository- See Also:
IRuntimeRepository.getIpsTestCase(java.lang.String)
-
getIpsTestCase
public IpsTestCaseBase getIpsTestCase(java.lang.String qName)
Description copied from interface:IRuntimeRepositoryReturns the test case for the given qualified name.- Specified by:
getIpsTestCasein interfaceIRuntimeRepository
-
getIpsTestCase
public IpsTestCaseBase getIpsTestCase(java.lang.String qName, IRuntimeRepository runtimeRepository)
Description copied from interface:IRuntimeRepositoryReturns the test case for the given qualified name. The given runtimeRepository will be used to instantiate the test case (this repository is used to search for test cases).
Remark this runtime repository which will be used to search for the given test case can differ from the runtime repository which will be used to instantiate the test case during runtime.
Normally the runtime repository contains all repositories which are referenced by the project.- Specified by:
getIpsTestCasein interfaceIRuntimeRepository
-
getIpsTestCaseInternal
protected abstract IpsTestCaseBase getIpsTestCaseInternal(java.lang.String qName, IRuntimeRepository runtimeRepository)
Same asgetIpsTestCase(String, IRuntimeRepository)but searches only in this repository and not the ones this repository depends on. The given runtimeRepository specifies the repository which will be used to instantiate the test case (e.g. the first repository which contains all dependence repositories).
-
getIpsTestSuite
public IpsTestSuite getIpsTestSuite(java.lang.String qNamePrefix)
Description copied from interface:IRuntimeRepositoryReturns a test suite that contains all tests that have qualified names starting with the given prefix. Note that if test cases belong to different package fragments the returned test suite contains other testsuites. One suite for each package fragment.- Specified by:
getIpsTestSuitein interfaceIRuntimeRepository
-
getIpsTestSuite
public IpsTestSuite getIpsTestSuite(java.lang.String qNamePrefix, IRuntimeRepository runtimeRepository)
Description copied from interface:IRuntimeRepositoryReturns a test suite that contains all tests that have qualified names starting with the given prefix. Note that if test cases belong to different package fragments the returned test suite contains other test suites. One suite for each package fragment. The given runtime repository is the repository which will be used to instantiate the test cases.- Specified by:
getIpsTestSuitein interfaceIRuntimeRepository- See Also:
IRuntimeRepository.getIpsTestCase(java.lang.String)
-
getNextProductComponentGeneration
public IProductComponentGeneration getNextProductComponentGeneration(IProductComponentGeneration generation)
Description copied from interface:IRuntimeRepositoryReturns the product component generation that follows the provided generation with respect to its valid from date.If there is no further generation this method returns
null.- Specified by:
getNextProductComponentGenerationin interfaceIRuntimeRepository- Returns:
- The next generation with respect to the valid from date.
-
getNextProductComponentGenerationInternal
protected abstract IProductComponentGeneration getNextProductComponentGenerationInternal(IProductComponentGeneration generation)
-
getNumberOfProductComponentGenerations
public int getNumberOfProductComponentGenerations(IProductComponent productCmpt)
Description copied from interface:IRuntimeRepositoryReturns the number of product component generations of the provided product component.- Specified by:
getNumberOfProductComponentGenerationsin interfaceIRuntimeRepository
-
getNumberOfProductComponentGenerationsInternal
protected abstract int getNumberOfProductComponentGenerationsInternal(IProductComponent productCmpt)
-
getPreviousProductComponentGeneration
public final IProductComponentGeneration getPreviousProductComponentGeneration(IProductComponentGeneration generation)
Description copied from interface:IRuntimeRepositoryReturns the product component generation that is prior to the provided generation with respect to its valid from date.If there is no previous generation this method returns
null.- Specified by:
getPreviousProductComponentGenerationin interfaceIRuntimeRepository- Returns:
- The previous generation with respect to the valid from date.
-
getPreviousProductComponentGenerationInternal
protected abstract IProductComponentGeneration getPreviousProductComponentGenerationInternal(IProductComponentGeneration generation)
-
getLatestProductComponentGeneration
public final IProductComponentGeneration getLatestProductComponentGeneration(IProductComponent productCmpt)
Description copied from interface:IRuntimeRepositoryReturns the latest product component generation of the provided product component.- Specified by:
getLatestProductComponentGenerationin interfaceIRuntimeRepository- Returns:
- The generation with the latest valid from date
-
getLatestProductComponentGenerationInternal
protected abstract IProductComponentGeneration getLatestProductComponentGenerationInternal(IProductComponent productCmpt)
-
getModelType
public Type getModelType(java.lang.Class<?> modelObjectClass)
Description copied from interface:IRuntimeRepositoryReturns theIModelTypecontaining the meta information for the given model object class.- Specified by:
getModelTypein interfaceIRuntimeRepository
-
getModelType
public PolicyCmptType getModelType(IModelObject modelObject)
Description copied from interface:IRuntimeRepositoryReturns theIModelTypecontaining the meta information for the given model object. This is a convenience method callinggetModelTypewith the model object's class.- Specified by:
getModelTypein interfaceIRuntimeRepository
-
getModelType
public ProductCmptType getModelType(IProductComponent productComponent)
Description copied from interface:IRuntimeRepositoryReturns theIModelTypecontaining the meta information for the given product component. This is a convenience method callinggetModelTypewith the product component class.- Specified by:
getModelTypein interfaceIRuntimeRepository
-
getAllModelTypeImplementationClasses
public final java.util.Set<java.lang.String> getAllModelTypeImplementationClasses()
Description copied from interface:IRuntimeRepositoryReturns a set containing the Java Class names of the implementation classes for all model types available in this repository (either directly or via a referenced repository). For product component types the implementation class for the part that remains unchanged over time is returned. Currently there is no way to get get the implementation class for the product component generation (the part that changed over time).Returns an empty set if no type is available.
- Specified by:
getAllModelTypeImplementationClassesin interfaceIRuntimeRepository
-
getAllModelTypeImplementationClasses
protected abstract void getAllModelTypeImplementationClasses(java.util.Set<java.lang.String> result)
Same asgetAllModelTypeImplementationClasses()but searches only in this repository and not the ones this repository depends on. Adds the types found to the given result list.
-
getEnumValue
@Deprecated public java.lang.Object getEnumValue(java.lang.String uniqueId)
Deprecated.This method does only return valid enums if the id attribute of the enum is of typeString. You should never use this method! UsegetEnumValue(Class, Object)instead. This method may be returned in future releases.Description copied from interface:IRuntimeRepositoryReturns the enumeration value for the provided unique Id. The unique Id is specified as follows qualifiedClassName'#'valueId.- Specified by:
getEnumValuein interfaceIRuntimeRepository
-
getEnumValue
public final <T> T getEnumValue(java.lang.Class<T> clazz, java.lang.Object id)Description copied from interface:IRuntimeRepositoryReturns the enumeration value for the provided enumeration class with the given id. If no value is found in the enumeration of the provided enumeration classnullwill be returned. If the provided class cannot be recognized as a Faktor-IPS enumeration oridisnull,nullwill be returned. This method is only relevant for Faktor-IPS enumerations whose values are deferred to a content that is held by this repository.- Specified by:
getEnumValuein interfaceIRuntimeRepository- Parameters:
clazz- The enumeration class upon which the enumeration value is returnedid- The enum value's identification- Returns:
- the enumeration value, or
nullif it does not exist - See Also:
IRuntimeRepository.getExistingEnumValue(Class, Object)
-
getExistingEnumValue
public final <T> T getExistingEnumValue(java.lang.Class<T> clazz, java.lang.Object id)Description copied from interface:IRuntimeRepositoryReturns the enumeration value for the provided enumeration class with the given id. This method is only relevant for Faktor-IPS enumerations whose values are deferred to a content that is held by this repository. Ifidisnull,nullwill be returned. UnlikeIRuntimeRepository.getEnumValue(Class, Object), this method will throw an exception when no enum value matching the parameters is found in the repository.- Specified by:
getExistingEnumValuein interfaceIRuntimeRepository- Parameters:
clazz- The enumeration class upon which the enumeration value is returnedid- The enum value's identification- Returns:
- the enumeration value
- See Also:
IRuntimeRepository.getEnumValue(Class, Object)
-
getEnumValues
public final <T> java.util.List<T> getEnumValues(java.lang.Class<T> clazz)
Description copied from interface:IRuntimeRepositoryReturns the type safeListof enumeration values of the provided Faktor-IPS generated enumeration class. This method is only relevant for Faktor-IPS enumerations whose values are deferred to a content that is held by this repository.- Specified by:
getEnumValuesin interfaceIRuntimeRepository- Parameters:
clazz- the enumeration class upon which the list of enumeration values is returned- Returns:
- The UNMODIFIABLE list of enum values.
-
getEnumValuesInternal
protected abstract <T> java.util.List<T> getEnumValuesInternal(java.lang.Class<T> clazz)
Returns the list of enumeration values of the enumeration type that is identified by its class which is provided to it.
-
getEnumValuesDefinedInType
protected <T> java.util.List<T> getEnumValuesDefinedInType(java.lang.Class<T> enumClass)
Returns the values that are defined in the type by a constant called 'VALUES'. If no such constant is available an empty list is returned. If the constant is available but is either not accessible or of wrong type an exception is thrown.For performance optimization the values are cached in the static map
ENUMVALUECACHE. We only check once if there is already a cached value. We disclaim a double checking with synchronization because in worst case two threads simply getting the same result. TheENUMVALUECACHEis realized by aConcurrentHashMap. Only the first evaluation will be put into the cache usingConcurrentHashMap.putIfAbsent(Object, Object).- Parameters:
enumClass- The class of which you want to get the enumeration values- Returns:
- A list of instances of enumClass that are defined as enumeration values of the specified type.
-
addEnumValueLookupService
public void addEnumValueLookupService(IEnumValueLookupService<?> lookup)
Description copied from interface:IRuntimeRepositoryAdds the service to lookup enumeration values for the enumeration type specified byIEnumValueLookupService.getEnumTypeClass(). If a service is already registered for the enumeration type, the new service replaces the old one.- Specified by:
addEnumValueLookupServicein interfaceIRuntimeRepository- Parameters:
lookup- The new lookup service.
-
getEnumValueLookupService
public <T> IEnumValueLookupService<T> getEnumValueLookupService(java.lang.Class<T> enumClazz)
Description copied from interface:IRuntimeRepositoryReturns the lookup service for the given enumeration type. Returnsnullif no service is registered for the given type.- Specified by:
getEnumValueLookupServicein interfaceIRuntimeRepository
-
removeEnumValueLookupService
public void removeEnumValueLookupService(IEnumValueLookupService<?> lookup)
Description copied from interface:IRuntimeRepositoryRemoves the lookup service registered for the given enumeration type. Does nothing if no such service has been registered.- Specified by:
removeEnumValueLookupServicein interfaceIRuntimeRepository
-
getAllInternalEnumXmlAdapters
protected abstract java.util.List<javax.xml.bind.annotation.adapters.XmlAdapter<?,?>> getAllInternalEnumXmlAdapters(IRuntimeRepository repository)
Returns all enumeration XmlAdapters available in this repository that generated by Faktor-IPS.- Parameters:
repository- the runtime repository that needs to be used by the XmlAdapters that are returned by this method
-
getAllEnumClasses
public final java.util.List<java.lang.Class<?>> getAllEnumClasses()
Description copied from interface:IRuntimeRepositoryReturns all classes for that define enumerations in this repository. All enums types (with and without separated content) defined by Faktor-IPS are returned for the model project they are defined in. For projects containing enum contents, only the matching structure classes are returned from the product project. Model projects must be referenced withIRuntimeRepository.addDirectlyReferencedRepository(IRuntimeRepository)for their enum structures without content to be found.Returns an empty list if no enum class is available.
- Specified by:
getAllEnumClassesin interfaceIRuntimeRepository
-
getAllEnumClasses
protected abstract void getAllEnumClasses(java.util.LinkedHashSet<java.lang.Class<?>> result)
Same asgetAllEnumClasses()but searches only in this repository and not the ones this repository depends on. Adds the classes found to the given result set.
-
newJAXBContext
public javax.xml.bind.JAXBContext newJAXBContext(javax.xml.bind.JAXBContext ctx)
Creates aJAXBContextthat wraps the provided context and extends the marshaling methods to provide marshaling of Faktor-IPS enumerations and model objects configured by product components.
-
newJAXBContext
public javax.xml.bind.JAXBContext newJAXBContext()
Creates a new JAXBContext that can marshall / unmarshall all model classes defined in this repository. If the repository references other repositories (directly or indirectly), the context can also handle the classes defined in those.- Specified by:
newJAXBContextin interfaceIRuntimeRepository- Throws:
java.lang.RuntimeException- Exceptions that are thrown while trying to load a class from the class loader or creating the jaxb context are wrapped into a runtime exception
-
getFormulaEvaluatorFactory
public IFormulaEvaluatorFactory getFormulaEvaluatorFactory()
For default there is no formula evaluation supported.If you want to support formula evaluation you have to override this method or use
setFormulaEvaluatorFactory(IFormulaEvaluatorFactory).- Specified by:
getFormulaEvaluatorFactoryin interfaceIRuntimeRepository- Returns:
- The configured formula evaluator or null if no evaluation is supported
-
setFormulaEvaluatorFactory
public void setFormulaEvaluatorFactory(IFormulaEvaluatorFactory formulaEvaluatorFactory)
If you want to support formula evaluation you can set aIFormulaEvaluatorFactory.
-
getCustomRuntimeObject
public <T> T getCustomRuntimeObject(java.lang.Class<T> type, java.lang.String ipsObjectQualifiedName)Description copied from interface:IRuntimeRepositoryReturns a object of typeT, identified by it's qualified name, ornullif no such object exists in this repository or it's referenced repositories. It is up to extensions to define which types can be found in the repository (e.g. aAbstractTocBasedRuntimeRepositorycould defineCustomTocEntryObjects for new types. If there are no objects of the given type,nullis returned. If theIRuntimeRepositoryimplementation does not allow custom types,nullis returned.- Specified by:
getCustomRuntimeObjectin interfaceIRuntimeRepository- Parameters:
type- a class supported by theIRuntimeRepositoryimplementationipsObjectQualifiedName- the qualified name of the object- Returns:
- the object identified by qName or
null
-
getCustomRuntimeObjectInternal
protected abstract <T> T getCustomRuntimeObjectInternal(java.lang.Class<T> type, java.lang.String ipsObjectQualifiedName)Same asgetCustomRuntimeObject(Class, String)but searches only in this repository and not the ones this repository depends on.
-
getRuntimeRepositoryLookup
public IRuntimeRepositoryLookup getRuntimeRepositoryLookup()
Description copied from interface:IRuntimeRepositoryReturns theIRuntimeRepositoryLookupthat was previously set usingIRuntimeRepository.setRuntimeRepositoryLookup(IRuntimeRepositoryLookup). TheIRuntimeRepositoryLookupis used for serialization of policy components especially for theProductConfigurationin configured policy components.- Specified by:
getRuntimeRepositoryLookupin interfaceIRuntimeRepository- Returns:
- A previously set
IRuntimeRepositoryLookupthat is serialized by aProductConfigurationand used to load the product component and its generation after deserialization. - See Also:
IRuntimeRepositoryLookup,ProductConfiguration
-
setRuntimeRepositoryLookup
public void setRuntimeRepositoryLookup(IRuntimeRepositoryLookup repositoryLookup)
Description copied from interface:IRuntimeRepositorySetting aIRuntimeRepositoryLookupis needed to enable serialization of policy components. You need to set aIRuntimeRepositoryLookupbefore you could serialize any product configured policy component.- Specified by:
setRuntimeRepositoryLookupin interfaceIRuntimeRepository- Parameters:
repositoryLookup- TheIRuntimeRepositoryLookupwill provide an instance of thisIRuntimeRepositorywhen deserializing a policy component.- See Also:
IRuntimeRepositoryLookup
-
-