1 23 package com.sun.enterprise.tools.common.dd; 24 25 import org.netbeans.modules.schema2beans.BaseBean; 26 import org.netbeans.modules.schema2beans.GraphManager; 27 import org.netbeans.modules.schema2beans.BaseProperty; 28 32 public class BaseBeanUtils { 33 34 35 protected BaseBeanUtils() { 36 } 37 38 50 protected static java.util.List findCompatibleBeansWithValue(BaseBean root, String propName, String propVal, Class type) throws IllegalArgumentException { 51 java.util.List retVal = null; 52 GraphManager gm = root.graphManager(); 53 if (null == gm) 54 throw new IllegalArgumentException ("Disconnected beans not supported"); 55 String [] props = root.findPropertyValue(propName, propVal); 56 int len = 0; 57 if (null != props) 58 len = props.length; 59 if (len > 0) 60 retVal = new java.util.ArrayList (); 61 for (int i = 0; i < len; i++) { 62 BaseBean candidate = gm.getPropertyParent(props[i]); 64 if (type.isInstance(candidate)) 65 retVal.add(candidate); 66 } 67 return retVal; 68 } 69 } 70 | Popular Tags |