tecgraf.javautils.jexpression.util
Class VarNamesHandler

java.lang.Object
  extended by tecgraf.javautils.jexpression.util.VarNamesHandler
All Implemented Interfaces:
JExpressionHandler

public class VarNamesHandler
extends Object
implements JExpressionHandler

Tratador que lista o nome de todas as variáveis de uma expressão.

Author:
Tecgraf

Constructor Summary
VarNamesHandler()
          Construtor.
 
Method Summary
 Object handleAnd(Object first, Object second)
          Callback da operação '&&'.
 Object handleDivision(Object first, Object second)
          Callback de operação '/'.
 Object handleDouble(Double value)
          Callback para valores Double.
 Object handleEqual(Object first, Object second)
          Callback da operação '=='.
 Object handleField(Object object, String field)
          Callback de acesso a um campo de objeto.
 Object handleFunctionCall(String functionName, List<Object> params)
          Callback de chamada de função.
 Object handleGreater(Object first, Object second)
          Callback da operação '>'.
 Object handleGreaterEqual(Object first, Object second)
          Callback da operação '>='.
 Object handleIndex(Object object, Object index)
          Callback de indexação.
 Object handleLower(Object first, Object second)
          Callback da operação '<'.
 Object handleLowerEqual(Object first, Object second)
          Callback da operação '<='.
 Object handleMinus(Object first, Object second)
          Callback de operação '-'.
 Object handleNot(Object object)
          Callback do operador unário '!'.
 Object handleNotEqual(Object first, Object second)
          Callback da operação '!='.
 Object handleOr(Object first, Object second)
          Callback de operação '||'.
 Object handlePlus(Object first, Object second)
          Callback da operação '+'.
 Object handlePow(Object first, Object second)
          Callback da operação '^'.
 Object handleQuestion(Object condition, Object then, Object otherwise)
          Callback do operador ternário if-then-else (a ? b : c)
 Object handleTimes(Object first, Object second)
          Callback de operação '*'.
 Object handleUnaryMinus(Object object)
          Callback do operador unário '-'.
 Object handleVar(String name)
          Callback de variável.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VarNamesHandler

public VarNamesHandler()
Construtor.

Method Detail

handleDouble

public Object handleDouble(Double value)
                    throws JExpressionException
Callback para valores Double.

Specified by:
handleDouble in interface JExpressionHandler
Parameters:
value - valor.
Returns:
resultado.
Throws:
JExpressionException

handlePlus

public Object handlePlus(Object first,
                         Object second)
                  throws JExpressionException
Callback da operação '+'.

Specified by:
handlePlus in interface JExpressionHandler
Parameters:
first - primeiro operando.
second - segundo operando.
Returns:
resultado.
Throws:
JExpressionException

handleMinus

public Object handleMinus(Object first,
                          Object second)
                   throws JExpressionException
Callback de operação '-'.

Specified by:
handleMinus in interface JExpressionHandler
Parameters:
first - primeiro operando.
second - segundo operando.
Returns:
resultado.
Throws:
JExpressionException

handleTimes

public Object handleTimes(Object first,
                          Object second)
                   throws JExpressionException
Callback de operação '*'.

Specified by:
handleTimes in interface JExpressionHandler
Parameters:
first - primeiro operando.
second - segundo operando.
Returns:
resultado.
Throws:
JExpressionException

handleDivision

public Object handleDivision(Object first,
                             Object second)
                      throws JExpressionException
Callback de operação '/'.

Specified by:
handleDivision in interface JExpressionHandler
Parameters:
first - primeiro operando.
second - segundo operando.
Returns:
resultado.
Throws:
JExpressionException

handlePow

public Object handlePow(Object first,
                        Object second)
                 throws JExpressionException
Callback da operação '^'.

Specified by:
handlePow in interface JExpressionHandler
Parameters:
first - primeiro operando.
second - segundo operando.
Returns:
resultado.
Throws:
JExpressionException

handleOr

public Object handleOr(Object first,
                       Object second)
                throws JExpressionException
Callback de operação '||'.

Specified by:
handleOr in interface JExpressionHandler
Parameters:
first - primeiro operando.
second - segundo operando.
Returns:
resultado.
Throws:
JExpressionException

handleAnd

public Object handleAnd(Object first,
                        Object second)
                 throws JExpressionException
