Class containing the collection of properties for a given FObj.
addAttributesToList
public void addAttributesToList(Attributes attributes)
throws ValidationException
Adds the attributes, passed in by the parser to the PropertyList
attributes
- Collection of attributes passed to us from the parser.
ValidationException
- if there is an attribute that does not
map to a property id (strict validation only)
findBasePropertyName
protected static String findBasePropertyName(String attributeName)
Finds the first or base part (up to any period) of an attribute name.
For example, if input is "space-before.minimum", should return
"space-before".
attributeName
- String to be atomized
- the base portion of the attribute
findSubPropertyName
protected static String findSubPropertyName(String attributeName)
Finds the second or sub part (portion past any period) of an attribute
name. For example, if input is "space-before.minimum", should return
"minimum".
attributeName
- String to be atomized
- the sub portion of the attribute
get
public Property get(int propId)
throws PropertyException
Return the property on the current FlowObject. If it isn't set explicitly,
this will try to compute it based on other properties, or if it is
inheritable, to return the inherited value. If all else fails, it returns
the default value.
propId
- The Constants ID of the property whose value is desired.
- the Property corresponding to that name
get
public Property get(int propId,
boolean bTryInherit,
boolean bTryDefault)
throws PropertyException
Return the property on the current FlowObject. Depending on the passed flags,
this will try to compute it based on other properties, or if it is
inheritable, to return the inherited value. If all else fails, it returns
the default value.
propId
- the property's idbTryInherit
- true for inherited properties, or when the inherited
value is neededbTryDefault
- true when the default value may be used as a last resort
getExplicit
public abstract Property getExplicit(int propId)
Return the value explicitly specified on this FO.
propId
- The ID of the property whose value is desired.
- The value if the property is explicitly set, otherwise null.
getExplicitOrShorthand
public Property getExplicitOrShorthand(int propId)
throws PropertyException
Return the value explicitly specified on this FO.
propId
- The id of the property whose value is desired.
- The value if the property is explicitly set or set by
a shorthand property, otherwise null.
getFObj
public FObj getFObj()
- the FObj object to which this propertyList is attached
getFromParent
public Property getFromParent(int propId)
throws PropertyException
Return the value of this property on the parent of this FO.
Implements the from-parent function.
propId
- The Constants ID of the property whose value is desired.
- The computed value on the parent or the initial value if this
FO is the root or is in a different namespace from its parent.
getInherited
public Property getInherited(int propId)
throws PropertyException
Return the value of this property inherited by this FO.
Implements the inherited-property-value function.
The property must be inheritable!
propId
- The ID of the property whose value is desired.
- The inherited value, otherwise null.
getNearestSpecified
public Property getNearestSpecified(int propId)
throws PropertyException
Return the "nearest" specified value for the given property.
Implements the from-nearest-specified-value function.
propId
- The ID of the property whose value is desired.
- The computed value if the property is explicitly set on some
ancestor of the current FO, else the initial value.
getParentFObj
public FObj getParentFObj()
- the FObj object attached to the parentPropertyList
getParentPropertyList
public PropertyList getParentPropertyList()
- the FObj object attached to the parentPropetyList
getWritingMode
public int getWritingMode()
Return the "writing-mode" property value.
- the "writing-mode" property value.
getWritingMode
public int getWritingMode(int lrtb,
int rltb,
int tbrl)
Uses the stored writingMode.
lrtb
- the property ID to return under lrtb writingmode.rltb
- the property ID to return under rltb writingmode.tbrl
- the property ID to return under tbrl writingmode.
- one of the property IDs, depending on the writing mode.
handleInvalidProperty
protected void handleInvalidProperty(String message,
String propName)
throws ValidationException
message
- ...propName
- ...
isValidPropertyName
protected boolean isValidPropertyName(String propertyName)
throws ValidationException
Validates a property name.
propertyName
- the property name to check
- true if the base property name and the subproperty name (if any)
can be correctly mapped to an id
putExplicit
public abstract void putExplicit(int propId,
Property value)
Set an value defined explicitly on this FO.
propId
- The ID of the property to set.value
- The value of the property.
setWritingMode
public void setWritingMode()
throws PropertyException
Set writing mode for this FO.
Use that from the nearest ancestor, including self, which generates
reference areas, or from root FO if no ancestor found.