Class AbstractReadonlyTableOfContents
- java.lang.Object
-
- org.faktorips.runtime.internal.toc.AbstractReadonlyTableOfContents
-
- All Implemented Interfaces:
IReadonlyTableOfContents
- Direct Known Subclasses:
ReadonlyTableOfContents
public abstract class AbstractReadonlyTableOfContents extends java.lang.Object implements IReadonlyTableOfContents
A table of contents for the runtime repository.The table of contents contains a list of toc entries that contain the information needed to identify and load the objects stored in the repository.
The table of contents can be extended to read toc entries for new object types by implementing and registering a
ITocEntryFactory.- Author:
- Jan Ortmann
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPRODUCT_DATA_VERSION_XML_ELEMENTstatic java.lang.StringTOC_XML_ELEMENT
-
Constructor Summary
Constructors Constructor Description AbstractReadonlyTableOfContents(java.lang.ClassLoader classLoader)Creates a new TOC that uses the givenClassLoaderto findITocEntryFactoryimplementations viaServiceLoader.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract EnumContentTocEntrygetEnumContentTocEntry(java.lang.String className)Returns the toc entry representing enum contents for the specified implementation class.abstract java.util.Set<EnumXmlAdapterTocEntry>getEnumXmlAdapterTocEntries()Returns all toc entries that link to an enumeration xml adapter.abstract java.util.Set<ModelTypeTocEntry>getModelTypeTocEntries()Returns all toc's entries representing model types.abstract java.util.List<ProductCmptTocEntry>getProductCmptTocEntries()Returns all toc's entries representing product components.abstract java.util.List<ProductCmptTocEntry>getProductCmptTocEntries(java.lang.String kindId)Returns all toc's entries representing product components that belong to the indicated product component kind.abstract ProductCmptTocEntrygetProductCmptTocEntry(java.lang.String id)Returns the toc entry representing a product component for the given id or null if no entry exists for the given id.abstract ProductCmptTocEntrygetProductCmptTocEntry(java.lang.String kindId, java.lang.String versionId)Returns the toc entry representing a product component for the given product component kind id and versionId or null if no such entry exists.java.lang.StringgetProductDataVersion()Return the version of the product data in this table of content.abstract java.util.List<TableContentTocEntry>getTableTocEntries()Returns all toc's entries representing tables.abstract TableContentTocEntrygetTableTocEntryByClassname(java.lang.String implementationClass)Returns a toc entry representing a table for the table's class object.abstract TableContentTocEntrygetTableTocEntryByQualifiedTableName(java.lang.String qualifiedTableName)Returns a toc entry representing a table for this table's qualified table name.abstract java.util.List<TestCaseTocEntry>getTestCaseTocEntries()Returns all toc's entries representing test cases.abstract TestCaseTocEntrygetTestCaseTocEntryByQName(java.lang.String qName)Returns a toc entry representing a test case for the given qualified name.abstract <T extends IRuntimeObject>
java.util.List<CustomTocEntryObject<T>>getTypedTocEntries(java.lang.Class<T> type)voidinitFromXml(org.w3c.dom.Element tocElement)Initializes the table of contents with data stored in the xml element.protected abstract voidinternalAddEntry(TocEntryObject entry)Adds the entry to the table of contents.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.internal.toc.IReadonlyTableOfContents
getCustomTocEntry, getEnumContentTocEntries
-
-
-
-
Field Detail
-
TOC_XML_ELEMENT
public static final java.lang.String TOC_XML_ELEMENT
- See Also:
- Constant Field Values
-
PRODUCT_DATA_VERSION_XML_ELEMENT
public static final java.lang.String PRODUCT_DATA_VERSION_XML_ELEMENT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractReadonlyTableOfContents
public AbstractReadonlyTableOfContents(java.lang.ClassLoader classLoader)
Creates a new TOC that uses the givenClassLoaderto findITocEntryFactoryimplementations viaServiceLoader.- Parameters:
classLoader- theClassLoaderused to findITocEntryFactoryimplementations
-
-
Method Detail
-
initFromXml
public void initFromXml(org.w3c.dom.Element tocElement)
Initializes the table of contents with data stored in the xml element.
-
internalAddEntry
protected abstract void internalAddEntry(TocEntryObject entry)
Adds the entry to the table of contents.
-
getProductCmptTocEntry
public abstract ProductCmptTocEntry getProductCmptTocEntry(java.lang.String id)
Returns the toc entry representing a product component for the given id or null if no entry exists for the given id.- Specified by:
getProductCmptTocEntryin interfaceIReadonlyTableOfContents
-
getProductCmptTocEntry
public abstract ProductCmptTocEntry getProductCmptTocEntry(java.lang.String kindId, java.lang.String versionId)
Returns the toc entry representing a product component for the given product component kind id and versionId or null if no such entry exists.- Specified by:
getProductCmptTocEntryin interfaceIReadonlyTableOfContents
-
getProductCmptTocEntries
public abstract java.util.List<ProductCmptTocEntry> getProductCmptTocEntries()
Returns all toc's entries representing product components.- Specified by:
getProductCmptTocEntriesin interfaceIReadonlyTableOfContents
-
getProductCmptTocEntries
public abstract java.util.List<ProductCmptTocEntry> getProductCmptTocEntries(java.lang.String kindId)
Returns all toc's entries representing product components that belong to the indicated product component kind.- Specified by:
getProductCmptTocEntriesin interfaceIReadonlyTableOfContents
-
getTableTocEntries
public abstract java.util.List<TableContentTocEntry> getTableTocEntries()
Returns all toc's entries representing tables.- Specified by:
getTableTocEntriesin interfaceIReadonlyTableOfContents
-
getTestCaseTocEntries
public abstract java.util.List<TestCaseTocEntry> getTestCaseTocEntries()
Returns all toc's entries representing test cases.- Specified by:
getTestCaseTocEntriesin interfaceIReadonlyTableOfContents
-
getTestCaseTocEntryByQName
public abstract TestCaseTocEntry getTestCaseTocEntryByQName(java.lang.String qName)
Returns a toc entry representing a test case for the given qualified name.- Specified by:
getTestCaseTocEntryByQNamein interfaceIReadonlyTableOfContents
-
getTableTocEntryByClassname
public abstract TableContentTocEntry getTableTocEntryByClassname(java.lang.String implementationClass)
Returns a toc entry representing a table for the table's class object.- Specified by:
getTableTocEntryByClassnamein interfaceIReadonlyTableOfContents
-
getTableTocEntryByQualifiedTableName
public abstract TableContentTocEntry getTableTocEntryByQualifiedTableName(java.lang.String qualifiedTableName)
Returns a toc entry representing a table for this table's qualified table name.- Specified by:
getTableTocEntryByQualifiedTableNamein interfaceIReadonlyTableOfContents
-
getModelTypeTocEntries
public abstract java.util.Set<ModelTypeTocEntry> getModelTypeTocEntries()
Returns all toc's entries representing model types.- Specified by:
getModelTypeTocEntriesin interfaceIReadonlyTableOfContents
-
getEnumContentTocEntry
public abstract EnumContentTocEntry getEnumContentTocEntry(java.lang.String className)
Returns the toc entry representing enum contents for the specified implementation class.- Specified by:
getEnumContentTocEntryin interfaceIReadonlyTableOfContents
-
getEnumXmlAdapterTocEntries
public abstract java.util.Set<EnumXmlAdapterTocEntry> getEnumXmlAdapterTocEntries()
Returns all toc entries that link to an enumeration xml adapter.- Specified by:
getEnumXmlAdapterTocEntriesin interfaceIReadonlyTableOfContents
-
getProductDataVersion
public java.lang.String getProductDataVersion()
Description copied from interface:IReadonlyTableOfContentsReturn the version of the product data in this table of content. This may be a version numbe or a timestamp- Specified by:
getProductDataVersionin interfaceIReadonlyTableOfContents- Returns:
- The version of the table of content
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getTypedTocEntries
public abstract <T extends IRuntimeObject> java.util.List<CustomTocEntryObject<T>> getTypedTocEntries(java.lang.Class<T> type)
-
-