|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deduced.NameReferenceFinderImplementation
public class NameReferenceFinderImplementation
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.
Field Summary | |
---|---|
private java.util.Map<PropertyCollection<?,?>,java.lang.String> |
rootMapByCollection
map that uses the root collection unique ID as a key and stores the name as a value. |
private java.util.Map<java.lang.String,PropertyCollection<?,?>> |
rootMapByName
map that uses the root collection name as a key and has the root collection as a value |
Constructor Summary | |
---|---|
NameReferenceFinderImplementation()
constructor |
Method Summary | |
---|---|
private void |
addChildIfCollectionNameMatches(java.lang.String name,
java.util.List<PropertyCollection<?,?>> retVal,
java.lang.Object nameKey,
java.lang.Object child)
add Child If Collection Name Matches |
private void |
addChildIfNameMatches(PropertyCollection<?,?> parent,
java.lang.String name,
java.util.List<PropertyCollection<?,?>> retVal,
PropertyCollection<?,?> currentInstance)
add Child If Name Matches |
void |
addRootCollection(PropertyCollection<?,?> rootCollection,
java.lang.String name)
add a root collection |
private static java.lang.String |
buildReferenceWithNoNameError(PropertyCollection<?,?> currentDependency)
build an error message about an invalid dependency. |
void |
clear()
clear the reference name finder of its root collections and child name associations |
PropertyCollection<?,?> |
getNamedChild(PropertyCollection<?,?> parent,
java.lang.String name)
(non-Javadoc) |
java.util.List<PropertyCollection<?,?>> |
getNamedChildList(PropertyCollection<?,?> parent,
java.lang.String name)
(non-Javadoc) |
java.lang.String |
getReferenceName(PropertyCollection<?,?> child)
(non-Javadoc) |
PropertyCollection<?,?> |
getRootCollectionFromName(java.lang.String name)
(non-Javadoc) |
java.util.Set<java.lang.String> |
getRootNameSet()
(non-Javadoc) |
java.lang.String |
getRootReferenceName(PropertyCollection<?,?> rootCollection)
(non-Javadoc) |
void |
removeRootCollection(PropertyCollection<?,?> rootCollection)
remove a root collection |
void |
removeRootCollectionByName(java.lang.String name)
Remove a root collection from a specific name |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Map<PropertyCollection<?,?>,java.lang.String> rootMapByCollection
private java.util.Map<java.lang.String,PropertyCollection<?,?>> rootMapByName
Constructor Detail |
---|
public NameReferenceFinderImplementation()
Method Detail |
---|
public void clear()
public void addRootCollection(PropertyCollection<?,?> rootCollection, java.lang.String name)
rootCollection
- the root collection to addname
- the name of the root collectionprivate static java.lang.String buildReferenceWithNoNameError(PropertyCollection<?,?> currentDependency)
currentDependency
- the invalid dependency
public void removeRootCollection(PropertyCollection<?,?> rootCollection)
rootCollection
- the root collection to removepublic void removeRootCollectionByName(java.lang.String name)
name
- the name of the root collection to removepublic java.lang.String getRootReferenceName(PropertyCollection<?,?> rootCollection)
getRootReferenceName
in interface NameReferenceFinder
rootCollection
- the root collection
NameReferenceFinder.getRootReferenceName(org.deduced.PropertyCollection)
public PropertyCollection<?,?> getRootCollectionFromName(java.lang.String name)
getRootCollectionFromName
in interface NameReferenceFinder
name
- the name of the root collection
NameReferenceFinder.getRootCollectionFromName(java.lang.String)
public java.lang.String getReferenceName(PropertyCollection<?,?> child)
getReferenceName
in interface NameReferenceFinder
child
- the child property collection which requires a name
NameReferenceFinder.getReferenceName(org.deduced.PropertyCollection)
public PropertyCollection<?,?> getNamedChild(PropertyCollection<?,?> parent, java.lang.String name)
getNamedChild
in interface NameReferenceFinder
parent
- the parent collectionname
- the name of the child
NameReferenceFinder.getNamedChild(org.deduced.PropertyCollection,
java.lang.String)
public java.util.Set<java.lang.String> getRootNameSet()
getRootNameSet
in interface NameReferenceFinder
NameReferenceFinder.getRootNameSet()
public java.util.List<PropertyCollection<?,?>> getNamedChildList(PropertyCollection<?,?> parent, java.lang.String name)
getNamedChildList
in interface NameReferenceFinder
parent
- the parent collectionname
- the name of the child
NameReferenceFinder.getNamedChildList(org.deduced.PropertyCollection,
java.lang.String)
private void addChildIfCollectionNameMatches(java.lang.String name, java.util.List<PropertyCollection<?,?>> retVal, java.lang.Object nameKey, java.lang.Object child)
name
- the name to matchretVal
- the list in which to add the collection if the name matchesnameKey
- the name keychild
- the potential child to addprivate void addChildIfNameMatches(PropertyCollection<?,?> parent, java.lang.String name, java.util.List<PropertyCollection<?,?>> retVal, PropertyCollection<?,?> currentInstance)
parent
- the parent of the collection to addname
- the name to matchretVal
- the list in which to add the child if the name matchescurrentInstance
- the child instance on the parent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |