public interface IRecord
Velocity doesn't support records or objects from scratch, thus it's not easy to handle stuctured data. This interface allows to create and read from structured data.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATTRIBUTE_KEY_PREFIX
key "name"
|
static java.lang.String |
CATEGORY_ID_KEY
key "categoryID"
|
static java.lang.String |
CATEGORY_LABEL_KEY
key "categoryLabel"
|
static java.lang.String |
COMMA_SEPARATED_PROPERTY_KEY
key "_commaSeparatedProperty"
|
static java.lang.String |
COMMIT_VERSION_KEY
key "commitVersion"
|
static java.lang.String |
CONTENT_KEY
key "content"
|
static java.lang.String |
CREATION_DATE_KEY
key "creationDate"
|
static java.lang.String |
CREATOR_KEY
key "creator"
|
static java.lang.String |
CUSTOM_KEY_PREFIX
key prefix "custom."
|
static java.lang.String |
DATE_OF_LAST_MODIFICATON_KEY
key "dateOfLastModification"
|
static java.lang.String |
DATE_PROPERTY_KEY
key "_dateProperty"
|
static java.lang.String |
DESCRIPTION_KEY
key "description"
|
static java.lang.String |
DISPLAY_NAME_KEY
key "displayName"
|
static java.lang.String |
ELEMENT_NAME_KEY
key "name"
|
static java.lang.String |
FILE_NAME_POSTFIX
key postfix ".
|
static java.lang.String |
ID_KEY
key "ID"
|
static java.lang.String |
LAST_MODIFIER_KEY
key "lastModifier"
|
static java.lang.String |
MODIFICATION_COUNT_KEY
key "modificationCount"
|
static java.lang.String |
NAME_KEY
key "name"
|
static java.lang.String |
NAMESPACE_KEY
key "namespace"
|
static java.lang.String |
OBJECT_TYPE_KEY
key "objectType"
|
static java.lang.String |
PROCESSING_INSTRUCTION_DATA_KEY
key "data"
|
static java.lang.String |
PROCESSING_INSTRUCTION_TARGET_KEY
key "target"
|
static java.lang.String |
PROJECT_UNIQUE_IDENTIFIER_KEY
key "uniqueIdentifier"
|
static java.lang.String |
ROOT_PROCESSING_INSTRUCTION_KEY
key "processingInstruction"
|
static java.lang.String |
TITLE_KEY
key "title"
|
static java.lang.String |
TYPE_ID_KEY
key "typeID"
|
static java.lang.String |
TYPE_NAME_KEY
key "typeID"
|
static java.lang.String |
UNIQUE_IDENTIFIER_KEY
key "uniqueIdentifier"
|
static java.lang.String |
WRAPPED_OBJECT_KEY
key "wrappedObject"
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.String key,
java.lang.Object value)
Adds an object under the given key.
|
void |
addAll(java.lang.String key,
java.util.Collection<? extends java.lang.Object> values)
Adds a objects under the given key.
|
IRecord |
createAndAdd(java.lang.String key)
Adds a newly created record under the given key.
|
IRecord |
createAndSet(java.lang.String key)
Adds a newly created record under the given key.
|
java.lang.Object |
get(java.lang.String key)
Returns the child object stored under the given key.
|
java.lang.Object |
get(java.lang.String key,
int index)
Returns a child object stored under the given key with a given index.
|
java.util.List<java.lang.Object> |
getAll(java.lang.String key)
Returns all child object stored under the given key.
|
java.util.List<java.lang.String> |
getAttribute_asParagraphList(java.lang.String attributeID)
Equivalent to
getAll(String) for attributeID. |
java.lang.String |
getAttribute_asSingleLine(java.lang.String attributeID)
Equivalent to
get(String) for attributeID. |
java.lang.Long |
getAttribute_asTimestamp_MilliSecondsSince_01_01_1970(java.lang.String attributeID)
Interpretes
get(String) for attributeID as a decimal string
and returns a corresponding Long object. |
java.lang.Object |
getAttribute(java.lang.String attributeID)
Equivalent to
get(String) for attributeID. |
java.lang.String |
getCategoryID()
Equivalent to
get(String) for key CATEGORY_ID_KEY. |
java.lang.String |
getCategoryLabel()
Equivalent to
get(String) for key
CATEGORY_LABEL_KEY. |
java.lang.String |
getCommitVersion()
Equivalent to
get(String) for key
COMMIT_VERSION_KEY. |
java.lang.Long |
getCreationDate_MilliSecondsSince_01_01_1970()
Interpretes
get(String) for key CREATION_DATE_KEY
as a decimal string and returns a corresponding Long object. |
java.lang.String |
getCreationDate()
Interpretes
get(String) for key CREATION_DATE_KEY
as a decimal string that represents milliseconds from 1970-01-01 and
returns a corresponding HTML encoded date string. |
java.lang.String |
getCreator()
Equivalent to
get(String) for key CREATOR_KEY. |
java.lang.Long |
getDateOfLastModification_MilliSecondsSince_01_01_1970()
Interpretes
get(String) for key
DATE_OF_LAST_MODIFICATON_KEY as a decimal string and returns
a corresponding Long object. |
java.lang.String |
getDateOfLastModification()
Interpretes
get(String) for key
DATE_OF_LAST_MODIFICATON_KEY as a decimal string that
represents milliseconds from 1970-01-01 and returns a corresponding
HTML encoded date string. |
java.lang.Long |
getDateTimeProperty_MilliSecondsSince_01_01_1970(java.lang.String propertyID)
Interpretes
get(String) for propertyID as a decimal string
and returns a corresponding Long object. |
java.util.List<java.lang.String> |
getDescription()
Equivalent to
get(String) for key DESCRIPTION_KEY. |
java.lang.String |
getDisplayName()
Equivalent to
get(String) for key DISPLAY_NAME_KEY. |
java.lang.String |
getFileProperty(java.lang.String propertyID)
Returns a XML DocBook representation to access the file attribute.
|
java.lang.String |
getFileProperty(java.lang.String propertyID,
double width_mm,
double height_mm)
Returns a XML DocBook representation to access the file attribute.
|
java.util.List<java.lang.String> |
getFilePropertyAsBase64StringList(java.lang.String propertyID,
boolean breakLines)
Equivalent to
getAll(String) for attributeID. |
java.lang.String |
getFilePropertyAsFileName(java.lang.String propertyID)
Returns the local file name for a file attribute.
|
java.lang.String |
getFilePropertyAsFileName(java.lang.String propertyID,
java.lang.String fileNamePrefix)
Returns the local file name for a file attribute.
|
java.util.List<java.lang.String> |
getFilePropertyAsRawStringList(java.lang.String propertyID,
java.lang.String characterEncoding)
Calls
getAll(String), performs a base64 decoding and splits
the result into text lines. |
java.util.List<java.lang.String> |
getFilePropertyAsStringList(java.lang.String propertyID,
java.lang.String characterEncoding)
Calls
getAll(String), performs a base64 decoding, splits the
result into text lines and html encodes the text lines. |
java.lang.String |
getID()
Equivalent to
get(String) for key ID_KEY. |
java.util.List<java.lang.String> |
getKeySet()
Determines all keys in order they were added.
|
java.lang.String |
getLastModifier()
Equivalent to
get(String) for key LAST_MODIFIER_KEY
. |
java.lang.String |
getModificationCount()
Equivalent to
get(String) for key
MODIFICATION_COUNT_KEY. |
java.lang.String |
getName()
Equivalent to
get(String) for key NAME_KEY. |
int |
getNrOfEntries(java.lang.String key)
Gets the number of child objects stored under the given key.
|
java.lang.String |
getObjectType()
|
java.lang.String |
getProjectUniqueIdentifier()
Equivalent to
get(String) for key
PROJECT_UNIQUE_IDENTIFIER_KEY. |
java.lang.String |
getPropertyAsString(java.lang.String propertyID)
Concatenates alls String returned by
getAll(String) for
propertyID, separting the strings by a space character. |
java.util.List<java.lang.String> |
getPropertyAsStringArray(java.lang.String propertyID)
Deprecated.
|
java.util.List<java.lang.String> |
getPropertyAsStringList(java.lang.String propertyID)
Equivalent to
getAll(String) for propertyID. |
java.lang.String |
getTitle()
Equivalent to
get(String) for key TITLE_KEY. |
java.lang.String |
getTypeID()
Equivalent to
get(String) for key TYPE_ID_KEY. |
java.lang.String |
getTypeName()
Equivalent to
get(String) for key TYPE_NAME_KEY. |
java.lang.String |
getUniqueIdentifier()
Equivalent to
get(String) for key
UNIQUE_IDENTIFIER_KEY. |
java.lang.Object |
getWrappedObject()
Equivalent to
get(String) for key
WRAPPED_OBJECT_KEY. |
boolean |
hasCustomPropertyValues()
|
boolean |
hasDefaultCategory()
Equivalent to
getCategoryID() returns null. |
boolean |
hasPropertyValue(java.lang.String propertyID)
Equivalent to
get(String) returns ! |
void |
insertAt(java.lang.String key,
int index,
java.lang.Object value)
Adds an object under the given key with the given index.
|
boolean |
isProperty(java.lang.String key)
Returns true, if exactly one child object is stored under the given
key that was filled in by calling a set method like
set(String, Object). |
boolean |
isSet(java.lang.String key)
Returns true, if any child object is stored under the given key.
|
boolean |
isTrue(java.lang.String key)
Returns true, if
isProperty(String) returns true and
Boolean.TRUE is stored under the given key. |
void |
replace(java.lang.String key,
int index,
java.lang.Object value)
Adds an object under the given key with the given index.
|
void |
reset(java.lang.String key)
Removes the content stored under a given key
|
void |
set(java.lang.String key)
Adds
Boolean.TRUE under the given key. |
void |
set(java.lang.String key,
java.lang.Object value)
Adds an object under the given key.
|
void |
sortKeySet()
Resorts the key set alphabetically (case sensitive according to the
unicode codepoints of the characters).
|
static final java.lang.String ID_KEY
static final java.lang.String TITLE_KEY
static final java.lang.String NAME_KEY
static final java.lang.String DESCRIPTION_KEY
static final java.lang.String WRAPPED_OBJECT_KEY
static final java.lang.String UNIQUE_IDENTIFIER_KEY
static final java.lang.String PROJECT_UNIQUE_IDENTIFIER_KEY
static final java.lang.String DISPLAY_NAME_KEY
static final java.lang.String TYPE_NAME_KEY
static final java.lang.String TYPE_ID_KEY
static final java.lang.String COMMIT_VERSION_KEY
static final java.lang.String DATE_OF_LAST_MODIFICATON_KEY
static final java.lang.String LAST_MODIFIER_KEY
static final java.lang.String CREATION_DATE_KEY
static final java.lang.String CREATOR_KEY
static final java.lang.String MODIFICATION_COUNT_KEY
static final java.lang.String CUSTOM_KEY_PREFIX
static final java.lang.String FILE_NAME_POSTFIX
static final java.lang.String DATE_PROPERTY_KEY
static final java.lang.String COMMA_SEPARATED_PROPERTY_KEY
static final java.lang.String CATEGORY_ID_KEY
static final java.lang.String CATEGORY_LABEL_KEY
static final java.lang.String OBJECT_TYPE_KEY
static final java.lang.String ROOT_PROCESSING_INSTRUCTION_KEY
static final java.lang.String PROCESSING_INSTRUCTION_TARGET_KEY
static final java.lang.String PROCESSING_INSTRUCTION_DATA_KEY
static final java.lang.String ELEMENT_NAME_KEY
static final java.lang.String NAMESPACE_KEY
static final java.lang.String ATTRIBUTE_KEY_PREFIX
static final java.lang.String CONTENT_KEY
void set(java.lang.String key)
Boolean.TRUE under the given key. The object is added at
the end of this record, i.e. as the last child object in this record.
Before adding the object, all existing objects with the given key are removed.
key - (must not be null)value - (null to remove)void set(java.lang.String key,
java.lang.Object value)
Before adding the object, all existing objects with the given key are removed.
key - (must not be null)value - (null to remove)void add(java.lang.String key,
java.lang.Object value)
Existing objects with the given key will not be removed or overwritten.
key - (must not be null)value - (null to ignore)void addAll(java.lang.String key,
java.util.Collection<? extends java.lang.Object> values)
Existing objects with the given key will not be removed or overwritten.
key - (must not be null)values - (null to ignore, null entries are ignored)IRecord createAndSet(java.lang.String key)
Before adding the child record, all existing objects in this record with the given key are removed.
key - (must not be null)value - (null to remove)IRecord createAndAdd(java.lang.String key)
Existing objects with the given key will not be removed or overwritten.
key - (must not be null)value - (null to remove)boolean isSet(java.lang.String key)
If no object is stored under the given key, false is returned.
key - (must not be null)boolean isTrue(java.lang.String key)
isProperty(String) returns true and
Boolean.TRUE is stored under the given key.
Otherwise, false is returned.
key - (must not be null)boolean isProperty(java.lang.String key)
set(String, Object).
If no object is stored under the given key, or if there are objects
stored under the given key, that have been added by calling an add
method like add(String, Object), false is returned.
key - (must not be null)java.lang.Object get(java.lang.String key)
If multile objects are stored under the given key, the last object is returned. If no object is stored under the given key, null is returned.
key - (must not be null)java.util.List<java.lang.Object> getAll(java.lang.String key)
If multile objects are stored under the given key, they are returned in the order they've been added before.
key - (must not be null)int getNrOfEntries(java.lang.String key)
key - java.lang.Object get(java.lang.String key,
int index)
If no object is stored under the given key with the given indes, null is returned.
key - (must not be null)index - void insertAt(java.lang.String key,
int index,
java.lang.Object value)
Existing objects with the given key will not be removed or overwritten. Objects with lower index stay, objects with higher index are shifted.
key - (must not be null)index - (< 0 will be interpreted as 0, > getNrOfEntries(String) is similar to add(String, Object))value - (null to ignore)void replace(java.lang.String key,
int index,
java.lang.Object value)
Existing objects with the given key will be replaced.
key - (must not be null)index - (< 0 will be ignored, >= getNrOfEntries(String) will be ignored)value - (null to ignore)void reset(java.lang.String key)
key - java.util.List<java.lang.String> getKeySet()
void sortKeySet()
java.lang.String getID()
java.lang.String getTitle()
java.lang.String getName()
java.util.List<java.lang.String> getDescription()
java.lang.Object getWrappedObject()
java.lang.String getUniqueIdentifier()
java.lang.String getProjectUniqueIdentifier()
java.lang.String getDisplayName()
java.lang.String getTypeName()
java.lang.String getTypeID()
java.lang.String getCommitVersion()
java.lang.String getDateOfLastModification()
get(String) for key
DATE_OF_LAST_MODIFICATON_KEY as a decimal string that
represents milliseconds from 1970-01-01 and returns a corresponding
HTML encoded date string. java.lang.Long getDateOfLastModification_MilliSecondsSince_01_01_1970()
get(String) for key
DATE_OF_LAST_MODIFICATON_KEY as a decimal string and returns
a corresponding Long object. java.lang.String getLastModifier()
java.lang.String getCreationDate()
get(String) for key CREATION_DATE_KEY
as a decimal string that represents milliseconds from 1970-01-01 and
returns a corresponding HTML encoded date string. java.lang.Long getCreationDate_MilliSecondsSince_01_01_1970()
get(String) for key CREATION_DATE_KEY
as a decimal string and returns a corresponding Long object.
java.lang.String getCreator()
java.lang.String getModificationCount()
boolean hasCustomPropertyValues()
getKeySet() contains strings that start with
"custom.", false otherwiseboolean hasPropertyValue(java.lang.String propertyID)
get(String) returns != null, false otherwisejava.lang.String getPropertyAsString(java.lang.String propertyID)
getAll(String) for
propertyID, separting the strings by a space character. Exceptional behavior:
getAll(String) for
COMMA_SEPARATED_PROPERTY_KEY contains propertyID, the
strings are separated with ", ".getAll(String) for DATE_PROPERTY_KEY
contains propertyID, get(String) is interpreted as a decimal
string that represents milliseconds from 1970-01-01, the method
returns a corresponding HTML encoded date string.java.util.List<java.lang.String> getPropertyAsStringList(java.lang.String propertyID)
getAll(String) for propertyID. Exceptional behavior:
getAll(String) for DATE_PROPERTY_KEY
contains propertyID, get(String) is interpreted as a decimal
string that represents milliseconds from 1970-01-01, the method
returns list with one entry containing the corresponding HTML encoded
date string.@Deprecated java.util.List<java.lang.String> getPropertyAsStringArray(java.lang.String propertyID)
getPropertyAsStringList(String)java.lang.String getFileProperty(java.lang.String propertyID)
getAll(String), performs a base64 decoding and stores
the content in a temporary directory. The XML DocBook representation
depends on the currently selected document writer which will
transform the transitional format into the selected target format.propertyID - The properties idjava.lang.String getFileProperty(java.lang.String propertyID,
double width_mm,
double height_mm)
getAll(String), performs a base64 decoding and stores
the content in a temporary directory. The XML DocBook representation
depends on the currently selected document writer which will
transform the transitional format into the selected target format.
If the file represents an image, width and height can be specified (0
= unspecified)propertyID - The properties idwidth_mm - width in mm (0 = unspecified)height_mm - height in mm (0 = unspecified)java.lang.String getFilePropertyAsFileName(java.lang.String propertyID)
getAll(String), performs a base64 decoding and stores the
content in a temporary directory. The file can be accessed during
document generation. It will not be available anymore from the target
output.propertyID - The properties idjava.lang.String getFilePropertyAsFileName(java.lang.String propertyID,
java.lang.String fileNamePrefix)
getAll(String), performs a base64 decoding and stores the
content in a temporary directory. The file can be accessed during
document generation. It will not be available anymore from the target
output.propertyID - The properties idfileNamePrefix - a prefix added to the filenamejava.util.List<java.lang.String> getFilePropertyAsStringList(java.lang.String propertyID,
java.lang.String characterEncoding)
getAll(String), performs a base64 decoding, splits the
result into text lines and html encodes the text lines.propertyID - The properties idcharacterEncoding - the encoding to be used when readingjava.util.List<java.lang.String> getFilePropertyAsRawStringList(java.lang.String propertyID,
java.lang.String characterEncoding)
propertyID - The properties idcharacterEncoding - the encoding to be used when readingjava.util.List<java.lang.String> getFilePropertyAsBase64StringList(java.lang.String propertyID,
boolean breakLines)
propertyID - keybreakLines - java.lang.Long getDateTimeProperty_MilliSecondsSince_01_01_1970(java.lang.String propertyID)
propertyID - keyjava.lang.String getCategoryID()
java.lang.String getCategoryLabel()
boolean hasDefaultCategory()
getCategoryID() returns null, false
otherwisejava.lang.String getObjectType()
java.lang.Object getAttribute(java.lang.String attributeID)
attributeID - keyjava.lang.String getAttribute_asSingleLine(java.lang.String attributeID)
attributeID - keyjava.util.List<java.lang.String> getAttribute_asParagraphList(java.lang.String attributeID)
attributeID - keyjava.lang.Long getAttribute_asTimestamp_MilliSecondsSince_01_01_1970(java.lang.String attributeID)
get(String) for attributeID as a decimal string
and returns a corresponding Long object. attributeID - key