|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ujac.util.exi.type.BaseType
public abstract class BaseType
Name: BaseType
Description: A base implementation for expression type handlers.
Nested Class Summary | |
---|---|
class |
BaseType.EqualOperation
The equal compare operation. |
class |
BaseType.InstanceofOperation
The 'instanceof' operation. |
class |
BaseType.NotEqualOperation
The 'not equal' compare operation. |
class |
BaseType.ObjectDefinedOperation
Checks the existance of the given object. |
class |
BaseType.ObjectNotDefinedOperation
Checks the existance of the given object. |
class |
BaseType.ToStringOperation
Determines the textual representation of the given object. |
Field Summary | |
---|---|
protected ExpressionInterpreter |
interpreter
The expression interpreter. |
protected Map |
operations
The operation map. |
Constructor Summary | |
---|---|
BaseType(ExpressionInterpreter interpreter)
Constructs a BaseType instace with specific attributes. |
Method Summary | |
---|---|
void |
addOperation(String name,
ExpressionOperation operation)
Adds an operation. |
Object |
evalTuple(ExpressionTuple expr,
ExpressionContext ctx)
Evaluates the given expression tuple. |
protected String |
execToString(ExpressionTuple expr,
FormatHelper formatHelper)
Executes the toString operation. |
String |
getAlias()
Gets the alias of the expression type. |
String |
getDescription()
Gets a description for the operation. |
ExpressionOperation |
getOperation(Operation operation)
Gets the operation implementation that matches the given operation. |
Set |
getOperationNames()
Gets all registered operation names. |
Map |
getOperations()
Gets all registered operations. |
String |
getTypeName()
Gets the type name of the expression type. |
void |
removeAllOperations()
Removes all operations. |
void |
removeOperation(String name)
Removes an operation. |
Object |
typeCast(Object value)
Casts the given value into the handler-specific type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.ujac.util.exi.ExpressionType |
---|
getType |
Field Detail |
---|
protected ExpressionInterpreter interpreter
protected Map operations
Constructor Detail |
---|
public BaseType(ExpressionInterpreter interpreter)
interpreter
- The expression interpreter.Method Detail |
---|
protected String execToString(ExpressionTuple expr, FormatHelper formatHelper)
expr
- The expression, holding the object to get as string.formatHelper
- The format helper to use.
public ExpressionOperation getOperation(Operation operation)
ExpressionType
getOperation
in interface ExpressionType
operation
- gets the expression operation for the given operation definition.
ExpressionType.getOperation(org.ujac.util.exi.Operation)
public Set getOperationNames()
getOperationNames
in interface ExpressionType
public Map getOperations()
getOperations
in interface ExpressionType
public void addOperation(String name, ExpressionOperation operation)
name
- The name of the operation.operation
- The operation.public void removeOperation(String name)
name
- The name of the operation.public void removeAllOperations()
public Object evalTuple(ExpressionTuple expr, ExpressionContext ctx) throws ExpressionException
evalTuple
in interface ExpressionType
expr
- The expression tuple to evaluate.ctx
- The expression context.
ExpressionException
- If the evaluation failed.public String getTypeName()
getTypeName
in interface ExpressionType
public String getAlias()
getAlias
in interface ExpressionType
public String getDescription()
getDescription
in interface ExpressionType
public Object typeCast(Object value) throws TypeCastException
typeCast
in interface ExpressionType
value
- The value to cast.
TypeCastException
- In case the type cast failed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |