org.foray.fotree.fo.prop
Class AbstractKeep

java.lang.Object
  extended by org.foray.fotree.Property
      extended by org.foray.fotree.fo.AbstractFoProperty
          extended by org.foray.fotree.fo.prop.AbstractKeep
Direct Known Subclasses:
PdKeepTogether, PdKeepWithNext, PdKeepWithPrevious

public abstract class AbstractKeep
extends AbstractFoProperty

Abstract superclass for the "keep-together", "keep-with-next", and "keep-with-previous" properties.


Nested Class Summary
static class AbstractKeep.Type
          Enumeration of possible Keep types.
 
Field Summary
 
Fields inherited from class org.foray.fotree.fo.AbstractFoProperty
VALID_KEYWORDS_INHERIT_ONLY
 
Fields inherited from class org.foray.fotree.Property
PRECEDENCE_FORCE
 
Constructor Summary
AbstractKeep(FObj fobj, String propertyFullName, String attributeValue)
          Constructor.
 
Method Summary
 boolean addComponent(FObj fobj, String propertyFullName, String attributeValue)
          Adds a component value to the compound value.
protected  FoValue[] getValidKeywords()
          Returns the valid keywords for this property.
 int getValue(org.axsl.fo.FoContext context, AbstractKeep.Type subProperty, FObj fobj)
          Returns the value of this property.
static int getValueNoInstance(org.axsl.fo.FoContext context, FoProperty propertyType, AbstractKeep.Type subProperty, FObj fobj)
          Returns the default (initial) value for this property.
 PropertyValue value()
          Returns the value for this property.
 
Methods inherited from class org.foray.fotree.fo.AbstractFoProperty
canEvalBorderStyle, canEvalUri, checkKeywords, convertValueToFoValue, evalBorderStyle, evalUri, getPropertyType, isKeywordInherit, standardParse, standardParse
 
Methods inherited from class org.foray.fotree.Property
convertNumericToInteger, convertValueToLength, getBasePropertyName, getKeywordIndex, getKeywordInSet, getSubPropertyName, invalidPropertyName, keywordInSet, unexpectedInitialValueArgument, unexpectedRetrieval, unexpectedValue, unexpectedValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractKeep

public AbstractKeep(FObj fobj,
                    String propertyFullName,
                    String attributeValue)
             throws PropertyException
Constructor.

Parameters:
fobj - The FObj to which this property belongs.
propertyFullName - The full name of the property.
attributeValue - The unparsed property value.
Throws:
PropertyException - For an invalid property value.
Method Detail

getValue

public int getValue(org.axsl.fo.FoContext context,
                    AbstractKeep.Type subProperty,
                    FObj fobj)
Returns the value of this property.

Parameters:
context - An object that knows how to resolve FO context issues.
subProperty - The type of keep.
fobj - The FO for which this value is needed.
Returns:
The value of this property.

getValueNoInstance

public static int getValueNoInstance(org.axsl.fo.FoContext context,
                                     FoProperty propertyType,
                                     AbstractKeep.Type subProperty,
                                     FObj fobj)
Returns the default (initial) value for this property.

Parameters:
context - An object that knows how to resolve FO context issues.
propertyType - The specific property type.
subProperty - The type of keep.
fobj - The FO for which this value is needed.
Returns:
The initial value for this property.

getValidKeywords

protected FoValue[] getValidKeywords()
Description copied from class: AbstractFoProperty
Returns the valid keywords for this property.

Specified by:
getValidKeywords in class AbstractFoProperty
Returns:
The valid keywords for this property.

addComponent

public boolean addComponent(FObj fobj,
                            String propertyFullName,
                            String attributeValue)
                     throws PropertyException
Adds a component value to the compound value.

Parameters:
fobj - The FObj to which this property belongs.
propertyFullName - The full name of the property, including both the base and the sub-property name.
attributeValue - The value of the component.
Returns:
True if the component was successfully added, false if the pre-existing value is not the correct type.
Throws:
PropertyException - If the input is not valid.

value

public PropertyValue value()
Description copied from class: Property
Returns the value for this property.

Specified by:
value in class Property
Returns:
The value for this property.


Copyright © 2017. All rights reserved.