com.stc.eindex.ejb.query
Class TupleAssembler

java.lang.Object
  extended bycom.stc.eindex.ejb.query.TupleAssembler
All Implemented Interfaces:
ResultObjectAssembler
Direct Known Subclasses:
MatchTupleAssembler

public class TupleAssembler
extends java.lang.Object
implements ResultObjectAssembler

The TupleAssembler class assembles tuples from the data retrieved by the Query Manager. Tuples are used by the match engine.


Method Summary
 java.lang.Object createObjectAttributes(java.lang.Object rootObject, java.lang.Object parent, java.lang.String objectName, AttributesData attrsData)
          Creates an object containing the attributes for each object (other than the root object) that is returned from the Query Manager iterator (QMIterator class) and that has a new identity.
 java.lang.Object createRoot(java.lang.String objectName, AttributesData attrsData)
          Creates the root object for each object returned from the Query Manager iterator (QMIterator class).
 void init()
          Initializes the resources to be used by TupleAssembler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createObjectAttributes

public java.lang.Object createObjectAttributes(java.lang.Object rootObject,
                                               java.lang.Object parent,
                                               java.lang.String objectName,
                                               AttributesData attrsData)
                                        throws VOAException
Creates an object containing the attributes for each object (other than the root object) that is returned from the Query Manager iterator (QMIterator class) and that has a new identity. This method may create a new object, and sets the attribute values for the new object to those in the input AttributesData object. createObjectAttributes also binds the new attributes object to the input parent object. For example, if Parent.FirstName and Parent.Address.City are retrieved in a query, createObjectAttributes is called for each Address object retrieved. The Person object is both the root and parent object, and the new attributes object is bound to the Person object.

Specified by:
createObjectAttributes in interface ResultObjectAssembler
Parameters:
rootObject - The name of the root object.
parent - The name of the parent object (this may be the same as the root object).
objectName - The name of the object, as defined in the Object Definition configuration file in the eView Project.
attrsData - - The attribute data associated with the object.
Returns:
Object - An object containing the attributes.
Throws:
VOAException - Thrown if an error occurs while creating the object attributes.

createRoot

public java.lang.Object createRoot(java.lang.String objectName,
                                   AttributesData attrsData)
                            throws VOAException
Creates the root object for each object returned from the Query Manager iterator (QMIterator class). Inside createRoot(), you can create initialization data structures that can later be used by the createObjectAttributes method.

Specified by:
createRoot in interface ResultObjectAssembler
Parameters:
objectName - The name of the root object.
attrsData - The attribute data associated with the root object.
Returns:
Object - The root object of the fields in the SQL statement.
Throws:
VOAException - Thrown if an error occurs while creating the root object.

init

public void init()
Initializes the resources to be used by TupleAssembler. Call this method only once before starting the assembly process.

Parameters:
None.
Returns:
void - None.
Throws:
None.

Specified by:
init in interface ResultObjectAssembler


Copyright 2007 by Sun Microsystems, Inc. All Rights Reserved.