org.wso2.balana.cond
Class ExpressionHandler

java.lang.Object
  extended by org.wso2.balana.cond.ExpressionHandler

public class ExpressionHandler
extends Object

This is a package-private utility class that handles parsing all the possible expression types. It was added becuase in 2.0 multiple classes needed this. Note that this could also be added to Expression and that interface could be made an abstract class, but that would require substantial change.

Since:
2.0
Author:
Seth Proctor

Constructor Summary
ExpressionHandler()
           
 
Method Summary
static Function getFunction(Node root, PolicyMetaData metaData, FunctionFactory factory)
          Helper method that tries to get a function instance
static Expression parseExpression(Node root, PolicyMetaData metaData, VariableManager manager)
          Parses an expression, recursively handling any sub-elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionHandler

public ExpressionHandler()
Method Detail

parseExpression

public static Expression parseExpression(Node root,
                                         PolicyMetaData metaData,
                                         VariableManager manager)
                                  throws ParsingException
Parses an expression, recursively handling any sub-elements. This is provided as a utility class, but in practice is used only by Apply, Condition, and VariableDefinition.

Parameters:
root - the DOM root of an ExpressionType XML type
metaData - the meta-data associated with the containing policy
manager - VariableManager used to connect references and definitions while parsing
Returns:
an Expression or null if the root node cannot be parsed as a valid Expression
Throws:
ParsingException

getFunction

public static Function getFunction(Node root,
                                   PolicyMetaData metaData,
                                   FunctionFactory factory)
                            throws ParsingException
Helper method that tries to get a function instance

Throws:
ParsingException


Copyright © 2015 WSO2. All rights reserved.