com.wewebu.expression.language
Class OwExprScopeValue

java.lang.Object
  extended by com.wewebu.expression.language.OwExprValue
      extended by com.wewebu.expression.language.OwExprScopeValue
All Implemented Interfaces:
OwExprScope

public class OwExprScopeValue
extends OwExprValue

Scope values represent values obtained during evaluation that need to be queried for properties or functions.
Example:
employee.birthDate.year
The employee.birthDate sub-expression will be evaluated to a OwExprScopeValue

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 Summary
OwExprScopeValue(OwExprScope scope_p)
          Constructor
 
Method Summary
 OwExprValue accept(OwExprBinaryOperator binaryOperator_p, OwExprScopeValue v1_p)
          Stage 2 binary operator visitor acceptance method
 OwExprValue accept(OwExprBinaryOperator binaryOperator_p, OwExprValue v2_p)
          Stage 1 binary operator visitor acceptance method
 OwExprProperty at(int index_p)
          Indexed access delegate.
Delegates to m_scope.
 OwExprFunction function(String functionName_p, OwExprExpressionType[] argunmentTypes_p)
          Scope OwExprScope.function(String, OwExprExpressionType[]) default implementation.
 OwExprScope getScope()
           
protected  Map getValuePropeties()
          Overridable default value properties factory method
 boolean hasProperty(String propertyName_p)
          Scope OwExprScope.hasProperty(String) default implementation.
 int length()
          Indexed access delegate.
Delegates to m_scope.
 OwExprProperty property(String propertyName_p)
          Scope OwExprScope.property(String) default implementation.
 OwExprScope solveScope(String name_p)
           
 Object toJavaObject(Class javaSuperType_p)
          Java class conversion method.
 String toString()
           
 
Methods inherited from class com.wewebu.expression.language.OwExprValue
accept, accept, accept, accept, accept, accept, fromJavaValue, fromJavaValue, getJavaType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OwExprScopeValue

public OwExprScopeValue(OwExprScope scope_p)
Constructor

Parameters:
scope_p - the scope represented by this value
Method Detail

getValuePropeties

protected Map getValuePropeties()
Description copied from class: OwExprValue
Overridable default value properties factory method

Overrides:
getValuePropeties in class OwExprValue
Returns:
a Map of OwExprProperty for this value

accept

public OwExprValue accept(OwExprBinaryOperator binaryOperator_p,
                          OwExprValue v2_p)
                   throws OwExprEvaluationException
Description copied from class: OwExprValue
Stage 1 binary operator visitor acceptance method

Overrides:
accept in class OwExprValue
Parameters:
binaryOperator_p - binary operator visitor
v2_p - right side operator value
Returns:
the operator visit processed OwExprValue
Throws:
OwExprEvaluationException - if the operation fails for any reason (unsupported operand types , incompatible operands, unimplemented operation or operation failure at evaluation time)

accept

public OwExprValue accept(OwExprBinaryOperator binaryOperator_p,
                          OwExprScopeValue v1_p)
                   throws OwExprEvaluationException
Description copied from class: OwExprValue
Stage 2 binary operator visitor acceptance method

Overrides:
accept in class OwExprValue
Parameters:
binaryOperator_p - binary operator visitor
v1_p - lef side operator value
Returns:
the operator visit processed OwExprValue
Throws:
OwExprEvaluationException - if the operation fails for any reason (unsupported operand types , incompatible operands, unimplemented operation or operation failure at evaluation time)

toJavaObject

public Object toJavaObject(Class javaSuperType_p)
                    throws OwExprEvaluationException
Description copied from class: OwExprValue
Java class conversion method.

Specified by:
toJavaObject in class OwExprValue
Parameters:
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.
Returns:
the java class peer of this value's expression language type
Throws:
OwExprEvaluationException

solveScope

public final OwExprScope solveScope(String name_p)
                             throws OwExprEvaluationException
Throws:
OwExprEvaluationException

function

public final OwExprFunction function(String functionName_p,
                                     OwExprExpressionType[] argunmentTypes_p)
                              throws OwExprEvaluationException
Description copied from class: OwExprValue
Scope OwExprScope.function(String, OwExprExpressionType[]) default implementation. By default value-scopes have no functions defined

Specified by:
function in interface OwExprScope
Overrides:
function in class OwExprValue
Parameters:
functionName_p - the requested function name
argunmentTypes_p - array of OwExprExpressionType that defines the argument signature of the requested function
Returns:
the OwExprProperty designated by propertyName_p and found in this value's scope
Throws:
OwExprEvaluationException - if the requested property is not found in this scope or the creation of the corresponding OwExprProperty has failed

property

public final OwExprProperty property(String propertyName_p)
                              throws OwExprEvaluationException
Description copied from class: OwExprValue
Scope OwExprScope.property(String) default implementation. A default value properties mechanism is implemented. Concrete values must create properties via OwExprValue.getValuePropeties().

Specified by:
property in interface OwExprScope
Overrides:
property in class OwExprValue
Parameters:
propertyName_p - the requested property name
Returns:
the OwExprProperty designated by propertyName_p and found in this value's scope
Throws:
OwExprEvaluationException - if the requested property is not found in this scope or the creation of the corresponding OwExprProperty has failed

at

public OwExprProperty at(int index_p)
                  throws OwExprEvaluationException
Indexed access delegate.
Delegates to m_scope.

Specified by:
at in interface OwExprScope
Overrides:
at in class OwExprValue
Parameters:
index_p -
Returns:
the OwExprProperty property found at the requested index
Throws:
OwExprEvaluationException

length

public int length()
           throws OwExprEvaluationException
Indexed access delegate.
Delegates to m_scope.

Specified by:
length in interface OwExprScope
Overrides:
length in class OwExprValue
Returns:
the maximum index range for which indexed access is possible in this scope
Throws:
OwExprEvaluationException

getScope

public final OwExprScope getScope()

hasProperty

public boolean hasProperty(String propertyName_p)
                    throws OwExprEvaluationException
Description copied from class: OwExprValue
Scope OwExprScope.hasProperty(String) default implementation. A default value properties mechanism is implemented. Concrete values must create properties via OwExprValue.getValuePropeties().

Specified by:
hasProperty in interface OwExprScope
Overrides:
hasProperty in class OwExprValue
Parameters:
propertyName_p -
Returns:
true if the property is defined by this value or by the represented scope
Throws:
OwExprEvaluationException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.