com.endeca.navigation.analytics
Class ExprLookup

java.lang.Object
  extended by com.endeca.navigation.analytics.ExprLookup
All Implemented Interfaces:
Expr, QueryNode

public class ExprLookup
extends Object
implements Expr

ExprLookup instances represent an access to a derived property of a record in a foreign table.

MyTable[expr1, expr2].field is semantically correct if MyTable is GROUPed by the same number of fields as the number of expressions within brackets "[...]", and "field" is a derived property defined on MyTable. Brackets with no expression list within represent access to a table that is GROUPed to a single record.

Note that because the implicit tables NavStateRecords and AllBaseRecords are not GROUPED, it is not possible to do a lookup on these tables.


Constructor Summary
ExprLookup(String tableName, String fieldName, LookupList lList)
          Constructs a new ExprLookup.
 
Method Summary
 String getFieldName()
          Gets the field name for this ExprLookup.
 LookupList getLookupList()
          Gets the LookupList for this ExprLookup.
 String getTableName()
          Gets the table name for this ExprLookup.
 void setFieldName(String fName)
          Sets the field name for this ExprLookup.
 void setLookupList(LookupList lList)
          Sets the LookupList for this ExprLookup.
 void setTableName(String tName)
          Sets the table name for this ExprLookup.
 String toString()
          Returns the string form of this ExprLookup.
 String toWire()
          Returns the wire form of this ExprLookup.
 void validateSyntax()
          Validates the syntax of this ExprLookup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExprLookup

public ExprLookup(String tableName,
                  String fieldName,
                  LookupList lList)
Constructs a new ExprLookup. The LookupList represents a list of expressions that evaluate to a list of values that uniquely identify a record in the table.

Parameters:
tableName - the name of the table. Note that the table names NavStateRecords and AllBaseRecords are reserved and therefore cannot be specified.
fieldName - a derived property of the table specified by tableName.
lList - a LookupList object that has been populated with lookup expressions (objects of type Expr).
Method Detail

getTableName

public String getTableName()
Gets the table name for this ExprLookup.

Returns:
The name of the table for this ExprLookup.

setTableName

public void setTableName(String tName)
Sets the table name for this ExprLookup.

Parameters:
tName - the name of the table. Note that the table names NavStateRecords and AllBaseRecords are reserved and therefore cannot be specified.

getFieldName

public String getFieldName()
Gets the field name for this ExprLookup.

Returns:
The field name for this ExprLookup.

setFieldName

public void setFieldName(String fName)
Sets the field name for this ExprLookup.

Parameters:
fName - a derived property of the table specified by the tableName setting.

getLookupList

public LookupList getLookupList()
Gets the LookupList for this ExprLookup.

Returns:
The LookupList for this ExprLookup.

setLookupList

public void setLookupList(LookupList lList)
Sets the LookupList for this ExprLookup.

Parameters:
lList - a LookupList object that has been populated with lookup expressions (objects of type Expr).

toString

public String toString()
Returns the string form of this ExprLookup. These are of the format:
tableName[expression1, expression2...].fieldName
where each expression is a lookup expression in the LookupList.

Specified by:
toString in interface QueryNode
Overrides:
toString in class Object
Returns:
A string representation of the ExprLookup in the specified format.

toWire

public String toWire()
Returns the wire form of this ExprLookup. This method is not intended for public use because the wire format is subject to change.

Specified by:
toWire in interface QueryNode
Returns:
A wire format representation of this ExprLookup.

validateSyntax

public void validateSyntax()
                    throws SyntaxException
Validates the syntax of this ExprLookup. An ExprLookup is valid if the table name and field name are non-null and non-empty. The LookupList itself must also be valid.

Specified by:
validateSyntax in interface QueryNode
Throws:
SyntaxException - if the syntax requirements are not satisfied.


2010 Endeca Technologies, Inc.
Endeca Confidential