org.apache.fop.fo
Class Property.Maker

java.lang.Object
  |
  +--org.apache.fop.fo.Property.Maker
Direct Known Subclasses:
CharacterProperty.Maker, ColorTypeProperty.Maker, CondLengthProperty.Maker, EnumProperty.Maker, KeepProperty.Maker, LengthProperty.Maker, NumberProperty.Maker, StringProperty.Maker, SVGD.Maker, SVGLengthListProperty.Maker, SVGLengthProperty.Maker, SVGPoints.Maker, SVGStringProperty.Maker, SVGStyle.Maker, SVGTransform.Maker, TextProperty.Maker
Enclosing class:
Property

public static class Property.Maker
extends java.lang.Object


Constructor Summary
protected Property.Maker()
          Construct an instance of a Property.Maker.
protected Property.Maker(java.lang.String propName)
          Construct an instance of a Property.Maker for the given property.
 
Method Summary
 Property checkEnumValues(java.lang.String value)
           
protected  java.lang.String checkValueKeywords(java.lang.String value)
          Return a String to be parsed if the passed value corresponds to a keyword which can be parsed and used to initialize the property.
 Property compute(PropertyList propertyList)
          Return a Property object representing the value of this property, based on other property values for this FO.
 Property convertProperty(Property p, PropertyList propertyList, FObj fo)
          Return a Property object based on the passed Property object.
protected  Property convertPropertyDatatype(Property p, PropertyList propertyList, FObj fo)
           
 PercentBase getPercentBase(FObj fo, PropertyList pl)
          Return an object implementing the PercentBase interface.
protected  java.lang.String getPropName()
          Return the name of the property whose value is being set.
protected  Property.Maker getSubpropMaker(java.lang.String subprop)
          Return a Maker object which is used to set the values on components of compound property types, such as "space".
 Property getSubpropValue(Property p, java.lang.String subprop)
          Return a property value for the given component of a compound property.
 boolean inheritsSpecified()
          Return a boolean indicating whether this property inherits the "specified" value rather than the "computed" value.
protected  boolean isCompoundMaker()
           
 boolean isCorrespondingForced(PropertyList propertyList)
           
 boolean isInherited()
          Default implementation of isInherited.
 Property make(PropertyList propertyList)
          Return a Property object representing the initial value.
 Property make(PropertyList propertyList, java.lang.String value, FObj fo)
          Create a Property object from an attribute specification.
 Property make(Property baseProp, java.lang.String partName, PropertyList propertyList, java.lang.String value, FObj fo)
          Return a property value for a compound property.
protected  Property makeCompound(PropertyList propertyList, FObj parentFO)
          Return a Property object representing the initial value.
protected  Property setSubprop(Property baseProp, java.lang.String partName, Property subProp)
          Set a component in a compound property and return the modified compound property object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Property.Maker

protected Property.Maker(java.lang.String propName)
Construct an instance of a Property.Maker for the given property.
Parameters:
propName - The name of the property to be made.

Property.Maker

protected Property.Maker()
Construct an instance of a Property.Maker. Note: the property name is set to "UNKNOWN".
Method Detail

getPropName

protected java.lang.String getPropName()
Return the name of the property whose value is being set.

isInherited

public boolean isInherited()
Default implementation of isInherited.
Returns:
A boolean indicating whether this property is inherited.

inheritsSpecified

public boolean inheritsSpecified()
Return a boolean indicating whether this property inherits the "specified" value rather than the "computed" value. The default is to inherit the "computed" value.
Returns:
If true, property inherits the value specified.

getPercentBase

public PercentBase getPercentBase(FObj fo,
                                  PropertyList pl)
Return an object implementing the PercentBase interface. This is used to handle properties specified as a percentage of some "base length", such as the content width of their containing box. Overridden by subclasses which allow percent specifications. See the documentation on properties.xsl for details.

getSubpropMaker

protected Property.Maker getSubpropMaker(java.lang.String subprop)
Return a Maker object which is used to set the values on components of compound property types, such as "space". Overridden by property maker subclasses which handle compound properties.
Parameters:
subprop - The name of the component for which a Maker is to returned, for example "optimum", if the FO attribute is space.optimum='10pt'.

