Package org.faktorips.runtime
Class InMemoryRuntimeRepository
java.lang.Object
org.faktorips.runtime.internal.AbstractRuntimeRepository
org.faktorips.runtime.InMemoryRuntimeRepository
- All Implemented Interfaces:
IRuntimeRepository
A runtime repository that keeps its data in memory.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEnumXmlAdapter(IIpsXmlAdapter<?, ?> enumXmlAdapter) Adds anIIpsXmlAdapterfor a Faktor-IPS enumeration that defers its content to a enumeration content to this repository.protected voidgetAllEnumClasses(LinkedHashSet<Class<?>> result) Same asAbstractRuntimeRepository.getAllEnumClasses()but searches only in this repository and not the ones this repository depends on.protected List<IIpsXmlAdapter<?,?>> getAllInternalEnumXmlAdapters(IRuntimeRepository repository) Returns all enumeration XmlAdapters available in this repository that generated by Faktor-IPS.protected voidgetAllIpsTestCases(List<IpsTest2> result, IRuntimeRepository runtimeRepository) Same asAbstractRuntimeRepository.getAllIpsTestCases(IRuntimeRepository)but searches only in this repository and not the ones this repository depends on.protected voidSame asAbstractRuntimeRepository.getAllModelTypeImplementationClasses()but searches only in this repository and not the ones this repository depends on.voidgetAllProductComponentIds(List<String> result) Same asAbstractRuntimeRepository.getAllProductComponentIds()but searches only in this repository and not the ones this repository depends on.voidgetAllProductComponents(String kindId, List<IProductComponent> result) Same as getAllProductComponent(String kindId) but searches only in this repository and not the ones this repository depends on.voidgetAllProductComponents(List<IProductComponent> result) Same as getAllProductComponents() but searches only in this repository and not the ones this repository depends on.protected voidgetAllTables(List<ITable<?>> result) Same asAbstractRuntimeRepository.getAllTables()but searches only in this repository and not the ones this repository depends on.protected <T> TgetCustomRuntimeObjectInternal(Class<T> type, String id) Same asAbstractRuntimeRepository.getCustomRuntimeObject(Class, String)but searches only in this repository and not the ones this repository depends on.protected <T> List<T>getEnumValuesInternal(Class<T> clazz) Returns the list of enumeration values of the enumeration type that is identified by its class which is provided to it.protected IpsTestCaseBasegetIpsTestCaseInternal(String qName, IRuntimeRepository runtimeRepository) Same asAbstractRuntimeRepository.getIpsTestCase(String, IRuntimeRepository)but searches only in this repository and not the ones this repository depends on.protected voidgetIpsTestCasesStartingWith(String qNamePrefix, List<IpsTest2> result, IRuntimeRepository runtimeRepository) Gets all ips test cases starting with the given qualified name prefix.protected IProductComponentGenerationprotected IProductComponentGenerationprotected intprotected IProductComponentGenerationprotected IProductComponentGenerationgetProductComponentGenerationInternal(String productCmptId, Calendar effectiveDate) Same as getProductComponentGeneration(String id, Calendar effectiveDate) but searches only in this repository and not the ones this repository depends on.voidgetProductComponentGenerations(IProductComponent productCmpt, List<IProductComponentGeneration> result) Same as getProductComponentGenerations() but searches only in this repository and not the ones this repository depends on.protected IProductComponentSame as getProductComponent(String id) but searches only in this repository and not the ones this repository depends on.protected IProductComponentgetProductComponentInternal(String kindId, String versionId) Same as getProductComponent(String kindId, String versionId) but searches only in this repository and not the ones this repository depends on.protected <T extends ITable<?>>
TgetTableInternal(Class<T> tableClass) InMemoryRepository also searches for tables that are instances of subclasses of the given tableClass.protected ITable<?>getTableInternal(String qualifiedTableName) Same asAbstractRuntimeRepository.getTable(String)) but searches only in this repository and not the ones this repository depends on.voidNothing to do for the in memory repository.booleanReturnstrueif the repository's content is modifiable.<T extends IRuntimeObject>
voidputCustomRuntimeObject(Class<T> type, String ipsObjectQualifiedName, T runtimeObject) Puts the runtimeObject into the repository.<T> voidputEnumValues(Class<T> enumType, List<T> enumValues) Puts the given enum values in the repository replacing all existing values for the given enumType.voidPuts the test case into the repository.voidputProductCmptGeneration(IProductComponentGeneration generation) Puts the product component generation and its product component into the repository.voidputProductComponent(IProductComponent productCmpt) Puts the product component into the repository.voidPuts the table into the repository.voidPuts the table with the indicated name into the repository with .Methods inherited from class org.faktorips.runtime.internal.AbstractRuntimeRepository
addAllEnumXmlAdapters, addDirectlyReferencedRepository, addEnumValueLookupService, getAllEnumClasses, getAllIpsTestCases, getAllModelTypeImplementationClasses, getAllProductComponentIds, getAllProductComponents, getAllProductComponents, getAllProductComponents, getAllProductComponentsInternal, getAllReferencedRepositories, getAllTables, getClassLoader, getCustomRuntimeObject, getDirectlyReferencedRepositories, getEnumValue, getEnumValue, getEnumValueLookupService, getEnumValues, getEnumValuesDefinedInType, getExistingEnumValue, getExistingProductComponent, getExistingProductComponentGeneration, getFormulaEvaluatorFactory, getIpsTest, getIpsTest, getIpsTestCase, getIpsTestCase, getIpsTestCasesStartingWith, getIpsTestSuite, getIpsTestSuite, getLatestProductComponentGeneration, getModelType, getModelType, getModelType, getName, getNextProductComponentGeneration, getNumberOfProductComponentGenerations, getPreviousProductComponentGeneration, getProductComponent, getProductComponent, getProductComponentGeneration, getProductComponentGenerations, getRuntimeRepositoryLookup, getTable, getTable, newJAXBContext, newJAXBContext, removeEnumValueLookupService, setFormulaEvaluatorFactory, setRuntimeRepositoryLookup, toString
-
Constructor Details
-
InMemoryRuntimeRepository
public InMemoryRuntimeRepository() -
InMemoryRuntimeRepository
-
-
Method Details
-
getProductComponentInternal
Description copied from class:AbstractRuntimeRepositorySame as getProductComponent(String id) but searches only in this repository and not the ones this repository depends on.- Specified by:
getProductComponentInternalin classAbstractRuntimeRepository
-
getProductComponentInternal
Description copied from class:AbstractRuntimeRepositorySame as getProductComponent(String kindId, String versionId) but searches only in this repository and not the ones this repository depends on.- Specified by:
getProductComponentInternalin classAbstractRuntimeRepository
-
getAllProductComponents
Description copied from class:AbstractRuntimeRepositorySame 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.- Specified by:
getAllProductComponentsin classAbstractRuntimeRepository
-
getProductComponentGenerations
public void getProductComponentGenerations(IProductComponent productCmpt, List<IProductComponentGeneration> result) Description copied from class:AbstractRuntimeRepositorySame 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.- Specified by:
getProductComponentGenerationsin classAbstractRuntimeRepository
-
initialize
public void initialize()Nothing to do for the in memory repository. -
getAllTables
Description copied from class:AbstractRuntimeRepositorySame asAbstractRuntimeRepository.getAllTables()but searches only in this repository and not the ones this repository depends on. Adds the tables found to the given result list.- Specified by:
getAllTablesin classAbstractRuntimeRepository
-
getTableInternal
InMemoryRepository also searches for tables that are instances of subclasses of the given tableClass. This allows to mock a table class for testing purposes.Same as
AbstractRuntimeRepository.getTable(Class)but searches only in this repository and not the ones this repository depends on.- Specified by:
getTableInternalin classAbstractRuntimeRepository
-
putTable
Puts the table into the repository. Replaces any table instance of the same class or any of its superclasses. The latter check is needed to replace tables with mock implementations.- Throws:
NullPointerException- if table isnull.
-
putTable
Puts the table with the indicated name into the repository with . Replaces any table instance with the same qualified name.- Throws:
NullPointerException- if table or qName isnull.
-
putEnumValues
Puts the given enum values in the repository replacing all existing values for the given enumType.- Parameters:
enumType- The Java class representing the enumeration type.enumValues- The value of the enumeration type as list.
-
getTableInternal
Description copied from class:AbstractRuntimeRepositorySame asAbstractRuntimeRepository.getTable(String)) but searches only in this repository and not the ones this repository depends on.- Specified by:
getTableInternalin classAbstractRuntimeRepository
-
getAllProductComponents
Description copied from class:AbstractRuntimeRepositorySame 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.- Specified by:
getAllProductComponentsin classAbstractRuntimeRepository
-
getAllProductComponentIds
Description copied from class:AbstractRuntimeRepositorySame asAbstractRuntimeRepository.getAllProductComponentIds()but searches only in this repository and not the ones this repository depends on. Adds the components found to the given result list.- Specified by:
getAllProductComponentIdsin classAbstractRuntimeRepository
-
getAllEnumClasses
Description copied from class:AbstractRuntimeRepositorySame asAbstractRuntimeRepository.getAllEnumClasses()but searches only in this repository and not the ones this repository depends on. Adds the classes found to the given result set.- Specified by:
getAllEnumClassesin classAbstractRuntimeRepository
-
isModifiable
public boolean isModifiable()Description copied from interface:IRuntimeRepositoryReturnstrueif 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. Returnsfalseotherwise. -
putProductComponent
Puts the product component into the repository. If the repository already contains a component with the same id, the new component replaces the old one.- Throws:
IllegalRepositoryModificationException- if this repository does not allows to modifyNullPointerException- if productCmpt isnullits contents.- See Also:
-
getProductComponentGenerationInternal
protected IProductComponentGeneration getProductComponentGenerationInternal(String productCmptId, Calendar effectiveDate) Description copied from class:AbstractRuntimeRepositorySame as getProductComponentGeneration(String id, Calendar effectiveDate) but searches only in this repository and not the ones this repository depends on.- Specified by:
getProductComponentGenerationInternalin classAbstractRuntimeRepository
-
putProductCmptGeneration
Puts the product component generation and its product component into the repository. If the repository already contains a generation with the same id, the new component replaces the old one. The same applies for the product component.- Throws:
IllegalRepositoryModificationException- if this repository does not allows to modify its contents.NullPointerException- if generation isnull- See Also:
-
getAllIpsTestCases
Description copied from class:AbstractRuntimeRepositorySame asAbstractRuntimeRepository.getAllIpsTestCases(IRuntimeRepository)but searches only in this repository and not the ones this repository depends on. Adds the components found to the given result list.- Specified by:
getAllIpsTestCasesin classAbstractRuntimeRepository
-
getIpsTestCasesStartingWith
protected void getIpsTestCasesStartingWith(String qNamePrefix, List<IpsTest2> result, IRuntimeRepository runtimeRepository) Description copied from class:AbstractRuntimeRepositoryGets all ips test cases starting with the given qualified name prefix.- Specified by:
getIpsTestCasesStartingWithin classAbstractRuntimeRepository
-
getIpsTestCaseInternal
protected IpsTestCaseBase getIpsTestCaseInternal(String qName, IRuntimeRepository runtimeRepository) Description copied from class:AbstractRuntimeRepositorySame asAbstractRuntimeRepository.getIpsTestCase(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).- Specified by:
getIpsTestCaseInternalin classAbstractRuntimeRepository
-
putIpsTestCase
Puts the test case into the repository. -
getAllModelTypeImplementationClasses
Description copied from class:AbstractRuntimeRepositorySame asAbstractRuntimeRepository.getAllModelTypeImplementationClasses()but searches only in this repository and not the ones this repository depends on. Adds the types found to the given result list.- Specified by:
getAllModelTypeImplementationClassesin classAbstractRuntimeRepository
-
getNextProductComponentGenerationInternal
protected IProductComponentGeneration getNextProductComponentGenerationInternal(IProductComponentGeneration generation) - Specified by:
getNextProductComponentGenerationInternalin classAbstractRuntimeRepository
-
getNumberOfProductComponentGenerationsInternal
- Specified by:
getNumberOfProductComponentGenerationsInternalin classAbstractRuntimeRepository
-
getPreviousProductComponentGenerationInternal
protected IProductComponentGeneration getPreviousProductComponentGenerationInternal(IProductComponentGeneration generation) - Specified by:
getPreviousProductComponentGenerationInternalin classAbstractRuntimeRepository
-
getLatestProductComponentGenerationInternal
protected IProductComponentGeneration getLatestProductComponentGenerationInternal(IProductComponent productCmpt) - Specified by:
getLatestProductComponentGenerationInternalin classAbstractRuntimeRepository
-
getEnumValuesInternal
Description copied from class:AbstractRuntimeRepositoryReturns the list of enumeration values of the enumeration type that is identified by its class which is provided to it.- Specified by:
getEnumValuesInternalin classAbstractRuntimeRepository
-
addEnumXmlAdapter
Adds anIIpsXmlAdapterfor a Faktor-IPS enumeration that defers its content to a enumeration content to this repository. -
getAllInternalEnumXmlAdapters
Description copied from class:AbstractRuntimeRepositoryReturns all enumeration XmlAdapters available in this repository that generated by Faktor-IPS.- Specified by:
getAllInternalEnumXmlAdaptersin classAbstractRuntimeRepository- Parameters:
repository- the runtime repository that needs to be used by the XmlAdapters that are returned by this method
-
putCustomRuntimeObject
public <T extends IRuntimeObject> void putCustomRuntimeObject(Class<T> type, String ipsObjectQualifiedName, T runtimeObject) Puts the runtimeObject into the repository. -
getCustomRuntimeObjectInternal
Description copied from class:AbstractRuntimeRepositorySame asAbstractRuntimeRepository.getCustomRuntimeObject(Class, String)but searches only in this repository and not the ones this repository depends on.- Specified by:
getCustomRuntimeObjectInternalin classAbstractRuntimeRepository
-