private PropertyType checkPropertyDefinition(XMPMetadata xmp, QName prop) throws XmpParsingException { TypeMapping tm = xmp.getTypeMapping(); // test if namespace is set in xml if (!nsFinder.containsNamespace(prop.getNamespaceURI())) { throw new XmpParsingException(ErrorType.NoSchema, "Schema is not set in this document : " + prop.getNamespaceURI()); } // test if namespace is defined String nsuri = prop.getNamespaceURI(); if (!tm.isDefinedNamespace(nsuri)) { throw new XmpParsingException(ErrorType.NoSchema, "Cannot find a definition for the namespace " + prop.getNamespaceURI()); } try { return tm.getSpecifiedPropertyType(prop); } catch (BadFieldValueException e) { throw new XmpParsingException(ErrorType.InvalidType, "Failed to retrieve property definition", e); } }
private PropertyType checkPropertyDefinition(XMPMetadata xmp, QName prop) throws XmpParsingException { TypeMapping tm = xmp.getTypeMapping(); // test if namespace is set in xml if (!nsFinder.containsNamespace(prop.getNamespaceURI())) { throw new XmpParsingException(ErrorType.NoSchema, "Schema is not set in this document : " + prop.getNamespaceURI()); } // test if namespace is defined String nsuri = prop.getNamespaceURI(); if (!tm.isDefinedNamespace(nsuri)) { throw new XmpParsingException(ErrorType.NoSchema, "Cannot find a definition for the namespace " + prop.getNamespaceURI()); } try { return tm.getSpecifiedPropertyType(prop); } catch (BadFieldValueException e) { throw new XmpParsingException(ErrorType.InvalidType, "Failed to retrieve property definition", e); } }
private PropertyType checkPropertyDefinition(XMPMetadata xmp, QName prop) throws XmpParsingException { TypeMapping tm = xmp.getTypeMapping(); // test if namespace is set in xml if (!nsFinder.containsNamespace(prop.getNamespaceURI())) { throw new XmpParsingException(ErrorType.NoSchema, "Schema is not set in this document : " + prop.getNamespaceURI()); } // test if namespace is defined String nsuri = prop.getNamespaceURI(); if (!tm.isDefinedNamespace(nsuri)) { throw new XmpParsingException(ErrorType.NoSchema, "Cannot find a definition for the namespace " + prop.getNamespaceURI()); } try { return tm.getSpecifiedPropertyType(prop); } catch (BadFieldValueException e) { throw new XmpParsingException(ErrorType.InvalidType, "Failed to retrieve property definition", e); } }