/** * Return the specialized schema class representation if it's known (create and add it to metadata). In other cases, * return null * * @param metadata * Metadata to link the new schema * @param namespace * The namespace URI * @param prefix The namespace prefix * @return Schema representation * @throws XmpSchemaException * When Instancing specified Object Schema failed */ public XMPSchema getAssociatedSchemaObject(XMPMetadata metadata, String namespace, String prefix) throws XmpSchemaException { if (schemaMap.containsKey(namespace)) { XMPSchemaFactory factory = schemaMap.get(namespace); return factory.createXMPSchema(metadata, prefix); } else { XMPSchemaFactory factory = getSchemaFactory(namespace); return factory != null ? factory.createXMPSchema(metadata, prefix) : null; } }
XMPSchemaFactory factory = getSchemaFactory(name.getNamespaceURI()); if (factory != null)
if (schema == null && tm.getSchemaFactory(namespace) != null) schema = tm.getSchemaFactory(namespace).createXMPSchema(xmp, attr.getPrefix()); loadAttributes(schema, description);
ArrayProperty properties = st.getProperty(); ArrayProperty valueTypes = st.getValueType(); XMPSchemaFactory xsf = tm.getSchemaFactory(namespaceUri); xsf = tm.getSchemaFactory(namespaceUri);
private void parseChildrenAsProperties(XMPMetadata xmp, List<Element> properties, TypeMapping tm, Element description) throws XmpParsingException, XmpSchemaException { // parse children elements as properties for (Element property : properties) { String namespace = property.getNamespaceURI(); PropertyType type = checkPropertyDefinition(xmp, DomHelper.getQName(property)); // create the container if (!tm.isDefinedSchema(namespace)) { throw new XmpParsingException(ErrorType.NoSchema, "This namespace is not a schema or a structured type : " + namespace); } XMPSchema schema = xmp.getSchema(namespace); if (schema == null) { schema = tm.getSchemaFactory(namespace).createXMPSchema(xmp, property.getPrefix()); loadAttributes(schema, description); } ComplexPropertyContainer container = schema.getContainer(); // create property createProperty(xmp, property, type, container); } }
/** * Return the specialized schema class representation if it's known (create and add it to metadata). In other cases, * return null * * @param metadata * Metadata to link the new schema * @param namespace * The namespace URI * @param prefix The namespace prefix * @return Schema representation * @throws XmpSchemaException * When Instancing specified Object Schema failed */ public XMPSchema getAssociatedSchemaObject(XMPMetadata metadata, String namespace, String prefix) throws XmpSchemaException { if (schemaMap.containsKey(namespace)) { XMPSchemaFactory factory = schemaMap.get(namespace); return factory.createXMPSchema(metadata, prefix); } else { XMPSchemaFactory factory = getSchemaFactory(namespace); return factory != null ? factory.createXMPSchema(metadata, prefix) : null; } }
/** * Return the specialized schema class representation if it's known (create and add it to metadata). In other cases, * return null * * @param metadata * Metadata to link the new schema * @param namespace * The namespace URI * @param prefix The namespace prefix * @return Schema representation * @throws XmpSchemaException * When Instancing specified Object Schema failed */ public XMPSchema getAssociatedSchemaObject(XMPMetadata metadata, String namespace, String prefix) throws XmpSchemaException { if (schemaMap.containsKey(namespace)) { XMPSchemaFactory factory = schemaMap.get(namespace); return factory.createXMPSchema(metadata, prefix); } else { XMPSchemaFactory factory = getSchemaFactory(namespace); return factory != null ? factory.createXMPSchema(metadata, prefix) : null; } }
XMPSchemaFactory factory = getSchemaFactory(name.getNamespaceURI()); if (factory != null)
XMPSchemaFactory factory = getSchemaFactory(name.getNamespaceURI()); if (factory != null)
if (schema == null && tm.getSchemaFactory(namespace) != null) schema = tm.getSchemaFactory(namespace).createXMPSchema(xmp, attr.getPrefix()); loadAttributes(schema, description);
if (schema == null && tm.getSchemaFactory(namespace) != null) schema = tm.getSchemaFactory(namespace).createXMPSchema(xmp, attr.getPrefix()); loadAttributes(schema, description);
private void parseChildrenAsProperties(XMPMetadata xmp, List<Element> properties, TypeMapping tm, Element description) throws XmpParsingException, XmpSchemaException { // parse children elements as properties for (Element property : properties) { String namespace = property.getNamespaceURI(); PropertyType type = checkPropertyDefinition(xmp, DomHelper.getQName(property)); // create the container if (!tm.isDefinedSchema(namespace)) { throw new XmpParsingException(ErrorType.NoSchema, "This namespace is not a schema or a structured type : " + namespace); } XMPSchema schema = xmp.getSchema(namespace); if (schema == null) { schema = tm.getSchemaFactory(namespace).createXMPSchema(xmp, property.getPrefix()); loadAttributes(schema, description); } ComplexPropertyContainer container = schema.getContainer(); // create property createProperty(xmp, property, type, container); } }
ArrayProperty properties = st.getProperty(); ArrayProperty valueTypes = st.getValueType(); XMPSchemaFactory xsf = tm.getSchemaFactory(namespaceUri); xsf = tm.getSchemaFactory(namespaceUri);
private void parseChildrenAsProperties(XMPMetadata xmp, List<Element> properties, TypeMapping tm, Element description) throws XmpParsingException, XmpSchemaException { // parse children elements as properties for (Element property : properties) { String namespace = property.getNamespaceURI(); PropertyType type = checkPropertyDefinition(xmp, DomHelper.getQName(property)); // create the container if (!tm.isDefinedSchema(namespace)) { throw new XmpParsingException(ErrorType.NoSchema, "This namespace is not a schema or a structured type : " + namespace); } XMPSchema schema = xmp.getSchema(namespace); if (schema == null) { schema = tm.getSchemaFactory(namespace).createXMPSchema(xmp, property.getPrefix()); loadAttributes(schema, description); } ComplexPropertyContainer container = schema.getContainer(); // create property createProperty(xmp, property, type, container); } }
ArrayProperty properties = st.getProperty(); ArrayProperty valueTypes = st.getValueType(); XMPSchemaFactory xsf = tm.getSchemaFactory(namespaceUri); xsf = tm.getSchemaFactory(namespaceUri);