com.flexive.shared.content
Class FxPropertyData

java.lang.Object
  extended by com.flexive.shared.content.FxData
      extended by com.flexive.shared.content.FxPropertyData
All Implemented Interfaces:
java.io.Serializable

public class FxPropertyData
extends FxData

FxData extension for properties

Author:
Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.flexive.shared.content.FxData
indices, POSITION_BOTTOM, POSITION_TOP, xp, XPathFull, xpPrefix
 
Constructor Summary
FxPropertyData(java.lang.String xpPrefix, java.lang.String alias, int index, java.lang.String xPath, java.lang.String xPathFull, int[] indices, long assignmentId, long propertyId, FxMultiplicity assignmentMultiplicity, int pos, FxGroupData parent, FxValue value, boolean systemInternal)
           
 
Method Summary
protected  void applyIndices()
          Apply the multiplicity to XPath and children if its a group
 void checkRequired()
          Check if this property is required and present in its minimal multiplicity
(package private)  FxPropertyData copy(FxGroupData parent)
          Create an independent copy of this group or property FxData
 boolean equals(java.lang.Object obj)
          
 int getCreateableElements()
          Get the number of (same) FxData elements that may be created within the same hierarchy level
 long getPropertyId()
          Get the id of the property used by the assignment
 int getRemoveableElements()
          Get the number of elements that may be removed within the same hierarchy level
 FxValue getValue()
          Get the assigned value
 java.util.List<FxValue> getValues(boolean includeEmpty)
          Return a list of all values of this assignment.
 int hashCode()
           
 boolean isContainsDefaultValue()
          Is the value contained created from a default value?
 boolean isEmpty()
          Is this data empty?
 boolean isGroup()
          Is this FxData a property or group?
 boolean isProperty()
          Is this FxData a property or group?
 boolean isRemoveable()
          Is this data removeable?
 void setContainsDefaultValue(boolean containsDefaultValue)
          Set if the value is created from a default value - internal method!
 void setValue(FxValue value)
          Set a new value for this property data
 
Methods inherited from class com.flexive.shared.content.FxData
compact, createNew, getAlias, getAssignment, getAssignmentId, getAssignmentMultiplicity, getElements, getIndex, getIndices, getOccurances, getParent, getPos, getXPath, getXPathElement, getXPathFull, getXPathPrefix, isSystemInternal, mayCreateMore, setPos, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FxPropertyData

public FxPropertyData(java.lang.String xpPrefix,
                      java.lang.String alias,
                      int index,
                      java.lang.String xPath,
                      java.lang.String xPathFull,
                      int[] indices,
                      long assignmentId,
                      long propertyId,
                      FxMultiplicity assignmentMultiplicity,
                      int pos,
                      FxGroupData parent,
                      FxValue value,
                      boolean systemInternal)
               throws FxInvalidParameterException
Throws:
FxInvalidParameterException
Method Detail

getValue

public FxValue getValue()
Get the assigned value

Returns:
value

isProperty

public boolean isProperty()
Is this FxData a property or group?

Specified by:
isProperty in class FxData
Returns:
if this FxData is a property or group

isGroup

public boolean isGroup()
Is this FxData a property or group?

Specified by:
isGroup in class FxData
Returns:
if this FxData is a property or group

getPropertyId

public long getPropertyId()
Get the id of the property used by the assignment

Returns:
id of the property used by the assignment

setValue

public void setValue(FxValue value)
              throws FxInvalidParameterException,
                     FxNoAccessException
Set a new value for this property data

Parameters:
value - the value to set
Throws:
FxInvalidParameterException - if the passed value is of an invalid datatype or otherwise invalid
FxNoAccessException - if the current value is readonly or not accessible

isEmpty

public boolean isEmpty()
Is this data empty?

Specified by:
isEmpty in class FxData
Returns:
empty

isContainsDefaultValue

public boolean isContainsDefaultValue()
Is the value contained created from a default value?

Returns:
value contained created from a default value

setContainsDefaultValue

public void setContainsDefaultValue(boolean containsDefaultValue)
Set if the value is created from a default value - internal method!

Parameters:
containsDefaultValue - if the value is created from a default value

applyIndices

protected void applyIndices()
Apply the multiplicity to XPath and children if its a group

Specified by:
applyIndices in class FxData

checkRequired

public void checkRequired()
                   throws FxInvalidParameterException
Check if this property is required and present in its minimal multiplicity

Throws:
FxInvalidParameterException - if required properties are empty

getCreateableElements

public int getCreateableElements()
Get the number of (same) FxData elements that may be created within the same hierarchy level

Overrides:
getCreateableElements in class FxData
Returns:
number of (same) FxData elements that may be created within the same hierarchy level

getRemoveableElements

public int getRemoveableElements()
Get the number of elements that may be removed within the same hierarchy level

Overrides:
getRemoveableElements in class FxData
Returns:
number of elements that may be removed within the same hierarchy level

isRemoveable

public boolean isRemoveable()
Is this data removeable?

Overrides:
isRemoveable in class FxData
Returns:
if this data is removeable

getValues

public java.util.List<FxValue> getValues(boolean includeEmpty)
Return a list of all values of this assignment.

Parameters:
includeEmpty - true to include empty (i.e. newly initialized) values
Returns:
a list of all values of this assignment.

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class FxData

hashCode

public int hashCode()
Overrides:
hashCode in class FxData

copy

FxPropertyData copy(FxGroupData parent)
Create an independent copy of this group or property FxData

Specified by:
copy in class FxData
Parameters:
parent - parent group
Returns:
independent copy