Callback da operação '&&'.

Specified by:
handleAnd in interface JExpressionHandler
Parameters:
first - primeiro operando.
second - segundo operando.
Returns:
resultado.
Throws:
JExpressionException

handleEqual

public Object handleEqual(Object first,
                          Object second)
                   throws JExpressionException
Callback da operação '=='.

Specified by:
handleEqual in interface JExpressionHandler
Parameters:
first - primeiro operando.
second - segundo operando.
Returns:
resultado.
Throws:
JExpressionException

handleNotEqual

public Object handleNotEqual(Object first,
                             Object second)
                      throws JExpressionException
Callback da operação '!='.

Specified by:
handleNotEqual in interface JExpressionHandler
Parameters:
first - primeiro operando.
second - segundo operando.
Returns:
resultado.
Throws:
JExpressionException

handleGreater

public Object handleGreater(Object first,
                            Object second)
                     throws JExpressionException
Callback da operação '>'.

Specified by:
handleGreater in interface JExpressionHandler
Parameters:
first - primeiro operando.
second - segundo operando.
Returns:
resultado.
Throws:
JExpressionException

handleGreaterEqual

public Object handleGreaterEqual(Object first,
                                 Object second)
                          throws JExpressionException
Callback da operação '>='.

Specified by:
handleGreaterEqual in interface JExpressionHandler
Parameters:
first - primeiro operando.
second - segundo operando.
Returns:
resultado.
Throws:
JExpressionException

handleLower

public Object handleLower(Object first,
                          Object second)
                   throws JExpressionException
Callback da operação '<'.

Specified by:
handleLower in interface JExpressionHandler
Parameters:
first - primeiro operando.
second - segundo operando.
Returns:
resultado.
Throws:
JExpressionException

handleLowerEqual

public Object handleLowerEqual(Object first,
                               Object second)
                        throws JExpressionException
Callback da operação '<='.

Specified by:
handleLowerEqual in interface JExpressionHandler
Parameters:
first - primeiro operando.
second - segundo operando.
Returns:
resultado.
Throws:
JExpressionException

handleQuestion

public Object handleQuestion(Object condition,
                             Object then,
                             Object otherwise)
                      throws JExpressionException
Callback do operador ternário if-then-else (a ? b : c)

Specified by:
handleQuestion in interface JExpressionHandler
Parameters:
condition - condição.
then - ação.
otherwise - caso contrário.
Returns:
resultado.
Throws:
JExpressionException

handleUnaryMinus

public Object handleUnaryMinus(Object object)
                        throws JExpressionException
Callback do operador unário '-'.

Specified by:
handleUnaryMinus in interface JExpressionHandler
Parameters:
object - operando.
Returns:
resultado.
Throws:
JExpressionException

handleNot

public Object handleNot(Object object)
                 throws JExpressionException
Callback do operador unário '!'.

Specified by:
handleNot in interface JExpressionHandler
Parameters:
object - operando.
Returns:
resultado.
Throws:
JExpressionException

handleVar

public Object handleVar(String name)
                 throws JExpressionException
Callback de variável.

Specified by:
handleVar in interface JExpressionHandler
Parameters:
name - nome da variável.
Returns:
resultado.
Throws:
JExpressionException

handleIndex

public Object handleIndex(Object object,
                          Object index)
                   throws JExpressionException
Callback de indexação.

Specified by:
handleIndex in interface JExpressionHandler
Parameters:
object - objeto a ser indexado.
index - índice.
Returns:
resultado da indexação.
Throws:
JExpressionException

handleField

public Object handleField(Object object,
                          String field)
                   throws JExpressionException
Callback de acesso a um campo de objeto.

Specified by:
handleField in interface JExpressionHandler
Parameters:
object - primeiro operando.
field - campo.
Returns:
resultado.
Throws:
JExpressionException

handleFunctionCall

public Object handleFunctionCall(String functionName,
                                 List<Object> params)
                          throws JExpressionException
Callback de chamada de função.

Specified by:
handleFunctionCall in interface JExpressionHandler
Parameters:
functionName - nome função.
params - lista de parâmetros.
Returns:
resultado da chamada de função.
Throws:
JExpressionException


Copyright © 2007–2014 Tecgraf/PUC-Rio. All rights reserved.