Class ExpressionSAXParser

  • public class ExpressionSAXParser
    extends Object
    Rob Hranac, TOPP
    , Chris Holmes, TOPP
    • Constructor Detail

      • ExpressionSAXParser

        public ExpressionSAXParser()
      • ExpressionSAXParser

        public ExpressionSAXParser​(FilterFactory factory)
      • ExpressionSAXParser

        public ExpressionSAXParser​(SimpleFeatureType schema)
        Constructor with a schema to read the attribute againset.
        schema - The schema for attributes (null is fine, as the code for this is not in place.
    • Method Detail

      • setFilterFactory

        public void setFilterFactory​(FilterFactory factory)
        Setter injection
      • start

        public void start​(String declaredType,
                          Attributes atts)
                   throws IllegalFilterException
        Initializes the factory to create a new expression. Called when the filter handler reaches a new expression.
        declaredType - The string representation of the expression type.
        IllegalFilterException - If there are problems creating expressions.
      • end

        public void end​(String message)
                 throws IllegalFilterException
        Called when the filter handler has reached the end of an expression
        message - the expression to end.
        IllegalFilterException - If there are problems creating exceptions.
      • isReady

        public boolean isReady()
        Checks to see if this expression is ready to be returned.
        true if the expression is ready to be returned, false otherwise.
      • message

        public void message​(String message,
                            boolean convertToNumber)
                     throws IllegalFilterException
        Handles incoming characters.
        message - the incoming chars from the SAX handler.
        IllegalFilterException - If there are problems with filter constrcution.
        TODO: this function is a mess, but it's mostly due to filters being loosely coupled with schemas, so we have to make a lot of guesses., TODO: Revisit stripping leading characters. Needed now to get things working, and may be the best choice in the end, but it should be thought through more.
      • create

        public Expression create()
        Creates and returns the expression.
        The expression currently held by this parser.
        REVISIT: shouldn't this check the readyFlag?
      • convertType

        protected static short convertType​(String expType)
        Converts the string representation of the expression to the DefaultExpression short type.
        expType - Type of filter for check.
        the short representation of the expression.
      • getFunctionName

        public String getFunctionName​(Attributes map)
        stolen from the DOM parser -- for a list of attributes, find the "name" ie. for return "geomLength" NOTE: if someone uses or this will work, if they use a different prefix, it will not.