org.faktorips.runtime.internal.toc
Class AbstractReadonlyTableOfContents

java.lang.Object
  extended by org.faktorips.runtime.internal.toc.AbstractReadonlyTableOfContents
All Implemented Interfaces:
IReadonlyTableOfContents
Direct Known Subclasses:
ReadonlyTableOfContents

public abstract class AbstractReadonlyTableOfContents
extends 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
static String PRODUCT_DATA_VERSION_XML_ELEMENT
           
static String TOC_XML_ELEMENT
           
 
Constructor Summary
AbstractReadonlyTableOfContents(ClassLoader classLoader)
          Creates a new TOC that uses the given ClassLoader to find ITocEntryFactory implementations via ServiceLoader.
 
Method Summary
abstract  EnumContentTocEntry getEnumContentTocEntry(String className)
          Returns the toc entry representing enum contents for the specified implementation class.
abstract  Set<EnumXmlAdapterTocEntry> getEnumXmlAdapterTocEntries()
          Returns all toc entries that link to an enumeration xml adapter.
abstract  Set<ModelTypeTocEntry> getModelTypeTocEntries()
          Returns all toc's entries representing model types.
abstract  List<ProductCmptTocEntry> getProductCmptTocEntries()
          Returns all toc's entries representing product components.
abstract  List<ProductCmptTocEntry> getProductCmptTocEntries(String kindId)
          Returns all toc's entries representing product components that belong to the indicated product component kind.
abstract  ProductCmptTocEntry getProductCmptTocEntry(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  ProductCmptTocEntry getProductCmptTocEntry(String kindId, 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.
 String getProductDataVersion()
          Return the version of the product data in this table of content.
abstract  List<TableContentTocEntry> getTableTocEntries()
          Returns all toc's entries representing tables.
abstract  TableContentTocEntry getTableTocEntryByClassname(String implementationClass)
          Returns a toc entry representing a table for the table's class object.
abstract  TableContentTocEntry getTableTocEntryByQualifiedTableName(String qualifiedTableName)
          Returns a toc entry representing a table for this table's qualified table name.
abstract  List<TestCaseTocEntry> getTestCaseTocEntries()
          Returns all toc's entries representing test cases.
abstract  TestCaseTocEntry getTestCaseTocEntryByQName(String qName)
          Returns a toc entry representing a test case for the given qualified name.
abstract
<T extends IRuntimeObject>
List<CustomTocEntryObject<T>>
getTypedTocEntries(Class<T> type)
           
 void initFromXml(Element tocElement)
          Initializes the table of contents with data stored in the xml element.
protected abstract  void internalAddEntry(TocEntryObject entry)
          Adds the entry to the table of contents.
 String toString()
           
 
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 String TOC_XML_ELEMENT
See Also:
Constant Field Values

PRODUCT_DATA_VERSION_XML_ELEMENT

public static final String PRODUCT_DATA_VERSION_XML_ELEMENT
See Also:
Constant Field Values
Constructor Detail

AbstractReadonlyTableOfContents

public AbstractReadonlyTableOfContents(ClassLoader classLoader)
Creates a new TOC that uses the given ClassLoader to find ITocEntryFactory implementations via ServiceLoader.

Parameters:
classLoader - the ClassLoader used to find ITocEntryFactory implementations
Method Detail

initFromXml

public void initFromXml(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(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:
getProductCmptTocEntry in interface IReadonlyTableOfContents

getProductCmptTocEntry

public abstract ProductCmptTocEntry getProductCmptTocEntry(String kindId,
                                                           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:
getProductCmptTocEntry in interface IReadonlyTableOfContents

getProductCmptTocEntries

public abstract List<ProductCmptTocEntry> getProductCmptTocEntries()
Returns all toc's entries representing product components.

Specified by:
getProductCmptTocEntries in interface IReadonlyTableOfContents

getProductCmptTocEntries

public abstract List<ProductCmptTocEntry> getProductCmptTocEntries(String kindId)
Returns all toc's entries representing product components that belong to the indicated product component kind.

Specified by:
getProductCmptTocEntries in interface IReadonlyTableOfContents

getTableTocEntries

public abstract List<TableContentTocEntry> getTableTocEntries()
Returns all toc's entries representing tables.

Specified by:
getTableTocEntries in interface IReadonlyTableOfContents

getTestCaseTocEntries

public abstract List<TestCaseTocEntry> getTestCaseTocEntries()
Returns all toc's entries representing test cases.

Specified by:
getTestCaseTocEntries in interface IReadonlyTableOfContents

getTestCaseTocEntryByQName

public abstract TestCaseTocEntry getTestCaseTocEntryByQName(String qName)
Returns a toc entry representing a test case for the given qualified name.

Specified by:
getTestCaseTocEntryByQName in interface IReadonlyTableOfContents

getTableTocEntryByClassname

public abstract TableContentTocEntry getTableTocEntryByClassname(String implementationClass)
Returns a toc entry representing a table for the table's class object.

Specified by:
getTableTocEntryByClassname in interface IReadonlyTableOfContents

getTableTocEntryByQualifiedTableName

public abstract TableContentTocEntry getTableTocEntryByQualifiedTableName(String qualifiedTableName)
Returns a toc entry representing a table for this table's qualified table name.

Specified by:
getTableTocEntryByQualifiedTableName in interface IReadonlyTableOfContents

getModelTypeTocEntries

public abstract Set<ModelTypeTocEntry> getModelTypeTocEntries()
Returns all toc's entries representing model types.

Specified by:
getModelTypeTocEntries in interface IReadonlyTableOfContents

getEnumContentTocEntry

public abstract EnumContentTocEntry getEnumContentTocEntry(String className)
Returns the toc entry representing enum contents for the specified implementation class.

Specified by:
getEnumContentTocEntry in interface IReadonlyTableOfContents

getEnumXmlAdapterTocEntries

public abstract Set<EnumXmlAdapterTocEntry> getEnumXmlAdapterTocEntries()
Returns all toc entries that link to an enumeration xml adapter.

Specified by:
getEnumXmlAdapterTocEntries in interface IReadonlyTableOfContents

getProductDataVersion

public String getProductDataVersion()
Description copied from interface: IReadonlyTableOfContents
Return the version of the product data in this table of content. This may be a version numbe or a timestamp

Specified by:
getProductDataVersion in interface IReadonlyTableOfContents
Returns:
The version of the table of content

toString

public String toString()
Overrides:
toString in class Object

getTypedTocEntries

public abstract <T extends IRuntimeObject> List<CustomTocEntryObject<T>> getTypedTocEntries(Class<T> type)


Copyright © 2015. All rights reserved.