2.3. Enumerated property values

The interface Constants defines values for each possible enumerated value of a property:

    int ABSOLUTE = 1;
    int ABSOLUTE_COLORMETRIC = 2;
    ...
    int VISIBLE = 105;
    int WRAP = 106;

In FOPropertyMapping a property value object is constructed for each possible enumerated value. See the Property array enums and the method makeEnumProperty. During its construction, each property maker that can have enumerated values gets a member enums, which, for each of its possible enumerated values, gets a reference to the appropriate enumerated property value object. See the method PropertyMaker.addEnum.

Example: The properties hyphenate and precedence both have the possible value true. Their makers have a reference to the same property value object:

 org.apache.fop.fo.FOPropertyMapping.s_generics
  [org.apache.fop.fo.Constants.PR_HYPHENATE].
  enums.get("true").hashCode() = 9236202
 org.apache.fop.fo.FOPropertyMapping.s_generics
  [org.apache.fop.fo.Constants.PR_PRECEDENCE].
  enums.get("true").hashCode() = 9236202
 org.apache.fop.fo.FOPropertyMapping.s_generics
  [org.apache.fop.fo.Constants.PR_HYPHENATE].enums.get("true") = "100"
 org.apache.fop.fo.FOPropertyMapping.s_generics
  [org.apache.fop.fo.Constants.PR_HYPHENATE].enums.get("true") = {
    value: 100
    org.apache.fop.fo.properties.Property.specVal: null
}

Example: leader-pattern="rule".

 this = "org.apache.fop.fo.properties.EnumProperty$Maker@25c828"
 this.enums = "{rule=82, use-content=104, dots=21, space=88}"
 this.enums.get("rule").getClass() = "class org.apache.fop.fo.properties.EnumProperty"
 this.enums.get("rule") = "82"
 this.enums.get("rule") = {
    value: 82
    org.apache.fop.fo.properties.Property.specVal: null
}

The maker's method checkEnumValues returns the appropriate property value object enums.get(value): newProp = "82".

  [1] org.apache.fop.fo.properties.PropertyMaker.checkEnumValues (PropertyMaker.java:480)
  [2] org.apache.fop.fo.properties.EnumProperty$Maker.checkEnumValues (EnumProperty.java:50)
  [3] org.apache.fop.fo.properties.PropertyMaker.make (PropertyMaker.java:383)
  [4] org.apache.fop.fo.PropertyList.convertAttributeToProperty (PropertyList.java:418)
  [5] org.apache.fop.fo.PropertyList.addAttributesToList (PropertyList.java:374)