GenericShorthandParser (Apache FOP Core 2.11 API)
Date: 2025-04-24

org.apache.fop.fo.properties

## Class GenericShorthandParser

- java.lang.Object
- - org.apache.fop.fo.properties.GenericShorthandParser

- All Implemented Interfaces:
    ShorthandParser
  Direct Known Subclasses:
    BackgroundPositionShorthand.Parser, BorderSpacingShorthandParser, BoxCornerPropShorthandParser, BoxPropShorthandParser, FontShorthandParser, XMLLangShorthandParser

      public class GenericShorthandParser
      extends Object
      implements ShorthandParser

  Generic shorthand parser for ListProperties

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GenericShorthandParser()` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Property` | `convertValueForProperty(int propId, Property property, PropertyMaker maker, PropertyList propertyList)` Converts a property name into a Property
    `protected Property` | `getElement(Property list, int index)`
    `Property` | `getValueForProperty(int propId, Property property, PropertyMaker maker, PropertyList propertyList)`
    `protected void` | `validate(PropertyList propertyList, String propertyString, Property prop, Property property)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### GenericShorthandParser

          public GenericShorthandParser()

      Constructor.

  - ### Method Detail

    - #### getElement

          protected Property getElement(Property list,
                                        int index)

      Parameters:
        `list` - the ListProperty
        `index` - the index into the List of properties
      Returns:
        the property from the List of properties at the index parameter

    - #### getValueForProperty

          public Property getValueForProperty(int propId,
                                              Property property,
                                              PropertyMaker maker,
                                              PropertyList propertyList)
                                       throws PropertyException

      Specified by:
        `getValueForProperty` in interface `ShorthandParser`
      Parameters:
        `propId` - the property ID in the Constants interface
        `property` - from which value is obtained
        `maker` - Maker object for the Property
        `propertyList` - list of properties
      Returns:
        Property object corresponding to propName
      Throws:
        `PropertyException` - in case a property exception occurs

    - #### convertValueForProperty

          protected Property convertValueForProperty(int propId,
                                                     Property property,
                                                     PropertyMaker maker,
                                                     PropertyList propertyList)
                                              throws PropertyException

      Converts a property name into a Property
      Parameters:
        `propId` - the property ID in the Constants interface
        `maker` - the Property.Maker to be used in the conversion
        `property` - ...
        `propertyList` - the PropertyList from which the Property should be extracted
      Returns:
        the Property matching the parameters, or null if not found
      Throws:
        `PropertyException` - (when?)

    - #### validate

          protected void validate(PropertyList propertyList,
                                  String propertyString,
                                  Property prop,
                                  Property property)

Copyright © 2025 Apache Software Foundation. All rights reserved.