public final class TableFormat extends java.lang.Object implements java.lang.Iterable<FieldFormat>, java.lang.Cloneable, PublicCloneable, StringEncodable
TableFormat describes fields and other options of a DataTable or a DataRecord.| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_RECORDS |
static int |
DEFAULT_MIN_RECORDS |
static TableFormat |
EMPTY_FORMAT |
static char |
RECORD_VALIDATOR_KEY_FIELDS |
static char |
TABLE_VALIDATOR_EXPRESSION |
static char |
TABLE_VALIDATOR_KEY_FIELDS |
| Constructor and Description |
|---|
TableFormat()
Constructs a default empty
TableFormat. |
TableFormat(boolean reorderable)
Constructs a
TableFormat with specified reorderable flag. |
TableFormat(FieldFormat ff)
Constructs a
TableFormat with a single field specified by FieldFormat. |
TableFormat(int minRecords,
int maxRecords)
Constructs a
TableFormat with specified minimum and maximum number of records. |
TableFormat(int minRecords,
int maxRecords,
FieldFormat fieldFormat) |
TableFormat(int minRecords,
int maxRecords,
java.lang.String fieldFormat) |
TableFormat(java.lang.String format,
ClassicEncodingSettings settings) |
TableFormat(java.lang.String format,
ClassicEncodingSettings settings,
boolean validate) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBinding(Binding binding)
Adds new binding.
|
void |
addBinding(Reference target,
Expression expression)
Adds new binding.
|
void |
addBinding(java.lang.String target,
java.lang.String expression)
Adds new binding.
|
void |
addField(char type,
java.lang.String name)
Adds new field to format.
|
TableFormat |
addField(char type,
java.lang.String name,
int index)
Note, that modifying table format of an existing table by inserting fields anywhere except appending them to the end may cause
DataTable to become invalid. |
TableFormat |
addField(char type,
java.lang.String name,
java.lang.String description)
Adds new field to format.
|
TableFormat |
addField(char type,
java.lang.String name,
java.lang.String description,
java.lang.Object defaultValue)
Adds new field to format.
|
TableFormat |
addField(char type,
java.lang.String name,
java.lang.String description,
java.lang.Object defaultValue,
boolean nullable)
Adds new field to format.
|
TableFormat |
addField(char type,
java.lang.String name,
java.lang.String description,
java.lang.Object defaultValue,
boolean nullable,
java.lang.String group)
Adds new field to format.
|
TableFormat |
addField(char type,
java.lang.String name,
java.lang.String description,
java.lang.Object defaultValue,
java.lang.String group)
Adds new field to format.
|
TableFormat |
addField(FieldFormat ff)
Adds new field to format.
|
TableFormat |
addField(FieldFormat ff,
int index)
Adds new field to format at the specified index.
|
TableFormat |
addField(java.lang.String encodedFormat)
Adds new field to format.
|
TableFormat |
addFields(FieldFormat[] fieldFormats)
Adds new fields to format.
|
TableFormat |
addFields(java.util.List<FieldFormat> fieldFormats)
Adds new fields to format.
|
void |
addRecordValidator(RecordValidator rv)
Adds new record validator to the format.
|
void |
addTableValidator(TableValidator tv)
Adds new table validator to the format.
|
void |
applyCachedFormat(FormatCache formatCache,
java.util.function.Consumer<TableFormat> formatSetter) |
TableFormat |
clone() |
TableFormat |
cloneIfImmutable() |
boolean |
containsDataBlocksOrTables() |
void |
createTableValidators(java.lang.String source,
ClassicEncodingSettings settings) |
java.lang.String |
encode(boolean useVisibleSeparators) |
java.lang.String |
encode(ClassicEncodingSettings settings) |
java.lang.String |
encode(ClassicEncodingSettings settings,
java.lang.Boolean isTransferEncode,
java.lang.Integer encodeLevel) |
java.lang.StringBuilder |
encode(java.lang.StringBuilder builder,
ClassicEncodingSettings settings,
java.lang.Boolean isTransferEncode,
java.lang.Integer encodeLevel) |
boolean |
equals(java.lang.Object obj) |
boolean |
extend(TableFormat other)
Returns true if this format extends the
other format. |
java.lang.String |
extendMessage(TableFormat other) |
java.util.List<Binding> |
getBindings()
Returns modifiable list of table bindings.
|
java.lang.String |
getEncodedTableValidators(ClassicEncodingSettings settings) |
FieldFormat |
getField(int index)
Returns format of field with specified index.
|
FieldFormat |
getField(java.lang.String fieldName)
Returns format of field with specified name.
|
int |
getFieldCount()
Returns number of fields in table format.
|
int |
getFieldIndex(java.lang.String name)
Returns index of field with the specified name or -1 if it does not exist.
|
java.util.Map<java.lang.String,java.lang.Integer> |
getFieldLookup() |
java.lang.String |
getFieldName(int index)
Returns name of field at the specified index.
|
java.util.List<FieldFormat> |
getFields()
Returns list of fields in table format.
|
char |
getFieldType(int index)
Returns type of field at the specified index.
|
java.lang.Integer |
getId() |
java.util.List<java.lang.String> |
getKeyFields()
Returns list of key field names.
|
int |
getMaxRecords()
Returns maximal number of records allowed by format.
|
int |
getMinRecords()
Returns minimal number of records allowed by format.
|
Expression |
getNamingExpression()
Returns naming expression.
|
java.util.List<RecordValidator> |
getRecordValidators()
Returns modifiable list of record validators.
|
java.util.List<TableValidator> |
getTableValidators()
Returns modifiable list of table validators.
|
boolean |
hasField(java.lang.String name)
Returns true if table format contains field with specified name.
|
boolean |
hasFields(char type)
Returns true if table format contains fields of the specified type.
|
int |
hashCode() |
boolean |
hasReadOnlyFields()
Returns true if format has read-only fields
|
boolean |
isAdvanced() |
boolean |
isAttachedToAnotherCache(FormatCache formatCache) |
boolean |
isBindingsEditable() |
boolean |
isCachedLocally() |
boolean |
isEmpty() |
boolean |
isGrouped() |
boolean |
isImmutable() |
boolean |
isReadonly() |
boolean |
isReorderable()
Returns true if format allows record reordering.
|
boolean |
isReplicated() |
boolean |
isSingleCell() |
boolean |
isSingleField() |
boolean |
isSingleRecord() |
boolean |
isUnresizable() |
java.util.Iterator<FieldFormat> |
iterator() |
void |
makeImmutable(DataTable immutabilizer) |
void |
removeBinding(Binding binding)
Removes the binding.
|
TableFormat |
removeField(java.lang.String name)
Removes field from format.
|
TableFormat |
renameField(java.lang.String oldName,
java.lang.String newName)
Renames a field.
|
TableFormat |
resetAllowedRecords()
Resets allowed number of records to defaults.
|
void |
setBindings(java.util.List<Binding> in_bindings)
Set the bindings.
|
void |
setBindingsEditable(boolean bindingsEditable) |
void |
setFormatCacheIdentityHashCode(int formatCacheIdentityHashCode) |
void |
setId(java.lang.Integer id) |
TableFormat |
setMaxRecords(int maxRecords)
Sets maximum allowed number of records.
|
TableFormat |
setMinRecords(int minRecords)
Sets minimum allowed number of records.
|
TableFormat |
setNamingExpression(Expression namingExpression)
Sets naming expression.
|
TableFormat |
setNamingExpression(java.lang.String namingExpression)
Sets naming expression.
|
TableFormat |
setReorderable(boolean reorderable)
Sets reorderable flag that allows table record reordering.
|
void |
setUnresizable(boolean unresizable) |
java.lang.String |
toString() |
public static final TableFormat EMPTY_FORMAT
public static final int DEFAULT_MIN_RECORDS
public static final int DEFAULT_MAX_RECORDS
public static final char TABLE_VALIDATOR_KEY_FIELDS
public static final char TABLE_VALIDATOR_EXPRESSION
public static final char RECORD_VALIDATOR_KEY_FIELDS
public TableFormat()
TableFormat.public TableFormat(boolean reorderable)
TableFormat with specified reorderable flag.public TableFormat(int minRecords,
int maxRecords)
TableFormat with specified minimum and maximum number of records.public TableFormat(FieldFormat ff)
TableFormat with a single field specified by FieldFormat.public TableFormat(java.lang.String format,
ClassicEncodingSettings settings)
public TableFormat(java.lang.String format,
ClassicEncodingSettings settings,
boolean validate)
public TableFormat(int minRecords,
int maxRecords,
java.lang.String fieldFormat)
public TableFormat(int minRecords,
int maxRecords,
FieldFormat fieldFormat)
public TableFormat addFields(FieldFormat[] fieldFormats)
public TableFormat addFields(java.util.List<FieldFormat> fieldFormats)
public TableFormat addField(FieldFormat ff)
public TableFormat addField(java.lang.String encodedFormat)
public void addField(char type,
java.lang.String name)
throws DataTableException
DataTableExceptionpublic TableFormat addField(char type, java.lang.String name, java.lang.String description)
public TableFormat addField(char type, java.lang.String name, java.lang.String description, java.lang.Object defaultValue)
public TableFormat addField(char type, java.lang.String name, java.lang.String description, java.lang.Object defaultValue, java.lang.String group)
public TableFormat addField(char type, java.lang.String name, java.lang.String description, java.lang.Object defaultValue, boolean nullable)
public TableFormat addField(char type, java.lang.String name, java.lang.String description, java.lang.Object defaultValue, boolean nullable, java.lang.String group)
public TableFormat addField(FieldFormat ff, int index)
DataTable to become invalid.public TableFormat addField(char type, java.lang.String name, int index) throws DataTableException
DataTable to become invalid.DataTableExceptionpublic TableFormat removeField(java.lang.String name)
public TableFormat renameField(java.lang.String oldName, java.lang.String newName)
public char getFieldType(int index)
public java.lang.String getFieldName(int index)
public int getFieldIndex(java.lang.String name)
public int getFieldCount()
public java.util.List<FieldFormat> getFields()
public java.util.List<RecordValidator> getRecordValidators()
public java.util.List<TableValidator> getTableValidators()
public int getMaxRecords()
public int getMinRecords()
public boolean isReorderable()
public boolean isUnresizable()
public void setUnresizable(boolean unresizable)
public boolean isBindingsEditable()
public void setBindingsEditable(boolean bindingsEditable)
public java.util.List<Binding> getBindings()
public void addBinding(Binding binding)
public void addBinding(Reference target, Expression expression)
public void addBinding(java.lang.String target,
java.lang.String expression)
public void removeBinding(Binding binding)
public void setBindings(java.util.List<Binding> in_bindings)
public Expression getNamingExpression()
public java.lang.String encode(boolean useVisibleSeparators)
public java.lang.String encode(ClassicEncodingSettings settings)
public java.lang.String encode(ClassicEncodingSettings settings, java.lang.Boolean isTransferEncode, java.lang.Integer encodeLevel)
public java.lang.StringBuilder encode(java.lang.StringBuilder builder,
ClassicEncodingSettings settings,
java.lang.Boolean isTransferEncode,
java.lang.Integer encodeLevel)
encode in interface StringEncodablepublic java.util.Map<java.lang.String,java.lang.Integer> getFieldLookup()
public java.lang.String getEncodedTableValidators(ClassicEncodingSettings settings)
public java.lang.String toString()
toString in class java.lang.Objectpublic FieldFormat getField(int index)
public FieldFormat getField(java.lang.String fieldName)
public boolean hasField(java.lang.String name)
public boolean hasFields(char type)
public boolean hasReadOnlyFields()
public java.util.List<java.lang.String> getKeyFields()
public boolean extend(TableFormat other)
other format.public java.lang.String extendMessage(TableFormat other)
public void addTableValidator(TableValidator tv)
public void addRecordValidator(RecordValidator rv)
public void createTableValidators(java.lang.String source,
ClassicEncodingSettings settings)
public java.util.Iterator<FieldFormat> iterator()
iterator in interface java.lang.Iterable<FieldFormat>public boolean isReplicated()
public boolean isReadonly()
public boolean isGrouped()
public boolean isAdvanced()
public boolean isSingleRecord()
public boolean isSingleField()
public boolean isSingleCell()
public boolean isEmpty()
public boolean isImmutable()
public TableFormat resetAllowedRecords()
public TableFormat setMaxRecords(int maxRecords)
public TableFormat setMinRecords(int minRecords)
public TableFormat setReorderable(boolean reorderable)
public TableFormat setNamingExpression(Expression namingExpression)
public TableFormat setNamingExpression(java.lang.String namingExpression)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic TableFormat cloneIfImmutable()
public TableFormat clone()
clone in interface PublicCloneableclone in class java.lang.Objectpublic void makeImmutable(DataTable immutabilizer)
public java.lang.Integer getId()
public void setId(java.lang.Integer id)
public void applyCachedFormat(FormatCache formatCache, java.util.function.Consumer<TableFormat> formatSetter)
public void setFormatCacheIdentityHashCode(int formatCacheIdentityHashCode)
public boolean isAttachedToAnotherCache(FormatCache formatCache)
public boolean isCachedLocally()
public boolean containsDataBlocksOrTables()