fop 2.2

org.apache.fop.fo
Class PropertyList

java.lang.Object
  extended by org.apache.fop.fo.PropertyList
Direct Known Subclasses:
Marker.MarkerPropertyList, StaticPropertyList

public abstract class PropertyList
extends java.lang.Object

Class containing the collection of properties for a given FObj.


Field Summary
protected  PropertyList parentPropertyList
          reference to the parent FO's propertyList
 
Constructor Summary
PropertyList(FObj fObjToAttach, PropertyList parentPropertyList)
          Basic constructor.
 
Method Summary
 void addAttributesToList(org.xml.sax.Attributes attributes)
          Adds the attributes, passed in by the parser to the PropertyList.
protected static java.lang.String findBasePropertyName(java.lang.String attributeName)
          Finds the first or base part (up to any period) of an attribute name.
protected static java.lang.String findSubPropertyName(java.lang.String attributeName)
          Finds the second or sub part (portion past any period) of an attribute name.
 Property get(int propId)
          Return the property on the current FlowObject.
 Property get(int propId, boolean bTryInherit, boolean bTryDefault)
          Return the property on the current FlowObject.
 CommonAbsolutePosition getAbsolutePositionProps()
          Constructs a CommonAbsolutePosition object.
 CommonAural getAuralProps()
          Constructs a CommonAural object.
 CommonBorderPaddingBackground getBorderPaddingBackgroundProps()
          Constructs a BorderAndPadding object.
abstract  Property getExplicit(int propId)
          Return the value explicitly specified on this FO.
 Property getExplicitOrShorthand(int propId)
          Return the value explicitly specified on this FO.
 FObj getFObj()
           
 CommonFont getFontProps()
          Constructs a CommonFont object.
 Property getFromParent(int propId)
          Return the value of this property on the parent of this FO.
 CommonHyphenation getHyphenationProps()
          Constructs a CommonHyphenation object.
 Property getInherited(int propId)
          Return the value of this property inherited by this FO.
 CommonMarginBlock getMarginBlockProps()
          Constructs a CommonMarginBlock object.
 CommonMarginInline getMarginInlineProps()
          Constructs a CommonMarginInline object.
 Property getNearestSpecified(int propId)
          Return the "nearest" specified value for the given property.
 FObj getParentFObj()
           
 PropertyList getParentPropertyList()
           
 Property getPropertyForAttribute(org.xml.sax.Attributes attributes, java.lang.String attributeName, java.lang.String attributeValue)
           
 CommonRelativePosition getRelativePositionProps()
          Constructs a RelativePositionProps objects.
 CommonTextDecoration getTextDecorationProps()
          Constructs a CommonTextDecoration object.
 java.util.Map<java.lang.String,Property> getUnknownPropertyValues()
          Gets the current list of unknown property values
protected  void handleInvalidProperty(org.apache.xmlgraphics.util.QName attr)
          Handles an invalid property.
protected  boolean isValidPropertyName(java.lang.String propertyName)
          Validates a property name.
abstract  void putExplicit(int propId, Property value)
          Set an value defined explicitly on this FO.
 int selectFromWritingMode(int lrtb, int rltb, int tbrl, int tblr)
          Select a writing mode dependent property ID based on value of writing mode property.
 void validatePropertyValue(java.lang.String propertyValue, Property output, Property property)
          Adds an unknown property value to the property list so that if necessary, a warning can be displayed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parentPropertyList

protected PropertyList parentPropertyList
reference to the parent FO's propertyList

Constructor Detail

PropertyList

public PropertyList(FObj fObjToAttach,
                    PropertyList parentPropertyList)
Basic constructor.

Parameters:
fObjToAttach - the FO this PropertyList should be attached to
parentPropertyList - the PropertyList belonging to the new objects parent
Method Detail

getFObj

public FObj getFObj()
Returns:
the FObj object to which this propertyList is attached

getParentFObj

public FObj getParentFObj()
Returns:
the FObj object attached to the parentPropertyList

validatePropertyValue

public void validatePropertyValue(java.lang.String propertyValue,
                                  Property output,
                                  Property property)
Adds an unknown property value to the property list so that if necessary, a warning can be displayed.

Parameters:
propertyValue - The unknown property value
output - The output of the property to validate
property - The original property containing the full value

getUnknownPropertyValues

public java.util.Map<java.lang.String,Property> getUnknownPropertyValues()
Gets the current list of unknown property values

Returns:
The set containing the list of unknown property values

getParentPropertyList

public PropertyList getParentPropertyList()
Returns:
the FObj object attached to the parentPropetyList

getExplicitOrShorthand

public Property getExplicitOrShorthand(int propId)
                                throws PropertyException
Return the value explicitly specified on this FO.

Parameters:
propId - The id of the property whose value is desired.
Returns:
The value if the property is explicitly set or set by a shorthand property, otherwise null.
Throws:
PropertyException - ...

getExplicit

public abstract Property getExplicit(int propId)
Return the value explicitly specified on this FO.

Parameters:
propId - The ID of the property whose value is desired.
Returns:
The value if the property is explicitly set, otherwise null.

putExplicit

public abstract void putExplicit(int propId,
                                 Property value)
Set an value defined explicitly on this FO.

Parameters:
propId - The ID of the property to set.
value - The value of the property.

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!

