Name findTypeName(Class binding) { return typeMappingProfile.name(binding); } }
private QName guessValueType(Object value) { Class clazz = value.getClass(); List profiles = Arrays.asList(new Object[] {new XSProfile(), new GML3Profile()}); for (Iterator it = profiles.iterator(); it.hasNext(); ) { TypeMappingProfile profile = (TypeMappingProfile) it.next(); Name name = profile.name(clazz); if (name != null) { return new QName(name.getNamespaceURI(), name.getLocalPart()); } } return null; } }
Name findTypeName(Class binding) { for (Iterator p = profiles.iterator(); p.hasNext(); ) { Object profile = p.next(); Name name = null; if (profile instanceof TypeMappingProfile) { name = ((TypeMappingProfile) profile).name(binding); } else if (profile instanceof Schema) { Schema schema = (Schema) profile; for (Map.Entry<Name, AttributeType> e : schema.entrySet()) { AttributeType at = e.getValue(); if (at.getBinding() != null && at.getBinding().equals(binding)) { name = at.getName(); break; } } if (name == null) { for (AttributeType at : schema.values()) { if (binding.isAssignableFrom(at.getBinding())) { name = at.getName(); break; } } } } if (name != null) { return name; } } return null; }