getSubpropValue

public Property getSubpropValue(Property p,
                                java.lang.String subprop)
Return a property value for the given component of a compound property.
Parameters:
p - A property value for a compound property type such as SpaceProperty.
subprop - The name of the component whose value is to be returned. NOTE: this is only to ease porting when calls are made to PropertyList.get() using a component name of a compound property, such as get("space.optimum"). The recommended technique is: get("space").getOptimum(). Overridden by property maker subclasses which handle compound properties.

make

public Property make(Property baseProp,
                     java.lang.String partName,
                     PropertyList propertyList,
                     java.lang.String value,
                     FObj fo)
              throws FOPException
Return a property value for a compound property. If the property value is already partially initialized, this method will modify it.
Parameters:
baseProp - The Property object representing the compound property, such as SpaceProperty.
partName - The name of the component whose value is specified.
propertyList - The propertyList being built.
fo - The FO whose properties are being set.
Returns:
A compound property object.

setSubprop

protected Property setSubprop(Property baseProp,
                              java.lang.String partName,
                              Property subProp)
Set a component in a compound property and return the modified compound property object. This default implementation returns the original base property without modifying it. It is overridden by property maker subclasses which handle compound properties.
Parameters:
baseProp - The Property object representing the compound property, such as SpaceProperty.
partName - The name of the component whose value is specified.
subProp - A Property object holding the specified value of the component to be set.
Returns:
The modified compound property object.

make

public Property make(PropertyList propertyList,
                     java.lang.String value,
                     FObj fo)
              throws FOPException
Create a Property object from an attribute specification.
Parameters:
propertyList - The PropertyList object being built for this FO.
value - The attribute value.
fo - The current FO whose properties are being set.
Returns:
The initialized Property object.

isCompoundMaker

protected boolean isCompoundMaker()

checkEnumValues

public Property checkEnumValues(java.lang.String value)

checkValueKeywords

protected java.lang.String checkValueKeywords(java.lang.String value)
Return a String to be parsed if the passed value corresponds to a keyword which can be parsed and used to initialize the property. For example, the border-width family of properties can have the initializers "thin", "medium", or "thick". The foproperties.xml file specifies a length value equivalent for these keywords, such as "0.5pt" for "thin". These values are considered parseable, since the Length object is no longer responsible for parsing unit expresssions.
Parameters:
value - The string value of property attribute.
Returns:
A String containging a parseable equivalent or null if the passed value isn't a keyword initializer for this Property.

convertProperty

public Property convertProperty(Property p,
                                PropertyList propertyList,
                                FObj fo)
                         throws FOPException
Return a Property object based on the passed Property object. This method is called if the Property object built by the parser isn't the right type for this property. It is overridden by subclasses when the property specification in foproperties.xml specifies conversion rules.
Parameters:
p - The Property object return by the expression parser
propertyList - The PropertyList object being built for this FO.
fo - The current FO whose properties are being set.
Returns:
A Property of the correct type or null if the parsed value can't be converted to the correct type.

convertPropertyDatatype

protected Property convertPropertyDatatype(Property p,
                                           PropertyList propertyList,
                                           FObj fo)

make

public Property make(PropertyList propertyList)
              throws FOPException
Return a Property object representing the initial value.
Parameters:
propertyList - The PropertyList object being built for this FO.

makeCompound

protected Property makeCompound(PropertyList propertyList,
                                FObj parentFO)
                         throws FOPException
Return a Property object representing the initial value.
Parameters:
propertyList - The PropertyList object being built for this FO.
parentFO - The parent FO for the FO whose property is being made.
Returns:
a Property subclass object holding a "compound" property object initialized to the default values for each component.

compute

public Property compute(PropertyList propertyList)
                 throws FOPException
Return a Property object representing the value of this property, based on other property values for this FO. A special case is properties which inherit the specified value, rather than the computed value.
Parameters:
propertyList - The PropertyList for the FO.
Returns:
Property A computed Property value or null if no rules are specified (in foproperties.xml) to compute the value.

isCorrespondingForced

public boolean isCorrespondingForced(PropertyList propertyList)


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.