org.objectweb.medor.query.jorm.lib

Class 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 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 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 String
PNAME_FIELD_NAME
static Logger
logger

Method Summary

static QueryTreeField
navigate(NavigatorOperator nav, String aliasName, byte operation)
Creates a QueryTree corresponding to the path traversal represented by the NavigatorOperator.
static QueryTreeField
navigate_old(NavigatorOperator nav, String aliasName, byte op)
static void
resetNameIndexes()

Field Details

GENCLASS_ELEMENT_NAME

public static final String GENCLASS_ELEMENT_NAME


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.

Field Value:
4


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.

Field Value:
8


NAVIGATION

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

Field Value:
1


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.

Field Value:
2


PNAME_FIELD_NAME

public static final String PNAME_FIELD_NAME


logger

public static Logger logger

Method Details

navigate

public static QueryTreeField navigate(NavigatorOperator nav,
                                      String aliasName,
                                      byte operation)
            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.

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.
operation - indicates which operation to perform (NAVIGATION, NAVIGATION_INTO_LAST, IS_EMPTY or IS_NOT_EMPTY)

Returns:
the QueryTreeField which matches the NavigatorOperator.


navigate_old

public static QueryTreeField navigate_old(NavigatorOperator nav,
                                          String aliasName,
                                          byte op)
            throws MedorException


resetNameIndexes

public static void resetNameIndexes()