Search in sources :

Example 11 with XMPSchema

use of org.apache.xmpbox.schema.XMPSchema in project pdfbox by apache.

the class XMPMetadata method getSchema.

/**
 * Get the XMPSchema for the specified namespace.
 *
 * Return the schema corresponding to this nsURI<br>
 * BE CAREFUL: typically, Metadata should contain one schema for each type.
 * This method returns the first schema encountered
 * corresponding to this NSURI.<br>
 * Return null if unknown
 *
 * @param nsURI The namespace URI corresponding to the schema wanted
 * @return The matching XMP schema representation
 */
public XMPSchema getSchema(String nsURI) {
    Iterator<XMPSchema> it = schemas.iterator();
    XMPSchema tmp;
    while (it.hasNext()) {
        tmp = it.next();
        if (tmp.getNamespace().equals(nsURI)) {
            return tmp;
        }
    }
    return null;
}
Also used : XMPSchema(org.apache.xmpbox.schema.XMPSchema)

Aggregations

XMPSchema (org.apache.xmpbox.schema.XMPSchema)11 PropertyType (org.apache.xmpbox.type.PropertyType)3 Test (org.junit.Test)3 ComplexPropertyContainer (org.apache.xmpbox.type.ComplexPropertyContainer)2 StructuredType (org.apache.xmpbox.type.StructuredType)2 TypeMapping (org.apache.xmpbox.type.TypeMapping)2 Element (org.w3c.dom.Element)2 InputStream (java.io.InputStream)1 Field (java.lang.reflect.Field)1 ArrayList (java.util.ArrayList)1 QName (javax.xml.namespace.QName)1 ValidationException (org.apache.pdfbox.preflight.exception.ValidationException)1 XMPMetadata (org.apache.xmpbox.XMPMetadata)1 DublinCoreSchema (org.apache.xmpbox.schema.DublinCoreSchema)1 PDFAExtensionSchema (org.apache.xmpbox.schema.PDFAExtensionSchema)1 XMPSchemaFactory (org.apache.xmpbox.schema.XMPSchemaFactory)1 AbstractField (org.apache.xmpbox.type.AbstractField)1 AbstractSimpleProperty (org.apache.xmpbox.type.AbstractSimpleProperty)1 AbstractStructuredType (org.apache.xmpbox.type.AbstractStructuredType)1 ArrayProperty (org.apache.xmpbox.type.ArrayProperty)1