Transfer version 1.1

transfer.com.dynamic
Class MementoBuilder

WEB-INF.cftags.component
        extended by transfer.com.dynamic.MementoBuilder

public class MementoBuilder
extends WEB-INF.cftags.component

Builder for creating memento structs from queries


Constructor Summary
init(ObjectManager objectManager, query query, any javaLoader)
          Constructor
 
Method Summary
 any _dump([any s], [any abort='true'])
 void add(string compositeName, string key, string className, boolean isArray, struct structValue, string parentClassName, string parentKey, string parentCompositeName, string parentParentClassName)
          Add a set of memento values to the collection
private void addToCollection(string className, string key, any memento)
          Adds the memento to the collection
private void addToCompositePathCache(string className, string key, string compositeName, string parentClassName, string compositePathKey)
          Adds the memento to the collection
private string buildCompositePath(string className, string key, string compositeName, string parentClassName, [string compositeKey=''])
          Builds the composite path by traversing the tree from the bottom up
private struct getCompositePathCache()
private string getCompositePathKey(string className, string key)
          returns the key in a common fashion
private string getCompositionPath(string className, string key, string compositeName, string parentClassName)
          if it has the composition path, returns is, otherwise builds it
private any getFromCollection(string className, string key)
          Retrieves a Memento object from the collection
private string getFromCompositePathCache(string className, string key, string compositeName, string parentClassName)
          Retrieves a Memento object from the collection
private JavaLoader getJavaLoader()
private any getMemento()
private struct getMementoCollection()
 struct getMementoStruct()
          Returns the Struct value of the memento
private ObjectManager getObjectManager()
private struct getParentCompositePaths()
private query getQuery()
private boolean hasInCollection(string className, string key)
          checks to see if the memento is already in the collection
private boolean hasInCompositePathCache(string className, string key, string compositeName, string parentClassName)
          checks to see if the memento is already in the collection
private boolean hasMemento()
          If there is a top level memento set
private void setCompositePathCache(struct CompositePathCache)
private void setJavaLoader(JavaLoader JavaLoader)
private void setMemento(any Memento)
private void setMementoCollection(struct MementoCollection)
private void setObjectManager(ObjectManager ObjectManager)
private void setParentCompositePaths(struct ParentCompositePaths)
private void setQuery(query Query)
private boolean validateParentCompositePath(string className, string key, string compositeName, string parentClassName)
          validates if the parent composite paths are the same as what has been followed before
 
Methods inherited from class WEB-INF.cftags.component
 

Constructor Detail

init

public init(ObjectManager objectManager, query query, any javaLoader)
Constructor

Parameters:
objectManager - Need to object manager for making queries
query - The query the memento has been built off
javaLoader - The java loader for the memento class
Method Detail

_dump

public any _dump([any s], [any abort='true'])

Parameters:
s
abort

add

public void add(string compositeName, string key, string className, boolean isArray, struct structValue, string parentClassName, string parentKey, string parentCompositeName, string parentParentClassName)
Add a set of memento values to the collection

Parameters:
compositeName - The name of the composite
key - The primary key value of this object
className - The classname of the object
isArray - If the collection from here is an array or not
structValue - The struct of values for this part of the memento
parentClassName - The classname of the parent of this object
parentKey - The primary key of the parent of this object
parentCompositeName - The parent composite name
parentParentClassName - The 2nd level parent composite name

addToCollection

private void addToCollection(string className, string key, any memento)
Adds the memento to the collection

Parameters:
className - The classname for the memento
key - The key value
memento - The memento object to add

addToCompositePathCache

private void addToCompositePathCache(string className, string key, string compositeName, string parentClassName, string compositePathKey)
Adds the memento to the collection

Parameters:
className - the classname of the parent
key - The primary key value
compositeName - The name of the composite
parentClassName - the parent class name
compositePathKey - The composite path key

buildCompositePath

private string buildCompositePath(string className, string key, string compositeName, string parentClassName, [string compositeKey=''])
Builds the composite path by traversing the tree from the bottom up

Parameters:
className - the classname of the parent
key - The primary key value
compositeName - The name of the composite
parentClassName - the parent class name
compositeKey - The current composite key

getCompositePathCache

private struct getCompositePathCache()


getCompositePathKey

private string getCompositePathKey(string className, string key)
returns the key in a common fashion

Parameters:
className - the classname of the parent
key - The primary key value

getCompositionPath

private string getCompositionPath(string className, string key, string compositeName, string parentClassName)
if it has the composition path, returns is, otherwise builds it

Parameters:
className - the classname of the parent
key - The primary key value
compositeName - The name of the composite
parentClassName - the parent class name

getFromCollection

private any getFromCollection(string className, string key)
Retrieves a Memento object from the collection

Parameters:
className - The classname for the memento
key - The key value

getFromCompositePathCache

private string getFromCompositePathCache(string className, string key, string compositeName, string parentClassName)
Retrieves a Memento object from the collection

Parameters:
className - the classname of the parent
key - The primary key value
compositeName - The name of the composite
parentClassName - the parent class name

getJavaLoader

private JavaLoader getJavaLoader()


getMemento

private any getMemento()


getMementoCollection

private struct getMementoCollection()


getMementoStruct

public struct getMementoStruct()
Returns the Struct value of the memento


getObjectManager

private ObjectManager getObjectManager()


getParentCompositePaths

private struct getParentCompositePaths()


getQuery

private query getQuery()


hasInCollection

private boolean hasInCollection(string className, string key)
checks to see if the memento is already in the collection

Parameters:
className - The classname for the memento
key - The key value

hasInCompositePathCache

private boolean hasInCompositePathCache(string className, string key, string compositeName, string parentClassName)
checks to see if the memento is already in the collection

Parameters:
className - the classname of the parent
key - The primary key value
compositeName - The name of the composite
parentClassName - the parent class name

hasMemento

private boolean hasMemento()
If there is a top level memento set


setCompositePathCache

private void setCompositePathCache(struct CompositePathCache)

Parameters:
CompositePathCache

setJavaLoader

private void setJavaLoader(JavaLoader JavaLoader)

Parameters:
JavaLoader

setMemento

private void setMemento(any Memento)

Parameters:
Memento

setMementoCollection

private void setMementoCollection(struct MementoCollection)

Parameters:
MementoCollection

setObjectManager

private void setObjectManager(ObjectManager ObjectManager)

Parameters:
ObjectManager

setParentCompositePaths

private void setParentCompositePaths(struct ParentCompositePaths)

Parameters:
ParentCompositePaths

setQuery

private void setQuery(query Query)

Parameters:
Query

validateParentCompositePath

private boolean validateParentCompositePath(string className, string key, string compositeName, string parentClassName)
validates if the parent composite paths are the same as what has been followed before

Parameters:
className - the classname of the parent
key - The primary key value
compositeName - The name of the composite
parentClassName - the parent class name

Transfer version 1.1