public static PropertyContainer find(Object src,Path path){
  PropertyContainer result;
  PropertyDescriptor desc;
  Object newSrc;
  PathElement part;
  Method method;
  Object methodResult;
  part=path.get(0);
  try {
    desc=new PropertyDescriptor(part.getName(),src.getClass());
  }
 catch (  Exception e) {
    desc=null;
    e.printStackTrace();
  }
  if (desc == null)   return null;
  if (path.size() == 1) {
    result=new PropertyContainer(desc,src);
  }
 else {
    try {
      method=desc.getReadMethod();
      methodResult=method.invoke(src,(Object[])null);
      if (part.hasIndex())       newSrc=Array.get(methodResult,part.getIndex());
 else       newSrc=methodResult;
      result=find(newSrc,path.subpath(1));
    }
 catch (    Exception e) {
      result=null;
      e.printStackTrace();
    }
  }
  return result;
}

public static PropertyContainer find ( Object src , Path path ) { PropertyContainer result ; PropertyDescriptor desc ; Object newSrc ; PathElement part ; Method method ; Object methodResult ; part = path . get ( 0 ) ; try { desc = new PropertyDescriptor ( part . getName ( ) , src . getClass ( ) ) ; } catch ( Exception e ) { desc = null ; e . printStackTrace ( ) ; } if ( desc == null ) return null ; if ( path . size ( ) == 1 ) { result = new PropertyContainer ( desc , src ) ; } else { try { method = desc . getReadMethod ( ) ; methodResult = method . invoke ( src , ( Object [ ] ) null ) ; if ( part . hasIndex ( ) ) newSrc = Array . get ( methodResult , part . getIndex ( ) ) ; else newSrc = methodResult ; result = find ( newSrc , path . subpath ( 1 ) ) ; } catch ( Exception e ) { result = null ; e . printStackTrace ( ) ; } } return result ; }
returns the property and object associated with the given path , null if a problem occurred .
