public abstract class ModificationModel extends java.lang.Object implements XMLMarshallable
abstract Java class supports any entity modification description;
It allows you to describe the modification you want to apply on a set of entity.
This class is mainly used for bulk modification. For single modification, some
entity related operation requests exist and work with each entity model for describing modification.
This class aggregates a list of attribute modification models and a list of specific
modification model (particular modifications which cannot be expressed with some attribute
modification model (see SpecificModificationModel and
AttributeModificationModel).
You can set a modification period for entities which are managed into chronology.
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:complexType name="ModificationModel">
<xs:sequence>
<xs:element ref="attributeModification" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="specificModification" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="periodRequired" type="xs:boolean" default="false"/> <!-- tells if the targetted objects are managed in chronology or not. If true, a period must be specified into the modification. -->
<xs:attribute name="startPeriod" type="xs:dateTime"/> <!-- used only if period required is true -->
<xs:attribute name="endPeriod" type="xs:dateTime"/> <!-- used only if period required is true -->
</xs:complexType><xs:element name="ModificationModel" type="ModificationModel" abstract="true"/>
| Constructor and Description |
|---|
ModificationModel(java.lang.String modificationName)
Builds an empty modification model.
|
ModificationModel(java.lang.String modificationName,
boolean periodRequired)
Builds a modification model.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttributeModification(AttributeModificationModel sel)
Adds a modification which port on a attribute field.
|
void |
addCharacterData(java.lang.String cData)
Adds character data to the content element.
|
void |
addChild(java.lang.String tagName,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
void |
addSpecificModification(SpecificModificationModel spec)
Adds a specific constraint for the modification operation.
|
void |
checkAttributeUnicity()
This method throws an exception if it exists a doublon among attributes description model.
|
abstract void |
checkModifications()
This method throws an exception if the required modifications
are not well formed.
|
java.util.Vector<AttributeModificationModel> |
getAttributeModificationList()
Gets the list of constraints which port on attribute fields.
|
java.util.Vector<AttributeModificationModel> |
getAttributeModificationListFromGroup(java.lang.String group)
Returns a list of attribute modification models which belong
to a specified group.
|
java.util.Date |
getEndPeriod()
Gets end period.
|
abstract java.util.Vector<AttributeDescriptionModel> |
getMainModifiableAttributeCatalog()
Returns the list of pre-formed modification model of all
modifiable main attributes.
|
abstract AttributeDescriptionModel |
getMainModifiableAttributeFromCatalog(java.lang.String attributeName)
Gets a pre-formed attribute modification model for a specified main attribute.
|
java.lang.String |
getModificationName()
Returns the XML element name of the current
modification model.
|
abstract java.util.Vector<SpecificModificationModel> |
getSpecificModificationCatalog()
This method allows the user to retrieve the catalog of
available specific modifications.
|
abstract SpecificModificationModel |
getSpecificModificationFromCatalog(java.lang.String specCode)
This method allows the user to retrieve from the catalog of
available specific modifications a specified one.
|
java.util.Vector<SpecificModificationModel> |
getSpecificModificationList()
Gets the list of specific constraints.
|
java.util.Date |
getStartPeriod()
Gets start period.
|
boolean |
isPeriodRequired()
Returns
true if the modified object family is managed with chronology. |
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
void |
setAttributeModificationList(java.util.Vector<AttributeModificationModel> sels)
Sets the list of constraints which port on attribute fields.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
void |
setEndPeriod(java.util.Date to)
Sets end period.
|
void |
setPeriodRequired(boolean state) |
void |
setSpecificModificationList(java.util.Vector<SpecificModificationModel> specifics)
Sets the list of specific constraints.
|
void |
setStartPeriod(java.util.Date from)
Sets start period.
|
public ModificationModel(java.lang.String modificationName)
public ModificationModel(java.lang.String modificationName,
boolean periodRequired)
public java.lang.String getModificationName()
public java.util.Vector<AttributeModificationModel> getAttributeModificationList()
AttributeModificationModelpublic void setAttributeModificationList(java.util.Vector<AttributeModificationModel> sels)
sels - A list of AttributeModificationModelpublic java.util.Vector<AttributeModificationModel> getAttributeModificationListFromGroup(java.lang.String group)
It exists 4 groups for qualifying an attribute:
MAIN_GROUP: The attribute
is a main attribute which is located into the main item table ADDITIONAL_GROUP: The attribute
is an additional attribute which is located into the additional item table PARAMETER_GROUP: The attribute
is a parameter attribute which is located into a related parameter table COUNTER_GROUP: The attribute
is view as a counter which is located into a related table group - The group name. The available values are:
public void addAttributeModification(AttributeModificationModel sel)
sel - The attribute modification to addpublic java.util.Vector<SpecificModificationModel> getSpecificModificationList()
SpecificModificationModelpublic void setSpecificModificationList(java.util.Vector<SpecificModificationModel> specifics)
specifics - A list of SpecificModificationModelpublic void addSpecificModification(SpecificModificationModel spec)
spec - The specific modification to addpublic java.util.Date getStartPeriod()
null if the modification model is a no "periodRequired" model.
If the modifier works on chronologized entities, null means since ever.public void setStartPeriod(java.util.Date from)
from - The start period date to set uppublic java.util.Date getEndPeriod()
public void setEndPeriod(java.util.Date to)
to - The end period date to set uppublic boolean isPeriodRequired()
true if the modified object family is managed with chronology.public void setPeriodRequired(boolean state)
public abstract SpecificModificationModel getSpecificModificationFromCatalog(java.lang.String specCode)
specCode - The code of the requested specific modificationpublic abstract java.util.Vector<SpecificModificationModel> getSpecificModificationCatalog()
SpecificModificationModelpublic abstract AttributeDescriptionModel getMainModifiableAttributeFromCatalog(java.lang.String attributeName)
public abstract java.util.Vector<AttributeDescriptionModel> getMainModifiableAttributeCatalog()
AttributeDescriptionModelpublic abstract void checkModifications()
throws InvalidBulkModificationException
InvalidBulkModificationException - with MALFORMED_MODEL as reasonpublic void checkAttributeUnicity()
throws InvalidBulkModificationException
InvalidBulkModificationException - with MALFORMED_MODEL as reasonpublic void setAttributes(XMLAttributes atts)
XMLMarshallablesetAttributes in interface XMLMarshallableatts - The XML attributes of the current elementpublic void addChild(java.lang.String tagName,
XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.addChild in interface XMLMarshallabletagName - The name of tag for the childchild - The child to be addedpublic void addCharacterData(java.lang.String cData)
XMLMarshallableaddCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void marshal(XMLOutputter output)
XMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object into