org.objectweb.medor.filter.jorm.lib

Class CompositePName

Implemented Interfaces:
Operator

public class CompositePName
extends BasicOperator
implements Operator

A CompositePName is an Operator representing the construction of a PName from a NamingContext and several Fields.

The NamingContext is provided as a ParameterOperand. The name of the ParameterOperand is defined to be:

  1. The fully qualified class name for the PName of the class itself
  2. The fully qualified class name, to which the attribute name is concatenated for a reference PName
The Fields are provided as an array of FieldOperand. It relies on a TuplePNameGetter (@see org.objectweb.medor.query.jorm.lib.TuplePNameGetter) to construct the PName.

Author:
Alexandre Lefebvre

Field Summary

protected String[]
cofns
protected TuplePNameGetter
myGetter

Constructor Summary

CompositePName(FieldOperand[] fs, String[] compositefieldnames, Operand po, PType t)
Constructs a SinglePName from a ParameterOperand representing the naming context, and an array of FieldOperand.

Method Summary

Object
clone(Object clone, Map obj2clone)
Operand
compileExpression()
Checks the semantic integrity of an expression.
Operand
evaluate(ParameterOperand[] pos, Object o)
String[]
getCompositeFieldName()
It retrieves an array of the composite field name.
FieldOperand[]
getFields()
String
getOperatorString()
There is no Java operator associated to a PName
ParameterOperand
getPNameManagerParameter()
Operand
getResult()
Gets the operand in wich the result will be put in

Field Details

cofns

protected String[] cofns


myGetter

protected TuplePNameGetter myGetter

Constructor Details

CompositePName

public CompositePName(FieldOperand[] fs,
                      String[] compositefieldnames,
                      Operand po,
                      PType t)
            throws MedorException
Constructs a SinglePName from a ParameterOperand representing the naming context, and an array of FieldOperand. The FieldOperands should be built on JormFields.

Parameters:
fs - is the array of FieldOperands from which the value is taken.
compositefieldnames - is the compositename fields. This array is linked to parameter fs (FieldOperand[]).
po - is the ParameterOperand representing the naming context.
t - is the PType of the PName created by this operator.

Throws:
MedorException - when the number of FieldOperand is not equal to the size of the proj parameter.

Method Details

clone

public Object clone(Object clone,
                    Map obj2clone)
            throws CloneNotSupportedException


compileExpression

public Operand compileExpression()
            throws TypingException,
                   MalformedExpressionException
Checks the semantic integrity of an expression. It checks that all types are compatible and prepare the expression to be evaluable. It also creates buffers where stores the result. Notes that when evaluating there is no creation of new objects. This method changes the state of this expression object, it will be evaluable and not modifiable.


evaluate

public Operand evaluate(ParameterOperand[] pos,
                        Object o)
            throws ExpressionException


getCompositeFieldName

public String[] getCompositeFieldName()
It retrieves an array of the composite field name. The order of this array matches to the order of the FieldOperand array returned by the method getField()


getFields

public FieldOperand[] getFields()


getOperatorString

public String getOperatorString()
There is no Java operator associated to a PName


getPNameManagerParameter

public ParameterOperand getPNameManagerParameter()


getResult

public Operand getResult()
            throws IllegalStateException
Gets the operand in wich the result will be put in

Returns:
an Operand Object