Parameters:
propId - The ID of the property whose value is desired.
Returns:
The inherited value, otherwise null.
Throws:
PropertyException - ...

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.

Parameters:
propId - The Constants ID of the property whose value is desired.
Returns:
the Property corresponding to that name
Throws:
PropertyException - if there is a problem evaluating the property

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.

Parameters:
propId - the property's id
bTryInherit - true for inherited properties, or when the inherited value is needed
bTryDefault - true when the default value may be used as a last resort
Returns:
the property
Throws:
PropertyException - if there is a problem evaluating the property

getNearestSpecified

public Property getNearestSpecified(int propId)
                             throws PropertyException
Return the "nearest" specified value for the given property. Implements the from-nearest-specified-value function.

Parameters:
propId - The ID of the property whose value is desired.
Returns:
The computed value if the property is explicitly set on some ancestor of the current FO, else the initial value.
Throws:
PropertyException - if there an error occurred when getting the property

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.

Parameters:
propId - The Constants ID of the property whose value is desired.
Returns:
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.
Throws:
PropertyException - ...

selectFromWritingMode

public int selectFromWritingMode(int lrtb,
                                 int rltb,
                                 int tbrl,
                                 int tblr)
Select a writing mode dependent property ID based on value of writing mode property.

Parameters:
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.
tblr - the property ID to return under tblr writingmode.
Returns:
one of the property IDs, depending on the writing mode.

addAttributesToList

public void addAttributesToList(org.xml.sax.Attributes attributes)
                         throws ValidationException

Adds the attributes, passed in by the parser to the PropertyList.

Note that certain attributes are given priority in terms of order of processing due to conversion dependencies, where the order is as follows:

  1. writing-mode
  2. column-number
  3. number-columns-spanned
  4. font
  5. font-size
  6. all others in order of appearance

Parameters:
attributes - Collection of attributes passed to us from the parser.
Throws:
ValidationException - if there is an attribute that does not map to a property id (strict validation only)

isValidPropertyName

protected boolean isValidPropertyName(java.lang.String propertyName)
Validates a property name.

Parameters:
propertyName - the property name to check
Returns:
true if the base property name and the subproperty name (if any) can be correctly mapped to an id

getPropertyForAttribute

public Property getPropertyForAttribute(org.xml.sax.Attributes attributes,
                                        java.lang.String attributeName,
                                        java.lang.String attributeValue)
                                 throws FOPException
Throws:
FOPException

handleInvalidProperty

protected void handleInvalidProperty(org.apache.xmlgraphics.util.QName attr)
                              throws ValidationException
Handles an invalid property.

Parameters:
attr - the invalid attribute
Throws:
ValidationException - if an exception needs to be thrown depending on the validation settings

findBasePropertyName

protected static java.lang.String findBasePropertyName(java.lang.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".

Parameters:
attributeName - String to be atomized
Returns:
the base portion of the attribute

findSubPropertyName

protected static java.lang.String findSubPropertyName(java.lang.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".

Parameters:
attributeName - String to be atomized
Returns:
the sub portion of the attribute

getBorderPaddingBackgroundProps

public CommonBorderPaddingBackground getBorderPaddingBackgroundProps()
                                                              throws PropertyException
Constructs a BorderAndPadding object.

Returns:
a BorderAndPadding object
Throws:
PropertyException - if there's a problem while processing the properties

getHyphenationProps

public CommonHyphenation getHyphenationProps()
                                      throws PropertyException
Constructs a CommonHyphenation object.

Returns:
the CommonHyphenation object
Throws:
PropertyException - if there's a problem while processing the properties

getMarginBlockProps

public CommonMarginBlock getMarginBlockProps()
                                      throws PropertyException
Constructs a CommonMarginBlock object.

Returns:
the CommonMarginBlock object
Throws:
PropertyException - if there's a problem while processing the properties

getMarginInlineProps

public CommonMarginInline getMarginInlineProps()
                                        throws PropertyException
Constructs a CommonMarginInline object.

Returns:
the CommonMarginInline object
Throws:
PropertyException - if there's a problem while processing the properties

getAuralProps

public CommonAural getAuralProps()
                          throws PropertyException
Constructs a CommonAural object.

Returns:
the CommonAural object
Throws:
PropertyException - if there's a problem while processing the properties

getRelativePositionProps

public CommonRelativePosition getRelativePositionProps()
                                                throws PropertyException
Constructs a RelativePositionProps objects.

Returns:
a RelativePositionProps object
Throws:
PropertyException - if there's a problem while processing the properties

getAbsolutePositionProps

public CommonAbsolutePosition getAbsolutePositionProps()
                                                throws PropertyException
Constructs a CommonAbsolutePosition object.

Returns:
the CommonAbsolutePosition object
Throws:
PropertyException - if there's a problem while processing the properties

getFontProps

public CommonFont getFontProps()
                        throws PropertyException
Constructs a CommonFont object.

Returns:
A CommonFont object
Throws:
PropertyException - if there's a problem while processing the properties

getTextDecorationProps

public CommonTextDecoration getTextDecorationProps()
                                            throws PropertyException
Constructs a CommonTextDecoration object.

Returns:
a CommonTextDecoration object
Throws:
PropertyException - if there's a problem while processing the properties

fop 2.2

Copyright 1999-2017 The Apache Software Foundation. All Rights Reserved.