com.wewebu.expression.language
Class OwExprReflectiveScope

java.lang.Object
  extended by com.wewebu.expression.language.OwExprExternalScope
      extended by com.wewebu.expression.language.OwExprReflectiveScope
All Implemented Interfaces:
OwExprScope
Direct Known Subclasses:
OwExprSystem

public class OwExprReflectiveScope
extends OwExprExternalScope

Reflective scopes are external scopes that rely on POJOs to prelevate functions and properties.
Getters of the underlying POJO will be interpreted as properties and methods will be interpreted as functions.

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
OwExprReflectiveScope(String name_p)
          Constructor
OwExprReflectiveScope(String name_p, Object javaObject_p)
          Constructor
 
Method Summary
 OwExprProperty at(int index_p)
          Indexed scope access method form an array POJO.
 boolean hasProperty(String propertyName_p)
          Property access helper method.
 int length()
          Indexed scope access helper method
protected  OwExprFunction prelevateFunction(String functionName_p, OwExprExpressionType[] argumentTypes_p)
          Function search hook for OwExprExternalScope.function(String, OwExprExpressionType[]).
Children of this class should override this method to perform custom
protected  OwExprProperty prelevateProperty(String propertyName_p)
          Property search hook for OwExprExternalScope.property(String).
 String toString()
           
 
Methods inherited from class com.wewebu.expression.language.OwExprExternalScope
addScope, function, getName, property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OwExprReflectiveScope

public OwExprReflectiveScope(String name_p)
Constructor

Parameters:
name_p - the name of this scope

OwExprReflectiveScope

public OwExprReflectiveScope(String name_p,
                             Object javaObject_p)
Constructor

Parameters:
name_p - the name of this scope
javaObject_p - underlying POJO
Method Detail

prelevateProperty

protected final OwExprProperty prelevateProperty(String propertyName_p)
                                          throws OwExprEvaluationException
Description copied from class: OwExprExternalScope
Property search hook for OwExprExternalScope.property(String).

Overrides:
prelevateProperty in class OwExprExternalScope
Returns:
a property that was previously added using OwExprExternalScope.addScope(OwExprExternalScope) or null if no such property was added
Throws:
OwExprEvaluationException

prelevateFunction

protected final OwExprFunction prelevateFunction(String functionName_p,
                                                 OwExprExpressionType[] argumentTypes_p)
                                          throws OwExprEvaluationException
Description copied from class: OwExprExternalScope
Function search hook for OwExprExternalScope.function(String, OwExprExpressionType[]).
Children of this class should override this method to perform custom

Overrides:
prelevateFunction in class OwExprExternalScope
Returns:
always null
Throws:
OwExprEvaluationException

at

public OwExprProperty at(int index_p)
                  throws OwExprEvaluationException
Indexed scope access method form an array POJO.

Specified by:
at in interface OwExprScope
Overrides:
at in class OwExprExternalScope
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
Overrides:
length in class OwExprExternalScope
Returns:
the maximum index range for which indexed access is possible in this scope
Throws:
OwExprEvaluationException

toString

public String toString()
Overrides:
toString in class OwExprExternalScope

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
Overrides:
hasProperty in class OwExprExternalScope
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


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.