Element element = iterator.next(); Element match = getMatch(element, "parameter[@index='" + i + "']"); if (match != null
protected Element findMapping(Type type) { // We are not prepared to find .aegis.xml files for Parameterized types. Class<?> clazz = TypeUtil.getTypeClass(type, false); if (clazz == null) { return null; } Document doc = getDocument(clazz); if (doc == null) { return null; } Element mapping = getMatch(doc, "/mappings/mapping[@uri='" + getTypeMapping().getMappingIdentifierURI() + "']"); if (mapping == null) { mapping = getMatch(doc, "/mappings/mapping[not(@uri)]"); } return mapping; }
Element element = iterator.next(); Element match = getMatch(element, "parameter[@index='" + i + "']"); if (match != null
protected Element findMapping(Type type) { // We are not prepared to find .aegis.xml files for Parameterized types. Class<?> clazz = TypeUtil.getTypeClass(type, false); if (clazz == null) { return null; } Document doc = getDocument(clazz); if (doc == null) { return null; } Element mapping = getMatch(doc, "/mappings/mapping[@uri='" + getTypeMapping().getMappingIdentifierURI() + "']"); if (mapping == null) { mapping = getMatch(doc, "/mappings/mapping[not(@uri)]"); } return mapping; }
Element parameter = getMatch(bestMatch, "parameter[@index='" + index + "']"); readMetadata(info, mapping, parameter); } else {
@Override public TypeClassInfo createClassInfo(PropertyDescriptor pd) { Element mapping = findMapping(pd.getReadMethod().getDeclaringClass()); if (mapping == null) { return nextCreator.createClassInfo(pd); } Element propertyEl = getMatch(mapping, "./property[@name='" + pd.getName() + "']"); if (propertyEl == null) { return nextCreator.createClassInfo(pd); } TypeClassInfo info = new TypeClassInfo(); Type returnType = pd.getReadMethod().getGenericReturnType(); info.setType(returnType); info.setDescription("property " + pd.getDisplayName()); readMetadata(info, mapping, propertyEl); return info; }
Element parameter = getMatch(bestMatch, "parameter[@index='" + index + "']"); readMetadata(info, mapping, parameter); } else {
private Type getGenericParameterFromSpec(Element mapping, String componentType) { if (componentType.startsWith("#")) { String name = componentType.substring(1); Element propertyEl = getMatch(mapping, "./component[@name='" + name + "']"); if (propertyEl == null) { throw new DatabindingException("Could not find <component> element in mapping named '" + name + "'"); } String className = DOMUtils.getAttributeValueEmptyNull(propertyEl, "class"); if (className == null) { throw new DatabindingException("A 'class' attribute must be specified for <component> " + name); } return loadComponentClass(className); } return loadComponentClass(componentType); }
private Type getGenericParameterFromSpec(Element mapping, String componentType) { if (componentType.startsWith("#")) { String name = componentType.substring(1); Element propertyEl = getMatch(mapping, "./component[@name='" + name + "']"); if (propertyEl == null) { throw new DatabindingException("Could not find <component> element in mapping named '" + name + "'"); } String className = DOMUtils.getAttributeValueEmptyNull(propertyEl, "class"); if (className == null) { throw new DatabindingException("A 'class' attribute must be specified for <component> " + name); } return loadComponentClass(className); } return loadComponentClass(componentType); }
@Override public TypeClassInfo createClassInfo(PropertyDescriptor pd) { Element mapping = findMapping(pd.getReadMethod().getDeclaringClass()); if (mapping == null) { return nextCreator.createClassInfo(pd); } Element propertyEl = getMatch(mapping, "./property[@name='" + pd.getName() + "']"); if (propertyEl == null) { return nextCreator.createClassInfo(pd); } TypeClassInfo info = new TypeClassInfo(); Type returnType = pd.getReadMethod().getGenericReturnType(); info.setType(returnType); info.setDescription("property " + pd.getDisplayName()); readMetadata(info, mapping, propertyEl); return info; }