com.wewebu.expression.language
Class OwExprReflectiveProperty

java.lang.Object
  extended by com.wewebu.expression.language.OwExprReflectiveProperty
All Implemented Interfaces:
OwExprProperty, OwExprScope

public class OwExprReflectiveProperty
extends Object
implements OwExprProperty

Reflective properties are properties that rely on POJOs getters to return values.

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
OwExprReflectiveProperty(String name_p, Object javaObject_p, Method propertyMethod_p)
          Constructor
 
Method Summary
 OwExprProperty at(int index_p)
          Indexed scope access method
 OwExprFunction function(String functionName_p, OwExprExpressionType[] argunmentTypes_p)
          Function access method.
 boolean hasProperty(String propertyName_p)
          Property access helper method.
 Class<?> javaType()
           
 int length()
          Indexed scope access helper method
 OwExprProperty property(String propertyName_p)
          Property access method.
 OwExprScope solveScope(String name_p)
           
 OwExprType type()
          Performs type conversion using OwExprType.fromJavaType(Object)
 OwExprValue value()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OwExprReflectiveProperty

public OwExprReflectiveProperty(String name_p,
                                Object javaObject_p,
                                Method propertyMethod_p)
Constructor

Parameters:
name_p - the name of the property
javaObject_p - the underlying POJO
propertyMethod_p - the getter for this property
Method Detail

type

public OwExprType type()
                throws OwExprEvaluationException
Performs type conversion using OwExprType.fromJavaType(Object)

Specified by:
type in interface OwExprProperty
Returns:
the type of this property
Throws:
OwExprEvaluationException

value

public final OwExprValue value()
                        throws OwExprEvaluationException
Specified by:
value in interface OwExprProperty
Returns:
the value of this property
Throws:
OwExprEvaluationException

function

public final OwExprFunction function(String functionName_p,
                                     OwExprExpressionType[] argunmentTypes_p)
                              throws OwExprEvaluationException
Description copied from interface: OwExprScope
Function access method.

Specified by:
function in interface OwExprScope
Parameters:
functionName_p - the name of the requested function
argunmentTypes_p - array of OwExprExpressionType that defines the argument signature of the requested function
Returns:
an OwExprFunction with the requested name and argument signature residing in this scope
Throws:
OwExprEvaluationException - if the requested function is not found in this scope or the creation of the corresponding OwExprFunction has failed

property

public OwExprProperty property(String propertyName_p)
                        throws OwExprEvaluationException
Description copied from interface: OwExprScope
Property access method.

Specified by:
property in interface OwExprScope
Parameters:
propertyName_p - the name of the requested property
Returns:
an OwExprProperty with the requested name residing in this scope
Throws:
OwExprEvaluationException - if the requested property is not found in this scope or the creation of the corresponding OwExprProperty has failed

solveScope

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

at

public OwExprProperty at(int index_p)
                  throws OwExprEvaluationException
Description copied from interface: OwExprScope
Indexed scope access method

Specified by:
at in interface OwExprScope
Parameters:
index_p - int index of the requested property
Returns:
the OwExprProperty property found at the requested index
Throws:
OwExprEvaluationException - if the requested indexed access has failed (index out of bounds, the creation of OwExprProperty has failed)

length

public int length()
           throws OwExprEvaluationException
Description copied from interface: OwExprScope
Indexed scope access helper method

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

hasProperty

public boolean hasProperty(String propertyName_p)
                    throws OwExprEvaluationException
Description copied from interface: OwExprScope
Property access helper method. Checks if a property is valid in this scope.

Specified by:
hasProperty in interface OwExprScope
Parameters:
propertyName_p - the name of the requested property
Returns:
true if this scope can perform property access for the requested property - an access via OwExprScope.property(String) will NOT fail on missing property grounds, false otherwise
Throws:
OwExprEvaluationException - if the property validity check has failed

javaType

public Class<?> javaType()
                  throws OwExprEvaluationException
Specified by:
javaType in interface OwExprProperty
Returns:
the original java type of this property
Throws:
OwExprEvaluationException


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.