* @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 List findCompatibleBeansWithValue(BaseBean root, String propName, String propVal, Class type) throws IllegalArgumentException {
List retVal = null;
GraphManager gm = root.graphManager();
if (null == gm)
throw new IllegalArgumentException(
bundle.getString("ERR_DISCONNECTED_NOT_SUPPORTED"));
String[] props = root.findPropertyValue(propName, propVal);
int len = 0;
if (null != props)
len = props.length;
if (len > 0)
retVal = new 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;
}