* @param type The expected type of the value to be returned.
* @throws IllegalArgumentException If the bean is not part of a complete bean graph.
*/
protected static java.util.List findCompatibleBeansWithValue(BaseBean root, String propName, String propVal, Class type) throws IllegalArgumentException {
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;
}