public abstract class DataObject<E extends DataObject<E>> extends Named
Modifier and Type | Field and Description |
---|---|
protected DataObjectPayload |
payload |
Constructor and Description |
---|
DataObject(DataObjectDefinition<E> definition)
creates a new Data Object with a blank payload.
|
DataObject(DataObjectDefinition<E> definition,
Row row,
TableAlias alias)
Generates a data object from the database
|
Modifier and Type | Method and Description |
---|---|
abstract E |
deepcopy()
A deep copy will return a fresh object that has all fields copied and all
properties initiatilized like a new object.
|
java.lang.String |
dropIdToString()
This method returns the id string for an object:
if object is numbered, bring back the number
if object has version, bring back the version
if object has named, bring back the name
if object has id, but not number, bring back the number
|
java.lang.String |
dropToString()
a long text drop of the object including all fields content
|
NamedList<DataUpdateTrigger<E>> |
getDataRefreshTriggers()
Triggers used in the UniqueIdentified refresh method
|
NamedList<DataUpdateTrigger<E>> |
getDataUpdateTriggers()
when the object is updated, it can fire triggers.
|
DataObjectDefinition<E> |
getDefinitionFromObject()
gets the object definition
|
NamedList<SimpleDataElt> |
getFieldList()
gets the list of fields as data structure
|
java.util.List<DataObjectPropertyDefinition.FieldSchemaForDisplay<E>> |
getFlexibleFieldsDefinition()
Normally, fields of the object are determined by the object type, and are
identical for all instances of the same data object class.
|
abstract <Z extends DataObjectProperty<E>> |
getPropertyForObject(Z otherobjectproperty)
This method is intented only to be used on properties internal code.
|
java.lang.String |
getTransientid()
the transient id can be used by an algorithm to store a unique transient id
on an object;
|
<Z extends Autolinkobject<?,?>> |
getUniqueidentiedFromAutolinkObject(Z autolinkobjectproperty)
This is a dirty trick to get left object uniqueidentified property from an
auto link
|
<Z extends Linkedfromchildren<?,?>> |
getUniqueidentiedFromLinkedFromChildren(Z linkedfromchildrenproperty)
This is a dirty trick to get parent object uniqueidentified property from a
linked from children link
|
<Z extends Linkedtoparent<?,E>> |
getUniqueidentiedFromLinkedToParent(Z linkedtoparentobjectproperty)
This is a dirty trick to get parent object uniqueidentified property from an
parent link
|
Uniqueidentified<E> |
getUniqueidentiedFromLinkObject(Linkobject linkobjectproperty)
This is a dirty trick to get left object uniqueidentified property from a
link object.
|
void |
setFrozen()
freezes the object so that it cannot be modified.
|
void |
setTransientid(java.lang.String transientid)
For objects that do not have a persisted id, it is possible to specify a
transient id.
|
void |
setUnfrozen()
unfreezes the object so that it can be modified again
|
void |
updateFromObjectContent(ObjectDataElt object)
updates the objects from data (only fields)
|
void |
writeObjectContent(MessageWriter writer,
java.util.HashMap<java.lang.String,NamedInterface> hiddenfields,
java.lang.String uid)
writes object as a message
|
changeName, cleanName, equals, getName
protected DataObjectPayload payload
public DataObject(DataObjectDefinition<E> definition)
definition
- object definitionpublic DataObject(DataObjectDefinition<E> definition, Row row, TableAlias alias)
definition
- definition of the data objectrow
- the row coming from the databasealias
- the alias to look at in the querypublic NamedList<DataUpdateTrigger<E>> getDataRefreshTriggers()
public java.util.List<DataObjectPropertyDefinition.FieldSchemaForDisplay<E>> getFlexibleFieldsDefinition()
public abstract E deepcopy()
public abstract <Z extends DataObjectProperty<E>> Z getPropertyForObject(Z otherobjectproperty)
otherobjectproperty
- similar property from another objectpublic Uniqueidentified<E> getUniqueidentiedFromLinkObject(Linkobject linkobjectproperty)
linkobjectproperty
- the link object propertypublic <Z extends Autolinkobject<?,?>> Uniqueidentified<E> getUniqueidentiedFromAutolinkObject(Z autolinkobjectproperty)
autolinkobjectproperty
- the autolink object propertypublic <Z extends Linkedtoparent<?,E>> Uniqueidentified<E> getUniqueidentiedFromLinkedToParent(Z linkedtoparentobjectproperty)
linkedtoparentobjectproperty
- the linkedtoparent propertypublic <Z extends Linkedfromchildren<?,?>> Uniqueidentified<E> getUniqueidentiedFromLinkedFromChildren(Z linkedfromchildrenproperty)
linkedfromchildrenproperty
- the linkedfromchildren propertypublic NamedList<DataUpdateTrigger<E>> getDataUpdateTriggers()
public java.lang.String dropToString()
public java.lang.String dropIdToString()
public void setFrozen()
public void setUnfrozen()
public void updateFromObjectContent(ObjectDataElt object)
object
- a Data structure with information about fields (note: this
method does not update property information because property
linked data is updated through actionspublic NamedList<SimpleDataElt> getFieldList()
public void writeObjectContent(MessageWriter writer, java.util.HashMap<java.lang.String,NamedInterface> hiddenfields, java.lang.String uid) throws java.io.IOException
writer
- message writerhiddenfields
- a list of hidden fields not to showuid
- unique id of the objectjava.io.IOException
- if a problem is encountered sending the datapublic DataObjectDefinition<E> getDefinitionFromObject()
public java.lang.String getTransientid()
public void setTransientid(java.lang.String transientid)
transientid
- a transient id guaranteed as unique in the scope of the
algorithm using it