protected static java.util.List | findCompatibleBeansWithValue(org.netbeans.modules.schema2beans.BaseBean root, java.lang.String propName, java.lang.String propVal, java.lang.Class type)A utility for finding beans in a graph of BaseBean objects.
Search the bean graph, starting at a given root, for beans where the named
property has the given value. The returned list is filtered by assignment
compatibility.
java.util.List retVal = null;
GraphManager gm = root.graphManager();
if (null == gm)
throw new IllegalArgumentException("Disconnected beans not supported");
String[] props = root.findPropertyValue(propName, propVal);
int len = 0;
if (null != props)
len = props.length;
if (len > 0)
retVal = new java.util.ArrayList();
for (int i = 0; i < len; i++) {
// get the bean that is the property's parent.
BaseBean candidate = gm.getPropertyParent(props[i]);
if (type.isInstance(candidate))
retVal.add(candidate);
}
return retVal;
|