public Class getPropertyType(Object parent, String name) { AccessMethod accessmethod = getAccessMethod(name); if (accessmethod == null) { throw UniversalRuntimeException.accumulate(new PropertyException(), "Property " + name + " of " + targetclass + " not found "); } return accessmethod.getAccessedType(); }
/** * Takes a path ending with a greedy expression (probably .*) and appends the * "leaves" (fields) based on passed in arguments */ private void appendLeaves(Class rootclass, String pathroot, String attrprefix, StringList attnames, StringList paths) { String[] components = PathUtil.splitPath(pathroot); Class moveclass = rootclass; for (int i = 0; i < components.length; ++i) { MethodAnalyser ma = mappingcontext.getAnalyser(moveclass); String component = components[i]; AccessMethod method = ma.getAccessMethod(component); if (method == null || !(method.canGet() && method.canSet())) { throw new IllegalArgumentException( "Unable to find writeable property for path component " + component + " at " + moveclass); } moveclass = method.getAccessedType(); } MethodAnalyser ma = mappingcontext.getAnalyser(moveclass); for (int i = 0; i < ma.allgetters.length; ++i) { SAXAccessMethod method = ma.allgetters[i]; if (method.canGet() && method.canSet() && mappingcontext.generalLeafParser.isLeafType(method.getAccessedType())) { paths.add(PathUtil.composePathEncoded(pathroot, method.tagname)); attnames.add(attrprefix + method.tagname); } } }
Class targetclazz = setter.getAccessedType(); Object depbean = resolveDependent(beanref, pri, targetclazz, setter.getDeclaredType());