org.objectweb.medor.query.jorm.lib
Class NavigatorNodeFactory

java.lang.Object
  extended byorg.objectweb.medor.query.jorm.lib.NavigatorNodeFactory

public class NavigatorNodeFactory
extends java.lang.Object

This class constructs a QueryTree from a NavigatorOperator, which represents a path expression.

It is a factory for normal JoinProject query nodes, which implement the semantics of the path traversal represented by the NavigatorOperator.


Field Summary
static java.lang.String GENCLASS_ELEMENT_NAME
           
static byte IS_EMPTY
          Applies to navigation ending with a GenClassRef only.
static byte IS_NOT_EMPTY
          Applies to navigation ending with a GenClassRef only.
static Logger logger
           
static byte NAVIGATION
          To navigate up to the last field.
static byte NAVIGATION_INTO_LAST
          To navigate up to the element referenced by the last field.
static java.lang.String PNAME_FIELD_NAME
           
 
Constructor Summary
NavigatorNodeFactory()
           
 
Method Summary
static QueryTreeField navigate(NavigatorOperator nav, java.lang.String aliasName, byte op)
          Creates a QueryTree corresponding to the path traversal represented by the NavigatorOperator.
static void resetNameIndexes()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PNAME_FIELD_NAME

public static final java.lang.String PNAME_FIELD_NAME
See Also:
Constant Field Values

GENCLASS_ELEMENT_NAME

public static final java.lang.String GENCLASS_ELEMENT_NAME
See Also:
Constant Field Values

NAVIGATION

public static final byte NAVIGATION
To navigate up to the last field.

See Also:
Constant Field Values

NAVIGATION_INTO_LAST

public static final byte NAVIGATION_INTO_LAST
To navigate up to the element referenced by the last field.

For a GenClassRef, includes the GenClass element. For a ClassRef, includes all fields of the referenced class object.

See Also:
Constant Field Values

IS_EMPTY

public static final byte IS_EMPTY
Applies to navigation ending with a GenClassRef only.

Tests whether there are no GenClass elements for the GenClassRef.

See Also:
Constant Field Values

IS_NOT_EMPTY

public static final byte IS_NOT_EMPTY
Applies to navigation ending with a GenClassRef only.

Tests whether there are GenClass elements for the GenClassRef.

See Also:
Constant Field Values

logger

public static Logger logger
Constructor Detail

NavigatorNodeFactory

public NavigatorNodeFactory()
Method Detail

navigate

public static QueryTreeField navigate(NavigatorOperator nav,
                                      java.lang.String aliasName,
                                      byte op)
                               throws MedorException
Creates a QueryTree corresponding to the path traversal represented by the NavigatorOperator.

The end of the path expression can either be a single-valued field or a reference to a GenClass. In the latter case, the elements of the GenClass are projected together with their index attributes.

Note that the name of the element of a GenClass extent is "element", and that the name of the GenClass identifier is "object".

Parameters:
nav - is the NavigatorOperator representing the path expression. This operator starts with a FieldOperand pointing to a Field called here FStart. All fields in the node hosting FStart are projected.
aliasName - is the root name of the Fields reached by the path expression.
op - indicates which operation to perform (NAVIGATION, NAVIGATION_INTO_LAST, IS_EMPTY or IS_NOT_EMPTY)
Returns:
the QueryTreeField which matches the NavigatorOperator.
Throws:
MedorException

resetNameIndexes

public static void resetNameIndexes()