|
||||||||||
| 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 | |
|---|---|
void |
addAllMatchingOrderingChildren(PropertyCollection<?,?> parent,
java.lang.String name,
java.util.List<PropertyCollection<?,?>> retVal,
PropertyCollection valueInstance)
add All Matching Ordering Children |
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 |
boolean |
containsRootCollection(PropertyCollection<?,?> potentialRoot)
test if a root collection is registered or not. |
static java.lang.String |
getCollectionName(PropertyCollection<?,?> child)
get Collection Name |
PropertyCollection<?,?> |
getNamedChild(PropertyCollection<?,?> parent,
java.lang.String name)
(non-Javadoc) |
java.util.List<PropertyCollection<?,?>> |
getNamedChildList(PropertyCollection<?,?> parent,
java.lang.String name)
(non-Javadoc) |
static java.lang.String |
getOrderingName(PropertyCollection<?,?> child)
get Ordering Name |
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) |
static boolean |
isCollectionNameEqual(java.lang.String name,
java.lang.Object nameKey,
java.lang.Object child)
is Collection Name Equal |
static boolean |
isOrdereredListType(PropertyCollection<?,?> type)
is ordered list type |
static boolean |
isOrderingType(PropertyCollection<?,?> type)
is Ordering Type |
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 boolean containsRootCollection(PropertyCollection<?,?> potentialRoot)
potentialRoot - the potential root collection
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 NameReferenceFinderrootCollection - the root collection
NameReferenceFinder.getRootReferenceName(org.deduced.PropertyCollection)public PropertyCollection<?,?> getRootCollectionFromName(java.lang.String name)
getRootCollectionFromName in interface NameReferenceFindername - the name of the root collection
NameReferenceFinder.getRootCollectionFromName(java.lang.String)public java.lang.String getReferenceName(PropertyCollection<?,?> child)
getReferenceName in interface NameReferenceFinderchild - the child property collection which requires a name
NameReferenceFinder.getReferenceName(org.deduced.PropertyCollection)public static java.lang.String getOrderingName(PropertyCollection<?,?> child)
child - the ordering collection
public static java.lang.String getCollectionName(PropertyCollection<?,?> child)
child - collection from which to get the name
public static boolean isOrdereredListType(PropertyCollection<?,?> type)
type - the property collection type to test
public static boolean isOrderingType(PropertyCollection<?,?> type)
type - the property collection type to test
public PropertyCollection<?,?> getNamedChild(PropertyCollection<?,?> parent,
java.lang.String name)
getNamedChild in interface NameReferenceFinderparent - 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 NameReferenceFinderNameReferenceFinder.getRootNameSet()
public java.util.List<PropertyCollection<?,?>> getNamedChildList(PropertyCollection<?,?> parent,
java.lang.String name)
getNamedChildList in interface NameReferenceFinderparent - the parent collectionname - the name of the child
NameReferenceFinder.getNamedChildList(org.deduced.PropertyCollection,
java.lang.String)
public void addAllMatchingOrderingChildren(PropertyCollection<?,?> parent,
java.lang.String name,
java.util.List<PropertyCollection<?,?>> retVal,
PropertyCollection valueInstance)
parent - the parent collection of the ordering childrenname - name to matchretVal - list to fill with matching valuesvalueInstance - value instance in the ordering type
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 add
public static boolean isCollectionNameEqual(java.lang.String name,
java.lang.Object nameKey,
java.lang.Object child)
name - the name to look fornameKey - the property key to use to find the name on the collectionchild - the potential collection
private 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 | |||||||||