com.wewebu.expression.language
Class OwExprStaticArray

java.lang.Object
  extended by com.wewebu.expression.language.OwExprExpression
      extended by com.wewebu.expression.language.OwExprStaticArray
All Implemented Interfaces:
OwExprPrimaryPrefix, OwExprScope

public class OwExprStaticArray
extends OwExprExpression
implements OwExprPrimaryPrefix, OwExprScope

An expression representing a static array (inlined array value like {1,2,3} ).

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

Since:
version 1.1.0 and AWD 3.1.0.0

Field Summary
 
Fields inherited from class com.wewebu.expression.language.OwExprExpression
m_errorTable, m_symbolTable, m_typeError
 
Constructor Summary
OwExprStaticArray(OwExprSymbolTable symbolTable_p, OwExprErrorTable errorTable_p)
           
 
Method Summary
 void add(OwExprExpression expression_p)
          Parse time construction method.
 OwExprProperty at(int index_p)
          Indexed scope access method
 OwExprValue evaluate(OwExprScope scope_p)
          Evaluates this expression on the OwExprScope (scope) provided as argument.
 OwExprExpression expression()
           
 OwExprFunction function(String functionName_p, OwExprExpressionType[] argunmentTyes_p)
          Function access method.
 boolean hasProperty(String propertyName_p)
          Property access helper method.
 int length()
          Indexed scope access helper method
 OwExprProperty property(String propertyName_p)
          Property access method.
 OwExprFunctionSymbol regressToFunction()
          Forces this primary prefix symbol to a function.
 OwExprPropertySymbol regressToPorperty()
          Forces this primary prefix symbol to a property.
 OwExprSymbolScope regressToScope()
          Forces this primary prefix to a scope symbol.
 String toString()
           
 OwExprExpressionType type()
          Type check method.
 
Methods inherited from class com.wewebu.expression.language.OwExprExpression
errCount, evaluate, evaluate, getErrorTable, getSymbol, getSymbolTable, hasErrors, initType, symbolsVisibleInScopes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OwExprStaticArray

public OwExprStaticArray(OwExprSymbolTable symbolTable_p,
                         OwExprErrorTable errorTable_p)
Method Detail

add

public void add(OwExprExpression expression_p)
Parse time construction method.

Parameters:
expression_p - array item expression

evaluate

public OwExprValue evaluate(OwExprScope scope_p)
                     throws OwExprEvaluationException
Description copied from class: OwExprExpression
Evaluates this expression on the OwExprScope (scope) provided as argument.

Specified by:
evaluate in class OwExprExpression
Parameters:
scope_p - external scope to be used during evaluation
Returns:
the value resulted from the evaluation of this expression
Throws:
OwExprEvaluationException - in case of evaluation failure

type

public OwExprExpressionType type()
                          throws OwExprTypeMissmatchException
Description copied from class: OwExprExpression
Type check method. If type errors are encountered during type computation the OwExprExpression.m_typeError should be set to true

Specified by:
type in class OwExprExpression
Returns:
the expression type for this expression
Throws:
OwExprTypeMissmatchException - if type errors are encountered during type computation

expression

public OwExprExpression expression()
Specified by:
expression in interface OwExprPrimaryPrefix
Returns:
the expression represented by this primary prefix

regressToFunction

public OwExprFunctionSymbol regressToFunction()
                                       throws OwExprTypeMissmatchException
Description copied from interface: OwExprPrimaryPrefix
Forces this primary prefix symbol to a function.

Specified by:
regressToFunction in interface OwExprPrimaryPrefix
Returns:
the function symbol of this expression
Throws:
OwExprTypeMissmatchException - if a type mismatch is detected during function symbol creation

regressToPorperty

public OwExprPropertySymbol regressToPorperty()
                                       throws OwExprTypeMissmatchException
Description copied from interface: OwExprPrimaryPrefix
Forces this primary prefix symbol to a property.

Specified by:
regressToPorperty in interface OwExprPrimaryPrefix
Returns:
the property symbol of this expression
Throws:
OwExprTypeMissmatchException - if a type mismatch is detected during property symbol creation

regressToScope

public OwExprSymbolScope regressToScope()
                                 throws OwExprTypeMissmatchException
Description copied from interface: OwExprPrimaryPrefix
Forces this primary prefix to a scope symbol.

Specified by:
regressToScope in interface OwExprPrimaryPrefix
Returns:
the scope symbol of this expression
Throws:
OwExprTypeMissmatchException - if a type mismatch is detected during scope symbol creation

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)

function

public OwExprFunction function(String functionName_p,
                               OwExprExpressionType[] argunmentTyes_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
argunmentTyes_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

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

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

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

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.