Class Table<R>
- All Implemented Interfaces:
ITable<R>
Generated table classes have a java.util.Map or a org.faktorips.util.ReadOnlyBinaryRangeTree member variable for each of their find methods. These maps or trees get filled at initialization time and are accessed within the find methods. Maps are used as member variables if the value to return can be identified by means of a hash key. A hash key can consist of multiple fields of value types (e.g. integer, long, decimal). If the value to return is identified by a range of key values a tree is used as the data structure to efficiently retrieve the value from. If the key that identifies a value consists of a combination of hash keys and range fields a map is used that contains trees as values. Depending on the number of range fields a tree hierarchy is build up where the depth of the hierarchy is determined by the number of range fields. That means that each node of a tree contains another tree representing the next level.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.faktorips.values.InternationalStringThe description for this table in all configured languages.Contains all rows of this table. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaddRow(List<String> columns, IRuntimeRepository productRepository) Is used by the generated class to retrieve the values for a single row.Returns all rows of this table.getDescription(Locale locale) getName()Returns the qualified name of this table.protected final voidinit()voidinitFromXml(InputStream is, IRuntimeRepository productRepository, String qualifiedTableName) Initializes this object with the data stored in the XML element.protected abstract voidIs used by the generated classes to build up the the maps and trees that are used by the also generated find-methods.protected booleanIs used by generated classes within the initKeyMaps() method to identify a null values.protected voidTemplate method to perform additional initializations.voidsetDescription(Locale locale, String newDescriptionText, IRuntimeRepository repository) Sets or updates the description for the givenLocale.voidsetDescription(org.faktorips.values.InternationalString newDescription, IRuntimeRepository repository) Replaces the current multi-language description with the givenInternationalString.toString()Returns the String representation of up to ten of this table's rows.Creates an XMLElementthat represents this table's data.
-
Field Details
-
rows
Contains all rows of this table. -
description
protected org.faktorips.values.InternationalString descriptionThe description for this table in all configured languages.
-
-
Constructor Details
-
Table
public Table()Default constructor for tables initialized from XML.- Since:
- 23.6
-
Table
Constructor for tables created from code.- Since:
- 23.6
-
-
Method Details
-
addRow
Is used by the generated class to retrieve the values for a single row.- Parameters:
columns- List of objects that contain the values.
-
initKeyMaps
protected abstract void initKeyMaps()Is used by the generated classes to build up the the maps and trees that are used by the also generated find-methods. -
initFromXml
public void initFromXml(InputStream is, IRuntimeRepository productRepository, String qualifiedTableName) throws Exception Initializes this object with the data stored in the XML element.- Throws:
Exception
-
init
protected final void init() -
performAdditionalInitializations
protected void performAdditionalInitializations()Template method to perform additional initializations. Is called during the initialization of the table (from XML), right afterinitKeyMaps().Subclasses may override to provide an implementation. The default implementation is empty, so no super-call is necessary.
-
isNull
Is used by generated classes within the initKeyMaps() method to identify a null values.- Parameters:
valueElement- the element that contains the value for a field within a row- Returns:
- true if the the isNull attribute contains true otherwise false
-
toString
Returns the String representation of up to ten of this table's rows. -
getName
Description copied from interface:ITableReturns the qualified name of this table. -
getDescription
-
setDescription
public void setDescription(@NonNull Locale locale, @NonNull String newDescriptionText, @NonNull IRuntimeRepository repository) Description copied from interface:ITableSets or updates the description for the givenLocale.If the description for the locale already exists, it will be replaced. If no description exists, a new localized description entry will be added. If the table belongs to a read-only
IRuntimeRepository, this method will throw anIllegalRepositoryModificationException.- Specified by:
setDescriptionin interfaceITable<R>- Parameters:
locale- the locale for which the description is to be set (must not benull)newDescriptionText- the new description text for the given locale (must not benull)repository- the runtime repository containing the table (must not benull)
-
setDescription
public void setDescription(@NonNull org.faktorips.values.InternationalString newDescription, @NonNull IRuntimeRepository repository) Description copied from interface:ITableReplaces the current multi-language description with the givenInternationalString.This method will overwrite all existing localized descriptions. If the table belongs to a read-only
IRuntimeRepository, this method will throw anIllegalRepositoryModificationException.- Specified by:
setDescriptionin interfaceITable<R>- Parameters:
newDescription- the new internationalized description to set (must not benull)repository- the runtime repository containing the table (must not benull)
-
getAllRows
Description copied from interface:ITableReturns all rows of this table.- Specified by:
getAllRowsin interfaceITable<R>
-
toXml
Description copied from interface:ITableCreates an XMLElementthat represents this table's data.Throws an
UnsupportedOperationExceptionif the support for toXml ("Generate toXml Support") is not activated in the Faktor-IPS standard builder.
-