Package opendap.servers
Class ClauseFactory
- java.lang.Object
-
- opendap.servers.ClauseFactory
-
public class ClauseFactory extends Object
Represents a source of Clause objects for the constraint expression parser. By inheriting from this class and overriding the "newX" methods, you can create a factory that provides your own Clause objects instead of the default ones. This custom factory can be given to the parser via the CEEvaluator interface.- See Also:
CEEvaluator
-
-
Field Summary
Fields Modifier and Type Field Description protected FunctionLibraryfunctionLibrary
-
Constructor Summary
Constructors Constructor Description ClauseFactory()Creates a new clause factory with a blank function library.ClauseFactory(FunctionLibrary functionLibrary)Creates a clause factory which uses the specified function library.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TopLevelClausenewBoolFunctionClause(String functionName, List children)Generates a clause which invokes a function that returns a boolean value.SubClausenewBTFunctionClause(String functionName, List children)Generates a clause which invokes a function that returns a BaseType.SubClausenewDereferenceClause(String url)Generates a clause representing a remote value, referenced by a URL.TopLevelClausenewRelOpClause(int operator, SubClause lhs, List rhs)Generates a clause which which compares subclauses, using one of the relative operators supported by the Operator class.SubClausenewValueClause(opendap.dap.BaseType value, boolean constant)Generates a clause representing a simple value, such as "var1" or "19".
-
-
-
Field Detail
-
functionLibrary
protected FunctionLibrary functionLibrary
-
-
Constructor Detail
-
ClauseFactory
public ClauseFactory()
Creates a new clause factory with a blank function library. This constructor is sufficient for servers with no server side functions.- See Also:
FunctionLibrary
-
ClauseFactory
public ClauseFactory(FunctionLibrary functionLibrary)
Creates a clause factory which uses the specified function library. This constructor allows you to parse CE's using a customized function library.- Parameters:
functionLibrary- The function library that will be used when creating clauses that invoke server-side functions.
-
-
Method Detail
-
newRelOpClause
public TopLevelClause newRelOpClause(int operator, SubClause lhs, List rhs) throws DAP2ServerSideException
Generates a clause which which compares subclauses, using one of the relative operators supported by the Operator class.- Throws:
DAP2ServerSideException
-
newBoolFunctionClause
public TopLevelClause newBoolFunctionClause(String functionName, List children) throws DAP2ServerSideException, opendap.dap.NoSuchFunctionException
Generates a clause which invokes a function that returns a boolean value.- Throws:
DAP2ServerSideExceptionopendap.dap.NoSuchFunctionException- See Also:
BoolFunctionClause
-
newValueClause
public SubClause newValueClause(opendap.dap.BaseType value, boolean constant) throws DAP2ServerSideException
Generates a clause representing a simple value, such as "var1" or "19".- Throws:
DAP2ServerSideException- See Also:
ValueClause
-
newBTFunctionClause
public SubClause newBTFunctionClause(String functionName, List children) throws DAP2ServerSideException, opendap.dap.NoSuchFunctionException
Generates a clause which invokes a function that returns a BaseType.- Throws:
DAP2ServerSideExceptionopendap.dap.NoSuchFunctionException- See Also:
BTFunctionClause
-
newDereferenceClause
public SubClause newDereferenceClause(String url) throws DAP2ServerSideException
Generates a clause representing a remote value, referenced by a URL. Note that dereferencing is not currently supported, and the default implementation of this clause type throws an exception when it is evaluated.- Throws:
DAP2ServerSideException- See Also:
DereferenceClause
-
-