org.foray.fotree.parse
Class PropertyParser

java.lang.Object
  extended by org.foray.fotree.parse.PropertyParser

public final class PropertyParser
extends Object

Class to parse XSL FO property expression. This class is heavily based on the epxression parser in James Clark's XT, an XSLT processor.


Method Summary
 int getCurrentToken()
          Returns the current token.
 String getCurrentTokenValue()
          Returns the current token value.
 int getCurrentUnitLength()
          Returns the current unit length.
static PropertyValue parse(FObj fobj, String expr, PropertyType propertyType)
          Public entrypoint to the Property expression parser.
 void popFunction()
          Pops an item off of the function stack.
 void pushFunction(Function func)
          Pushes a function onto the stack of functions being evaluated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parse

public static PropertyValue parse(FObj fobj,
                                  String expr,
                                  PropertyType propertyType)
                           throws PropertyException
Public entrypoint to the Property expression parser.

Parameters:
expr - The specified value (attribute on the xml element).
fobj - The parent FObj of the expression being parsed.
propertyType - The property type for which the value is being parsed. This is needed for some functions, for example "from-parent".
Returns:
A PropertyValue instance holding the parsed result.
Throws:
PropertyException - If the "expr" cannot be parsed as a Property.

pushFunction

public void pushFunction(Function func)
Pushes a function onto the stack of functions being evaluated.

Parameters:
func - The function to push onto the stack.

popFunction

public void popFunction()
Pops an item off of the function stack.


getCurrentTokenValue

public String getCurrentTokenValue()
Returns the current token value.

Returns:
Returns the currentTokenValue.

getCurrentToken

public int getCurrentToken()
Returns the current token.

Returns:
Returns the currentToken.

getCurrentUnitLength

public int getCurrentUnitLength()
Returns the current unit length.

Returns:
Returns the currentUnitLength.


Copyright © 2017. All rights reserved.