public PropertiesDescription initializePropMapping(Class<?> classSchem) { PropertiesDescription propMap = new PropertiesDescription(); Field[] fields = classSchem.getFields(); String propName = null; for (Field field : fields) { if (field.isAnnotationPresent(PropertyType.class)) { try { propName = (String) field.get(propName); } catch (Exception e) { throw new IllegalArgumentException( "couldn't read one type declaration, please check accessibility and declaration of fields annoted in " + classSchem.getName(), e); } PropertyType propType = field.getAnnotation(PropertyType.class); propMap.addNewProperty(propName, propType); } } return propMap; }
/** * Get type declared for the name property given * * @param name * The property name * @return null if propery name is unknown */ public PropertyType getPropertyType(String name) { return propDef.getPropertyType(name); }
public void addNewNameSpace(String ns, String prefered) { PropertiesDescription mapping = new PropertiesDescription(); schemaMap.put(ns, new XMPSchemaFactory(ns, XMPSchema.class, mapping)); }
|| pt.type() == Types.DefinedType) xsf.getPropertyDefinition().addNewProperty(pname, pt);
public void addNewNameSpace(String ns, String prefered) { PropertiesDescription mapping = new PropertiesDescription(); schemaMap.put(ns, new XMPSchemaFactory(ns, XMPSchema.class, mapping)); }
|| pt.type() == Types.DefinedType) xsf.getPropertyDefinition().addNewProperty(pname, pt);
PropertiesDescription pm = new PropertiesDescription(); for (Map.Entry<String, PropertyType> entry : structuredType.getDefinedProperties().entrySet()) pm.addNewProperty(entry.getKey(), entry.getValue());
public AbstractSimpleProperty instanciateSimpleField(Class<?> clz, String nsuri, String prefix, String propertyName, Object value) { PropertiesDescription pm = initializePropMapping(clz); PropertyType simpleType = pm.getPropertyType(propertyName); Types type = simpleType.type(); return instanciateSimpleProperty(nsuri, prefix, propertyName, value, type); }
public void addNewNameSpace(String ns, String prefered) { PropertiesDescription mapping = new PropertiesDescription(); schemaMap.put(ns, new XMPSchemaFactory(ns, XMPSchema.class, mapping)); }
|| pt.type() == Types.DefinedType) xsf.getPropertyDefinition().addNewProperty(pname, pt);
public PropertiesDescription initializePropMapping(Class<?> classSchem) { PropertiesDescription propMap = new PropertiesDescription(); Field[] fields = classSchem.getFields(); String propName = null; for (Field field : fields) { if (field.isAnnotationPresent(PropertyType.class)) { try { propName = (String) field.get(propName); } catch (Exception e) { throw new IllegalArgumentException( "couldn't read one type declaration, please check accessibility and declaration of fields annoted in " + classSchem.getName(), e); } PropertyType propType = field.getAnnotation(PropertyType.class); propMap.addNewProperty(propName, propType); } } return propMap; }
private void parseDescriptionInner(XMPMetadata xmp, Element description, ComplexPropertyContainer parentContainer) throws XmpParsingException { nsFinder.push(description); TypeMapping tm = xmp.getTypeMapping(); try { List<Element> properties = DomHelper.getElementChildren(description); for (Element property : properties) { String name = property.getLocalName(); PropertyType dtype = checkPropertyDefinition(xmp, DomHelper.getQName(property)); PropertyType ptype = tm.getStructuredPropMapping(dtype.type()).getPropertyType(name); // create property createProperty(xmp, property, ptype, parentContainer); } } finally { nsFinder.pop(); } }
public PropertiesDescription initializePropMapping(Class<?> classSchem) { PropertiesDescription propMap = new PropertiesDescription(); Field[] fields = classSchem.getFields(); String propName = null; for (Field field : fields) { if (field.isAnnotationPresent(PropertyType.class)) { try { propName = (String) field.get(propName); } catch (Exception e) { throw new IllegalArgumentException( "couldn't read one type declaration, please check accessibility and declaration of fields annoted in " + classSchem.getName(), e); } PropertyType propType = field.getAnnotation(PropertyType.class); propMap.addNewProperty(propName, propType); } } return propMap; }
/** * Get type declared for the name property given * * @param name * The property name * @return null if propery name is unknown */ public PropertyType getPropertyType(String name) { return propDef.getPropertyType(name); }
PropertiesDescription pm = new PropertiesDescription(); for (Map.Entry<String, PropertyType> entry : structuredType.getDefinedProperties().entrySet()) pm.addNewProperty(entry.getKey(), entry.getValue());
/** * Get type declared for the name property given * * @param name * The property name * @return null if propery name is unknown */ public PropertyType getPropertyType(String name) { return propDef.getPropertyType(name); }
PropertiesDescription pm = new PropertiesDescription(); for (Map.Entry<String, PropertyType> entry : structuredType.getDefinedProperties().entrySet()) pm.addNewProperty(entry.getKey(), entry.getValue());
String name = element.getLocalName(); String namespace = element.getNamespaceURI(); PropertyType type = pm.getPropertyType(name); if (type == null)
public AbstractSimpleProperty instanciateSimpleField(Class<?> clz, String nsuri, String prefix, String propertyName, Object value) { PropertiesDescription pm = initializePropMapping(clz); PropertyType simpleType = pm.getPropertyType(propertyName); Types type = simpleType.type(); return instanciateSimpleProperty(nsuri, prefix, propertyName, value, type); }
public AbstractSimpleProperty instanciateSimpleField(Class<?> clz, String nsuri, String prefix, String propertyName, Object value) { PropertiesDescription pm = initializePropMapping(clz); PropertyType simpleType = pm.getPropertyType(propertyName); Types type = simpleType.type(); return instanciateSimpleProperty(nsuri, prefix, propertyName, value, type); }