public abstract class OwExprValue extends Object implements OwExprScope
A value is an expression evaluation result.
All values are scopes.
Values are ''visitable'' by binary operator objects (see Visitor pattern) in a 2
stage visitor pattern implementation (first left side operand is visited than
right side operand is visited thus selecting a typed operation evaluation in the operator class)
Values are ''visitable'' by binary operator objects (see Visitor pattern) in a 1 stage
visitor implementation.
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
Constructor and Description |
---|
OwExprValue(Class javaType_p) |
Modifier and Type | Method and Description |
---|---|
OwExprValue |
accept(OwExprBinaryOperator binaryOperator_p,
OwExprBooleanValue v1_p)
Stage 2 binary operator visitor acceptance method
|
OwExprValue |
accept(OwExprBinaryOperator binaryOperator_p,
OwExprDateValue v1_p)
Stage 2 binary operator visitor acceptance method
|
OwExprValue |
accept(OwExprBinaryOperator binaryOperator_p,
OwExprNumericValue v1_p)
Stage 2 binary operator visitor acceptance method
|
OwExprValue |
accept(OwExprBinaryOperator binaryOperator_p,
OwExprScopeValue v1_p)
Stage 2 binary operator visitor acceptance method
|
OwExprValue |
accept(OwExprBinaryOperator binaryOperator_p,
OwExprStringValue v1_p)
Stage 2 binary operator visitor acceptance method
|
OwExprValue |
accept(OwExprBinaryOperator binaryOperator_p,
OwExprTimeValue v1_p)
Stage 2 binary operator visitor acceptance method
|
OwExprValue |
accept(OwExprBinaryOperator binaryOperator_p,
OwExprValue v2_p)
Stage 1 binary operator visitor acceptance method
|
OwExprValue |
accept(OwExprUnaryOperator unaryOperator_p)
Unary operator visitor acceptance method
|
OwExprProperty |
at(int index_p)
Indexed scope access method
|
static OwExprValue |
fromJavaValue(Object javaValue_p)
Static expression language value factory based on a java object.
|
static OwExprValue |
fromJavaValue(Object javaValue_p,
Class<?> javaType_p)
Static expression language value factory based on a java object.
|
OwExprFunction |
function(String functionName_p,
OwExprExpressionType[] argunmentTypes_p)
Scope
OwExprScope.function(String, OwExprExpressionType[]) default implementation. |
Class<?> |
getJavaType() |
protected Map |
getValuePropeties()
Overridable default value properties factory method
|
boolean |
hasProperty(String propertyName_p)
Scope
OwExprScope.hasProperty(String) default implementation. |
int |
length()
Scope
OwExprScope.length() helper default value implementation (returns 0). |
OwExprProperty |
property(String propertyName_p)
Scope
OwExprScope.property(String) default implementation. |
abstract Object |
toJavaObject(Class javaSuperType_p)
Java class conversion method.
|
public OwExprValue(Class javaType_p)
javaType_p
- original java typepublic static final OwExprValue fromJavaValue(Object javaValue_p) throws OwExprEvaluationException
Expression Type | Java Peer Type |
OwExprNumericValue | java.lang.Number |
OwExprStringValue | java.lang.String |
OwExprBooleanValue | java.lang.Boolean |
OwExprTimeValue | OwExprTime |
OwExprDateValue | java.util.Calendar |
OwExprNullValue | Java's null literal type |
OwExprScopeValue
will
be factored.javaValue_p
- an object to be converted into its expression language value peerOwExprEvaluationException
public static final OwExprValue fromJavaValue(Object javaValue_p, Class<?> javaType_p) throws OwExprEvaluationException
Expression Type | Java Peer Type |
OwExprNumericValue | java.lang.Number |
OwExprStringValue | java.lang.String |
OwExprBooleanValue | java.lang.Boolean |
OwExprTimeValue | OwExprTime |
OwExprDateValue | java.util.Calendar |
OwExprNullValue | Java's null literal type |
OwExprScopeValue
will
be factored.javaValue_p
- an object to be converted into its expression language value peerjavaType_p
- original java typeOwExprEvaluationException
public abstract Object toJavaObject(Class javaSuperType_p) throws OwExprEvaluationException
javaSuperType_p
- the requested java super type
The returned type should be a subclass of this type.
This is necessary for values having more than one possible java peers
such as OwExprNumericValue
's Integer and Double support.OwExprEvaluationException
public OwExprValue accept(OwExprBinaryOperator binaryOperator_p, OwExprValue v2_p) throws OwExprEvaluationException
binaryOperator_p
- binary operator visitorv2_p
- right side operator valueOwExprValue
OwExprEvaluationException
- if the operation fails for any reason (unsupported operand types ,
incompatible operands, unimplemented operation or operation failure at evaluation time)public OwExprValue accept(OwExprBinaryOperator binaryOperator_p, OwExprBooleanValue v1_p) throws OwExprEvaluationException
binaryOperator_p
- binary operator visitorv1_p
- lef side operator valueOwExprValue
OwExprEvaluationException
- if the operation fails for any reason (unsupported operand types ,
incompatible operands, unimplemented operation or operation failure at evaluation time)public OwExprValue accept(OwExprBinaryOperator binaryOperator_p, OwExprNumericValue v1_p) throws OwExprEvaluationException
binaryOperator_p
- binary operator visitorv1_p
- lef side operator valueOwExprValue
OwExprEvaluationException
- if the operation fails for any reason (unsupported operand types ,
incompatible operands, unimplemented operation or operation failure at evaluation time)public OwExprValue accept(OwExprBinaryOperator binaryOperator_p, OwExprStringValue v1_p) throws OwExprEvaluationException
binaryOperator_p
- binary operator visitorv1_p
- lef side operator valueOwExprValue
OwExprEvaluationException
- if the operation fails for any reason (unsupported operand types ,
incompatible operands, unimplemented operation or operation failure at evaluation time)public OwExprValue accept(OwExprBinaryOperator binaryOperator_p, OwExprDateValue v1_p) throws OwExprEvaluationException
binaryOperator_p
- binary operator visitorv1_p
- lef side operator valueOwExprValue
OwExprEvaluationException
- if the operation fails for any reason (unsupported operand types ,
incompatible operands, unimplemented operation or operation failure at evaluation time)public OwExprValue accept(OwExprBinaryOperator binaryOperator_p, OwExprTimeValue v1_p) throws OwExprEvaluationException
binaryOperator_p
- binary operator visitorv1_p
- lef side operator valueOwExprValue
OwExprEvaluationException
- if the operation fails for any reason (unsupported operand types ,
incompatible operands, unimplemented operation or operation failure at evaluation time)public OwExprValue accept(OwExprBinaryOperator binaryOperator_p, OwExprScopeValue v1_p) throws OwExprEvaluationException
binaryOperator_p
- binary operator visitorv1_p
- lef side operator valueOwExprValue
OwExprEvaluationException
- if the operation fails for any reason (unsupported operand types ,
incompatible operands, unimplemented operation or operation failure at evaluation time)public OwExprValue accept(OwExprUnaryOperator unaryOperator_p) throws OwExprEvaluationException
unaryOperator_p
- binary operator visitorOwExprValue
OwExprEvaluationException
- if the operation fails for any reason (unsupported operand types ,
incompatible operands, unimplemented operation or operation failure at evaluation time)public OwExprFunction function(String functionName_p, OwExprExpressionType[] argunmentTypes_p) throws OwExprEvaluationException
OwExprScope.function(String, OwExprExpressionType[])
default implementation.
By default value-scopes have no functions definedfunction
in interface OwExprScope
functionName_p
- the requested function nameargunmentTypes_p
- array of OwExprExpressionType
that defines the argument signature
of the requested functionOwExprProperty
designated by propertyName_p and found in this value's scopeOwExprEvaluationException
- if the requested property is not found in this scope or
the creation of the corresponding OwExprProperty
has failedpublic OwExprProperty at(int index_p) throws OwExprEvaluationException
at
in interface OwExprScope
index_p
- int
index of the requested propertyOwExprEvaluationException
- always as no indexed access is supported on value scopespublic int length() throws OwExprEvaluationException
OwExprScope.length()
helper default value implementation (returns 0).length
in interface OwExprScope
OwExprEvaluationException
protected Map getValuePropeties()
Map
of OwExprProperty
for this valuepublic OwExprProperty property(String propertyName_p) throws OwExprEvaluationException
OwExprScope.property(String)
default implementation.
A default value properties mechanism is implemented.
Concrete values must create properties via getValuePropeties()
.property
in interface OwExprScope
propertyName_p
- the requested property nameOwExprProperty
designated by propertyName_p and found in this value's scopeOwExprEvaluationException
- if the requested property is not found in this scope or
the creation of the corresponding OwExprProperty
has failedpublic boolean hasProperty(String propertyName_p) throws OwExprEvaluationException
OwExprScope.hasProperty(String)
default implementation.
A default value properties mechanism is implemented.
Concrete values must create properties via getValuePropeties()
.hasProperty
in interface OwExprScope
propertyName_p
- the requested property nametrue
if this scope can perform property access for the requested property
- an access via property(String)
will NOT fail on missing property grounds,
false
otherwiseOwExprEvaluationException
- if the property validity check has failedpublic final Class<?> getJavaType()
Copyright © 2014 Alfresco Business Solutions. All Rights Reserved.