org.foray.fotree.fo
Class AbstractFoProperty

java.lang.Object
  extended by org.foray.fotree.Property
      extended by org.foray.fotree.fo.AbstractFoProperty
Direct Known Subclasses:
AbstractAbsoluteDimension, AbstractAbsoluteOffset, AbstractAllowedAxisScale, AbstractAudioDial, AbstractBackgroundPosition, AbstractBoolean, AbstractBorder, AbstractBorderColor, AbstractBorderPrecedence, AbstractBorderStyle, AbstractBorderWidth, AbstractCharacter, AbstractContentDimension, AbstractCue, AbstractGlyphOrientation, AbstractIndent, AbstractKeep, AbstractMargin, AbstractMergeIndex, AbstractName, AbstractPadding, AbstractPageDimension, AbstractPause, AbstractRelativeDimension, AbstractRelativeSpace, AbstractString, PdAbsolutePosition, PdActiveState, PdAlignmentAdjust, PdAlignmentBaseline, PdAzimuth, PdBackground, PdBackgroundAttachment, PdBackgroundColor, PdBackgroundImage, PdBackgroundPosition, PdBackgroundRepeat, PdBaselineShift, PdBlankOrNotBlank, PdBorderCollapse, PdBorderColor, PdBorderSeparation, PdBorderSpacing, PdBorderStyle, PdBorderWidth, PdBreakAfter, PdBreakBefore, PdCaptionSide, PdChangeBarColor, PdChangeBarOffset, PdChangeBarPlacement, PdChangeBarStyle, PdChangeBarWidth, PdClear, PdClip, PdColor, PdColumnCount, PdColumnGap, PdColumnNumber, PdColumnWidth, PdContentType, PdCountry, PdDestinationPlacementOffset, PdDirection, PdDisplayAlign, PdDominantBaseline, PdElevation, PdEmptyCells, PdExtent, PdExternalDestination, PdFloat, PdFont, PdFontFamily, PdFontSelectionStrategy, PdFontSize, PdFontSizeAdjust, PdFontStretch, PdFontStyle, PdFontVariant, PdFontWeight, PdForcePageCount, PdGroupingSize, PdHyphenationKeep, PdHyphenationLadderCount, PdHyphenationPushCharacterCount, PdHyphenationRemainCharacterCount, PdId, PdInitialPageNumber, PdInternalDestination, PdIntrinsicScaleValue, PdIntrusionDisplace, PdLanguage, PdLastLineEndIndent, PdLeaderAlignment, PdLeaderLength, PdLeaderPattern, PdLeaderPatternWidth, PdLetterSpacing, PdLetterValue, PdLinefeedTreatment, PdLineHeight, PdLineHeightShiftAdjustment, PdLineStackingStrategy, PdMargin, PdMaximumRepeats, PdMediaUsage, PdNumberColumnsRepeated, PdNumberColumnsSpanned, PdNumberRowsSpanned, PdOddOrEven, PdOrphans, PdOverflow, PdPadding, PdPageBreakAfter, PdPageBreakBefore, PdPageBreakInside, PdPageCitationStrategy, PdPageNumberTreatment, PdPagePosition, PdPitch, PdPlayDuring, PdPosition, PdProvisionalDistanceBetweenStarts, PdProvisionalLabelSeparation, PdReferenceOrientation, PdRefId, PdRegionName, PdRelativeAlign, PdRelativePosition, PdRenderingIntent, PdRetrieveBoundary, PdRetrieveBoundaryWithinTable, PdRetrievePosition, PdRetrievePositionWithinTable, PdRole, PdRuleStyle, PdRuleThickness, PdScaleOption, PdScaling, PdScalingMethod, PdScript, PdShowDestination, PdSize, PdSourceDocument, PdSpan, PdSpeak, PdSpeakHeader, PdSpeakNumeral, PdSpeakPunctuation, PdSpeechRate, PdSrc, PdStartingState, PdSuppressAtLineBreak, PdSwitchTo, PdTableLayout, PdTargetPresentationContext, PdTargetProcessingContext, PdTargetStylesheet, PdTextAlign, PdTextAlignLast, PdTextAltitude, PdTextDecoration, PdTextDepth, PdTextIndent, PdTextShadow, PdTextTransform, PdTreatAsWordSpace, PdUnicodeBidi, PdVerticalAlign, PdVisibility, PdVoiceFamily, PdVolume, PdWhiteSpace, PdWhiteSpaceTreatment, PdWidows, PdWordSpacing, PdWrapOption, PdWritingMode, PdZIndex

public abstract class AbstractFoProperty
extends Property

Superclass for properties in the "fo:" namespace.


Field Summary
protected static FoValue[] VALID_KEYWORDS_INHERIT_ONLY
          Array of valid keywords for properties that only allow "inherit".
 
Fields inherited from class org.foray.fotree.Property
PRECEDENCE_FORCE
 
Constructor Summary
AbstractFoProperty()
           
 
Method Summary
protected  boolean canEvalBorderStyle(PropertyValue value)
          Indicates whether a given property value can evaluate to a BorderStyle enumeration.
protected  boolean canEvalUri(PropertyValue value)
          Indicates whether a given property value can evaluate to a URI.
protected  FoPropertyKeyword checkKeywords(FoValue[] validKeywords, String possibleKeyword)
          Checks the keywords for this property, returning an appropriate property value if a keyword is detected.
protected  FoValue convertValueToFoValue(PropertyValue value)
          Converts a keyword property value to its equivalent FoValue.
protected  org.axsl.common.value.BorderStyle evalBorderStyle(PropertyValue value)
          Converts a given property value into a BorderStyle enumeration.
protected  String evalUri(PropertyValue value)
          Converts a given property value into URI.
abstract  FoProperty getPropertyType()
          Returns the type of this property.
protected abstract  FoValue[] getValidKeywords()
          Returns the valid keywords for this property.
protected  boolean isKeywordInherit(PropertyValue value)
          Indicates whether a given property value is the keyword "inherit".
protected  PropertyValue standardParse(FObj fobj, String rawPropertyValue)
          Handles the standard parsing of a property value.
protected  PropertyValue standardParse(FObj fobj, String rawPropertyValue, FoValue[] validKeywords)
          Overloaded version of standardParse(FObj, String) that allows subclasses to provide a different set of valid keywords for the case of compound properties.
 
Methods inherited from class org.foray.fotree.Property
convertNumericToInteger, convertValueToLength, getBasePropertyName, getKeywordIndex, getKeywordInSet, getSubPropertyName, invalidPropertyName, keywordInSet, unexpectedInitialValueArgument, unexpectedRetrieval, unexpectedValue, unexpectedValue, value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALID_KEYWORDS_INHERIT_ONLY

protected static final FoValue[] VALID_KEYWORDS_INHERIT_ONLY
Array of valid keywords for properties that only allow "inherit".

Constructor Detail

AbstractFoProperty

public AbstractFoProperty()
Method Detail

getPropertyType

public abstract FoProperty getPropertyType()
Returns the type of this property.

Specified by:
getPropertyType in class Property
Returns:
The type of this property.

standardParse

protected PropertyValue standardParse(FObj fobj,
                                      String rawPropertyValue)
                               throws PropertyException
Handles the standard parsing of a property value.

Parameters:
fobj - The FObj to which this property belongs.
rawPropertyValue - String containing the raw property value.
Returns:
The PropertyValue instance created by the parser.
Throws:
PropertyException - If the input is inconsistent.

standardParse

protected PropertyValue standardParse(FObj fobj,
                                      String rawPropertyValue,
                                      FoValue[] validKeywords)
                               throws PropertyException
Overloaded version of standardParse(FObj, String) that allows subclasses to provide a different set of valid keywords for the case of compound properties.

Parameters:
fobj - The FObj to which this property belongs.
rawPropertyValue - String containing the raw property value.
validKeywords - The keywords that should be accepted when parsing.
Returns:
The PropertyValue instance created by the parser.
Throws:
PropertyException - If the input is inconsistent.

getValidKeywords

protected abstract FoValue[] getValidKeywords()
Returns the valid keywords for this property.

Returns:
The valid keywords for this property.

checkKeywords

protected FoPropertyKeyword checkKeywords(FoValue[] validKeywords,
                                          String possibleKeyword)
Checks the keywords for this property, returning an appropriate property value if a keyword is detected.

Parameters:
validKeywords - The array of valid keywords.
possibleKeyword - The token to be evaluated against the valid keywords.
Returns:
If possibleKeyword is found in the validKeywords, return an appropriate property value instance, otherwise returns null.

isKeywordInherit

protected boolean isKeywordInherit(PropertyValue value)
Indicates whether a given property value is the keyword "inherit".

Parameters:
value - The property value being tested.
Returns:
True iff the property value is the keyword "inherit".

convertValueToFoValue

protected FoValue convertValueToFoValue(PropertyValue value)
Converts a keyword property value to its equivalent FoValue.

Parameters:
value - The property value to be converted.
Returns:
The value of the property, as an FoValue.

canEvalBorderStyle

protected boolean canEvalBorderStyle(PropertyValue value)
Indicates whether a given property value can evaluate to a BorderStyle enumeration.

Parameters:
value - The property value to be tested.
Returns:
True iff the property value can evaluate to a BorderStyle.

evalBorderStyle

protected org.axsl.common.value.BorderStyle evalBorderStyle(PropertyValue value)
Converts a given property value into a BorderStyle enumeration. This should only be run on values for which canEvalBorderStyle(PropertyValue) returns true.

Parameters:
value - The property value to be tested.
Returns:
The property value's underlying BorderStyle value.

canEvalUri

protected boolean canEvalUri(PropertyValue value)
Indicates whether a given property value can evaluate to a URI.

Parameters:
value - The property value to be tested.
Returns:
True iff the property value can evaluate to a URI.

evalUri

protected String evalUri(PropertyValue value)
Converts a given property value into URI. This should only be run on values for which canEvalUri(PropertyValue) returns true.

Parameters:
value - The property value to be tested.
Returns:
The property value's underlying URI value.


Copyright © 2017. All rights reserved.