public abstract class Property<E extends Property<E>> extends ObjectElement
Modifier and Type | Class and Description |
---|---|
class |
Property.PropertyElementDisplayDefinition
A simple classe to define how to display a property element definition
|
Modifier and Type | Field and Description |
---|---|
static int |
FIELDDIPLSAY_TITLE_MOD |
static int |
FIELDDISPLAY_BOTTOMNOTES |
static int |
FIELDDISPLAY_NONE |
static int |
FIELDDISPLAY_NORMAL |
static int |
FIELDDISPLAY_NORMAL_MOD |
static int |
FIELDDISPLAY_TITLE |
protected DataObjectDefinition |
parent |
Constructor and Description |
---|
Property(java.lang.String name)
creates a property for the given name
|
Property(java.lang.String name,
java.lang.String propertyclassname) |
Modifier and Type | Method and Description |
---|---|
void |
addBusinessRule(PropertyBusinessRule<E> businessrule) |
protected void |
addChoiceCategoryHelper(java.lang.String name,
ChoiceCategory category)
adds a choice category helper.
|
protected void |
addContextForDataCreation(ArgumentContent contextdata)
context for data creation is provided by the context.
|
protected void |
addDataAccessMethod(DataAccessMethod dam)
a data access method is a method defined by the property that will be
available to the object for a business action
|
protected void |
addDataInput(ArgumentContent datainput)
sets data input (by default for creation).
|
protected void |
addDependentProperty(Property<?> property)
This defines a relation between the current property and the dependent
property.
|
void |
addDisplayProfileForProperty(DisplayProfile displayprofile)
adds a display profile for this property.
|
void |
addElement(Element e)
adds a stored element to the property without any display or update setting
|
void |
addElement(Element e,
java.lang.String display,
java.lang.String tooltip,
int fielddisplaymode,
int fielddisplaypriority,
int showcaractersintable)
/** adds a stored element with display of the field specified
|
void |
addElementasSearchElement(Element e,
java.lang.String display,
java.lang.String tooltip,
int fielddisplaymode,
int fielddisplaypriority,
int showcaractersintable,
SearchWidgetDefinition searchdef)
adds a stored element with display of the field specified and the field
appearing in field searches
|
protected void |
addExternalObjectProperty(DataObjectDefinition externalobject,
Property<?> externalobjectproperty)
adds an external object property to this property.
|
protected void |
addFieldOverrides(FieldOverrideForProperty override)
adds a Field Overrides for the given property.
|
protected void |
addMethodAdditionalProcessing(MethodAdditionalProcessing map)
adds a method additional processing to a related property
|
protected void |
addObjectToAuthorityMapper(java.lang.String name,
ObjectToAuthorityMapper mapper)
adds
|
void |
addPropertyGenerics(PropertyGenerics generics)
adds a generics to the property.
|
protected void |
addStringHelper(java.lang.String name,
java.lang.String payload)
A string helper is a string input defined when defining the property on a
given object.
|
void |
controlAfterParentDefinition()
to be implemented if controls have to be performed after parent is added.
|
void |
generatePropertyHelperToFile(SourceGenerator sg,
Module module)
Generates in the data folder the property helper.
|
PropertyBusinessRule<E> |
getBusinessRule(int index)
gets the business rule at the given index
|
PropertyBusinessRule<E> |
getBusinessRuleByName(java.lang.String name)
queries the business rule by name, return null if no corresponding business
rule is found
|
int |
getBusinessRuleNumber() |
ChoiceCategory |
getChoiceCategoryByKey(java.lang.String key)
gets the choice category by the given key
|
java.util.Iterator<java.lang.String> |
getChoiceCategoryKeyNumber()
An iterator on choice categories used by this property.
|
int |
getChoiceCategoryNumber()
provides the number of choice categories used by this property.
|
ArgumentContent |
getContextDataForCreation(int index)
gets the type of context data for creation of an object with this property
|
int |
getContextDataForCreationSize()
gets the number of context data for creation of property.
|
DataAccessMethod |
getDataAccessMethod(int index)
get the data access method at the provided index
|
DataAccessMethod |
getDataAccessMethod(java.lang.String name)
get data access method for the given name
|
int |
getDataAccessMethodnumber() |
ArgumentContent |
getDataInputForCreation(int index)
gets the type of data input (argument content) for creation of an object with
this property
|
int |
getDataInputSize() |
java.lang.String |
getDataObjectConstructorAttributes() |
java.lang.String |
getDataObjectFieldName() |
Property<?>[] |
getDependentProperties()
this method should returns all properties this property is dependent on.
|
Property.PropertyElementDisplayDefinition |
getDisplayDefinitionForElement(Element e)
gets the display definition for a given element of the property
|
DisplayProfile |
getDisplayProfileForProperty(int index)
gets the display profile at the given index
|
int |
getDisplayProfileForPropertyNumber()
gets the number of display profiles defined for this property
|
DataObjectDefinition |
getExternalObject(int index)
returns an external object for which this property has reference
|
abstract java.util.ArrayList<DataObjectDefinition> |
getExternalObjectDependence() |
Property<?> |
getExternalObjectProperty(int index)
the related property for the external object at the given index
|
int |
getExternalObjectPropertySize() |
FieldOverrideForProperty |
getFieldOverridesat(int index)
gets the field override at the given index
|
int |
getFieldOverridesNumber()
get the number of field overrides defined for the object
|
java.lang.String |
getInstancename() |
java.lang.String |
getJavaClassType() |
MethodAdditionalProcessing |
getMethodAdditionalProcessing(int index)
get the method additional processing at the given index
|
int |
getMethodAdditionalProcessingnumber() |
DataObjectDefinition |
getParent()
get the parent DataObjectDefinition for the property
|
java.lang.String |
getPropertyclassname()
the property class name (different for the instance name in case the same
property has several instances)
|
abstract java.lang.String[] |
getPropertyDeepCopyStatement()
Returns the required deepcopy statement for the property, sends back null if
nothing is required.
|
abstract java.lang.String[] |
getPropertyExtractMethod()
This method should return non null value only if
setCreationDataInputForUpdate() is set
|
PropertyGenerics |
getPropertyGenerics(int index)
gest the property generics at the given index
|
int |
getPropertyGenericsSize() |
java.lang.String |
getPropertyGenericsString() |
java.lang.String |
getPropertyHelperName()
A property can have a specific property helper.
|
abstract java.lang.String[] |
getPropertyInitMethod()
this method uses the context data for creation and the data-input for
standard creation.
|
boolean |
hasDynamicDefinitionHelper() |
boolean |
hasInterface()
only properties that exist with only one instance can have an interface and
so be referenced as significant property for the PropertyGenerics of
anotherproperty
|
boolean |
hasStaticQuery() |
protected void |
hideDataInputForCreation()
will use the data input only for update
|
boolean |
isDatainputatbottom() |
boolean |
isDataInputHiddenForCreation()
an indicator telling if data input should be hidden for creation (and so
shown on update page only)
|
boolean |
isDataInputUsedForUpdate()
data input argument can be shown on create (default) but also on update.
|
boolean |
isLegacy() |
boolean |
isPropertyHelperTransient() |
protected void |
setAsLegacy()
sets this property as legacy
|
void |
setDatainputatbottom(boolean datainputatbottom)
allows to set if data input for the property during creation page is at top
or bottom of objects
|
protected void |
setDataInputForUpdate()
will also use the data input for creation for the update of object
|
void |
setDynamicDefinitionHelper()
When a property has a dynamic definition helper, the definition helper has to
be defined for each instance of the object.
|
protected void |
setExtraAttributes(java.lang.String extraattributes)
This allows a property to add specific attributes to pass to the property
definition when creating it.
|
abstract void |
setFinalSettings()
an abstract method to be implemented by properties for finalizations to be
performed after all data objects have been created.
|
void |
writeAdditionalDefinition(SourceGenerator sg)
This method allows a property to define extra conditions when writing
additional definition on the property
|
AddElementWithSearch, addIndex, getDisplayname, getElements, getIndex, getJavaType, getSearchWidgetList, getTooltip, writeDependentClass
changeName, cleanName, equals, getName
protected DataObjectDefinition parent
public static final int FIELDDISPLAY_NONE
public static final int FIELDDISPLAY_BOTTOMNOTES
public static final int FIELDDISPLAY_NORMAL
public static final int FIELDDISPLAY_NORMAL_MOD
public static final int FIELDDISPLAY_TITLE
public static final int FIELDDIPLSAY_TITLE_MOD
public Property(java.lang.String name, java.lang.String propertyclassname)
name
- the name of the instance of the property (e.g.
Folder Structure, the specific instance of
"linkedtoparent" property)propertyclassname
- name of the class of the property (e.g.
linkedtoparent). In case propertyclassname is
provided, the propertyname is
'propertclassname'+"for"+'name' (e.g.
'linkedtoparentforfolderstructure' )public Property(java.lang.String name)
name
- the name of the instance of the property on the object (if the
name depends from the instance, then the common classname should
be specifiedpublic boolean isDatainputatbottom()
public void setDatainputatbottom(boolean datainputatbottom)
datainputatbottom
- true if data input is at bottomprotected void setExtraAttributes(java.lang.String extraattributes)
extraattributes
- extra attributes for property creationprotected void addExternalObjectProperty(DataObjectDefinition externalobject, Property<?> externalobjectproperty)
externalobject
- other objectexternalobjectproperty
- property of the other object that this property
is related topublic int getExternalObjectPropertySize()
public DataObjectDefinition getExternalObject(int index)
index
- an integer between 0 (included) and
getExternalObjectPropertySize() (excluded)public Property<?> getExternalObjectProperty(int index)
index
- an integer between 0 (included) and
getExternalObjectPropertySize() (excluded)public int getBusinessRuleNumber()
public PropertyBusinessRule<E> getBusinessRule(int index)
index
- a number between 0 (included) and getBusinessRuleNumber
(excluded)public PropertyBusinessRule<E> getBusinessRuleByName(java.lang.String name)
name
- name of the business rulepublic abstract java.lang.String[] getPropertyInitMethod()
public abstract java.lang.String[] getPropertyExtractMethod()
public abstract java.lang.String[] getPropertyDeepCopyStatement()
public int getContextDataForCreationSize()
public ArgumentContent getContextDataForCreation(int index)
index
- an integer between 0 (included) and getDataInputSize (excluded)public int getDataInputSize()
public ArgumentContent getDataInputForCreation(int index)
index
- an integer between 0 (included) and getDataInputSize (excluded)protected void addContextForDataCreation(ArgumentContent contextdata)
contextdata
- optional
- true if the context data is not obliged to be providedpublic boolean isDataInputUsedForUpdate()
public boolean isDataInputHiddenForCreation()
protected void setDataInputForUpdate()
protected void hideDataInputForCreation()
protected void addDataInput(ArgumentContent datainput)
datainput
- the data input.public abstract java.util.ArrayList<DataObjectDefinition> getExternalObjectDependence()
public int getChoiceCategoryNumber()
public java.util.Iterator<java.lang.String> getChoiceCategoryKeyNumber()
public ChoiceCategory getChoiceCategoryByKey(java.lang.String key)
key
- key provided by method getChoiceCategoryKeyNumberpublic java.lang.String getInstancename()
protected void addChoiceCategoryHelper(java.lang.String name, ChoiceCategory category)
name
- name of the choice categorycategory
- choice category.protected void addStringHelper(java.lang.String name, java.lang.String payload)
name
- name of the string helperpayload
- default payload in the string helperprotected void addObjectToAuthorityMapper(java.lang.String name, ObjectToAuthorityMapper mapper)
name
- mapper
- public boolean hasInterface()
public java.lang.String getPropertyclassname()
protected void addDependentProperty(Property<?> property)
property
- the dependent propertyprotected void addDataAccessMethod(DataAccessMethod dam)
dam
- data access methodprotected void addMethodAdditionalProcessing(MethodAdditionalProcessing map)
map
- method additional processingpublic int getDataAccessMethodnumber()
public DataAccessMethod getDataAccessMethod(int index)
index
- a number between 0 (included) and getDataAccessMethodNumber
(excluded)public int getMethodAdditionalProcessingnumber()
public MethodAdditionalProcessing getMethodAdditionalProcessing(int index)
index
- a number between 0 (included) and
getMethodAdditionalProcessingnumber (excluded)public DataAccessMethod getDataAccessMethod(java.lang.String name)
name
- name of the data access methodpublic DataObjectDefinition getParent()
public void addDisplayProfileForProperty(DisplayProfile displayprofile)
displayprofile
- display profile to addpublic int getDisplayProfileForPropertyNumber()
public DisplayProfile getDisplayProfileForProperty(int index)
index
- a number between 0 (included) and
getDisplayProfileForPropertyNumber (excluded)public void addBusinessRule(PropertyBusinessRule<E> businessrule)
businessrule
- public void setDynamicDefinitionHelper()
public boolean hasDynamicDefinitionHelper()
public void controlAfterParentDefinition()
public int getFieldOverridesNumber()
public FieldOverrideForProperty getFieldOverridesat(int index)
index
- a number between 0 (included) and getFieldOverridesNumber
(excluded)protected void addFieldOverrides(FieldOverrideForProperty override)
override
- a field overrides to addpublic boolean hasStaticQuery()
public void addPropertyGenerics(PropertyGenerics generics)
generics
- the generics to addpublic Property<?>[] getDependentProperties()
public java.lang.String getDataObjectFieldName()
getDataObjectFieldName
in class ObjectElement
public java.lang.String getDataObjectConstructorAttributes()
getDataObjectConstructorAttributes
in class ObjectElement
public boolean isPropertyHelperTransient()
public java.lang.String getJavaClassType()
public int getPropertyGenericsSize()
public java.lang.String getPropertyGenericsString()
public PropertyGenerics getPropertyGenerics(int index)
index
- a number between 0 (included) and getPropertyGenericsSize
(excluded)public void addElement(Element e)
addElement
in class ObjectElement
e
- stored elementpublic void addElement(Element e, java.lang.String display, java.lang.String tooltip, int fielddisplaymode, int fielddisplaypriority, int showcaractersintable)
e
- element to storedisplay
- display labeltooltip
- tooltip for roll-over mousefielddisplaymode
- the type of display as defined in the class
PropertyElementDisplayDefinitionfielddisplaypriority
- priority displayshowcaractersintable
- number of characters of width of the columnpublic void addElementasSearchElement(Element e, java.lang.String display, java.lang.String tooltip, int fielddisplaymode, int fielddisplaypriority, int showcaractersintable, SearchWidgetDefinition searchdef)
e
- element to storedisplay
- display labeltooltip
- tooltip for roll-over mousefielddisplaymode
- the type of display as defined in the class
PropertyElementDisplayDefinitionfielddisplaypriority
- priority displayshowcaractersintable
- number of characters of width of the columnsearchdef
- definition of the search widgetpublic Property.PropertyElementDisplayDefinition getDisplayDefinitionForElement(Element e)
e
- elementpublic abstract void setFinalSettings()
public boolean isLegacy()
protected void setAsLegacy()
public java.lang.String getPropertyHelperName()
public void generatePropertyHelperToFile(SourceGenerator sg, Module module) throws java.io.IOException
sg
- source generatormodule
- parent modulejava.io.IOException
- if any error is encountered writing the source filepublic void writeAdditionalDefinition(SourceGenerator sg) throws java.io.IOException
sg
- source generatorjava.io.IOException
- if any error is encountered writing the source file