org.objectweb.medor.filter.jorm.lib
Class CompositePName

java.lang.Object
  extended byBasicOperator
      extended byorg.objectweb.medor.filter.jorm.lib.CompositePName

public class CompositePName
extends BasicOperator

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
See Also:
Serialized Form

Field Summary
protected  java.lang.String[] cofns
           
protected  TuplePNameGetter myGetter
           
 
Constructor Summary
CompositePName(FieldOperand[] fs, java.lang.String[] compositefieldnames, Operand po, PType t)
          Constructs a SinglePName from a ParameterOperand representing the naming context, and an array of FieldOperand.
 
Method Summary
 java.lang.Object clone(java.lang.Object clone, java.util.Map obj2clone)
           
 Operand compileExpression()
          Checks the semantic integrity of an expression.
 Operand evaluate(ParameterOperand[] pos, java.lang.Object o)
           
 java.lang.String[] getCompositeFieldName()
          It retrieves an array of the composite field name.
 FieldOperand[] getFields()
           
 java.lang.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cofns

protected java.lang.String[] cofns

myGetter

protected TuplePNameGetter myGetter
Constructor Detail

CompositePName

public CompositePName(FieldOperand[] fs,
                      java.lang.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.
po - is the ParameterOperand representing the naming context.
t - is the PType of the PName created by this operator.
compositefieldnames - is the compositename fields. This array is linked to parameter fs (FieldOperand[]).
Throws:
MedorException - when the number of FieldOperand is not equal to the size of the proj parameter.
Method Detail

getCompositeFieldName

public java.lang.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()


getPNameManagerParameter

public ParameterOperand getPNameManagerParameter()

clone

public java.lang.Object clone(java.lang.Object clone,
                              java.util.Map obj2clone)
                       throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException

getResult

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

Returns:
an Operand Object
Throws:
java.lang.IllegalStateException - if this expression is not compiled.

evaluate

public Operand evaluate(ParameterOperand[] pos,
                        java.lang.Object o)
                 throws ExpressionException
Throws:
ExpressionException

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.

Throws:
org.objectweb.medor.expression.api.TypingException - when incompatible types error occurs.
org.objectweb.medor.expression.api.MalformedExpressionException - if syntax error
TypingException
MalformedExpressionException

getFields

public FieldOperand[] getFields()

getOperatorString

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