org.deduced
Interface NameReferenceFinder

All Known Implementing Classes:
NameReferenceFinderImplementation

public interface NameReferenceFinder

NameReferenceFinder : this class is used to find property collections by name. The class has a list of all the root collections. It also has a map of all the associations between the parents and the children that define which property holds the name of the child. Note that name reference finders do not monitor changes in the name of the root collections. Therefore, if a root collection name changes, the name reference finder becomes invalid.

Author:
Steve McDuff

Method Summary
 PropertyCollection<?,?> getNamedChild(PropertyCollection<?,?> parent, java.lang.String name)
          Find a named child from a parent collection.
 java.util.List<PropertyCollection<?,?>> getNamedChildList(PropertyCollection<?,?> parent, java.lang.String name)
          Find all the named child from a parent collection.
 java.lang.String getReferenceName(PropertyCollection<?,?> child)
          fetch the name of the child depending on the parent.
 PropertyCollection<?,?> getRootCollectionFromName(java.lang.String name)
          fetch a root collection by specifying its name
 java.util.Set<java.lang.String> getRootNameSet()
          get the set of all the Root Names
 java.lang.String getRootReferenceName(PropertyCollection<?,?> rootCollection)
          fetch a root collection name
 

Method Detail

getRootReferenceName

java.lang.String getRootReferenceName(PropertyCollection<?,?> rootCollection)
fetch a root collection name

Parameters:
rootCollection - the root collection
Returns:
the name of the specified root collection

getRootCollectionFromName

PropertyCollection<?,?> getRootCollectionFromName(java.lang.String name)
fetch a root collection by specifying its name

Parameters:
name - the name of the root collection
Returns:
the found root collection

getReferenceName

java.lang.String getReferenceName(PropertyCollection<?,?> child)
fetch the name of the child depending on the parent. If the child is null or the parent of the child is null, this method will return a null value. If the parent is using a fixed instance, the name of the child collection will be returned. Otherwise, the name of instance containing the child will be returned.

Parameters:
child - the child property collection which requires a name
Returns:
the name of the child

getNamedChild

PropertyCollection<?,?> getNamedChild(PropertyCollection<?,?> parent,
                                      java.lang.String name)
Find a named child from a parent collection. If the parent contains a fixed instance, then this object will attempt to find a child that has the expected name. Otherwise the name of the instance will be used to find a matching child.

Parameters:
parent - the parent collection
name - the name of the child
Returns:
the found child

getNamedChildList

java.util.List<PropertyCollection<?,?>> getNamedChildList(PropertyCollection<?,?> parent,
                                                          java.lang.String name)
Find all the named child from a parent collection. If the parent contains a fixed instance, then this object will attempt to find a child that has the expected name. Otherwise the name of the instance will be used to find a matching child.

Parameters:
parent - the parent collection
name - the name of the child
Returns:
the found child

getRootNameSet

java.util.Set<java.lang.String> getRootNameSet()
get the set of all the Root Names

Returns:
the set of all the Root Names