Home » pdfbox-1.1.0-src » org.apache.jempbox.xmp » [javadoc | source]
org.apache.jempbox.xmp
public class: XMPMetadata [javadoc | source]
java.lang.Object
   org.apache.jempbox.xmp.XMPMetadata

Direct Known Subclasses:
    XMPMetadataPDFA

This class represents the top level XMP data structure and gives access to the various schemas that are available as part of the XMP specification.
Field Summary
public static final  String ENCODING_UTF8    Supported encoding for persisted XML. 
public static final  String ENCODING_UTF16BE    Supported encoding for persisted XML. 
public static final  String ENCODING_UTF16LE    Supported encoding for persisted XML. 
protected  Document xmpDocument    The DOM representation of the metadata. 
protected  String encoding    The encoding of the XMP document. Default is UTF8. 
protected  Map<?> nsMappings    A mapping of namespaces. 
Constructor:
 public XMPMetadata() throws IOException 
    Default constructor, creates blank XMP doc.
    Throws:
    IOException - If there is an error creating the initial document.
 public XMPMetadata(Document doc) 
    Constructor from an existing XML document.
    Parameters:
    doc - The root XMP document.
Method from org.apache.jempbox.xmp.XMPMetadata Summary:
addBasicJobTicketSchema,   addBasicSchema,   addDublinCoreSchema,   addDynamicMediaSchema,   addIptc4xmpCoreSchema,   addMediaManagementSchema,   addPDFSchema,   addPagedTextSchema,   addPhotoshopSchema,   addRightsManagementSchema,   addSchema,   addXMLNSMapping,   asByteArray,   basicAddSchema,   getBasicJobTicketSchema,   getBasicSchema,   getDublinCoreSchema,   getDynamicMediaSchema,   getEncoding,   getMediaManagementSchema,   getPDFSchema,   getPagedTextSchema,   getRightsManagementSchema,   getSchemaByClass,   getSchemas,   getSchemasByNamespaceURI,   getXMPDocument,   hasUnknownSchema,   load,   load,   load,   main,   merge,   save,   save,   setEncoding
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.jempbox.xmp.XMPMetadata Detail:
 public XMPSchemaBasicJobTicket addBasicJobTicketSchema() 
    Add a new Job Ticket schema.
 public XMPSchemaBasic addBasicSchema() 
    Create and add a new Basic Schema to this metadata. Typically a XMP document will only have one schema for each type (but multiple are supported) so it is recommended that you first check the existence of a this scheme by using getDublinCoreSchema()
 public XMPSchemaDublinCore addDublinCoreSchema() 
    Create and add a new Dublin Core Schema to this metadata. Typically a XMP document will only have one schema for each type (but multiple are supported) so it is recommended that you first check the existence of a this scheme by using getDublinCoreSchema()
 public XMPSchemaDynamicMedia addDynamicMediaSchema() 
    Add a new Dynamic Media schema.
 public XMPSchemaIptc4xmpCore addIptc4xmpCoreSchema() 
    Create and add a new IPTC schema to this metadata.
 public XMPSchemaMediaManagement addMediaManagementSchema() 
    Add a new Media Management schema.
 public XMPSchemaPDF addPDFSchema() 
    Create and add a new PDF Schema to this metadata. Typically a XMP document will only have one PDF schema (but multiple are supported) so it is recommended that you first check the existence of a PDF scheme by using getPDFSchema()
 public XMPSchemaPagedText addPagedTextSchema() 
    Add a new Paged Text schema.
 public XMPSchemaPhotoshop addPhotoshopSchema() 
    Create and add a new Photoshop schema to this metadata.
 public XMPSchemaRightsManagement addRightsManagementSchema() 
    Add a new Rights Managment schema.
 public  void addSchema(XMPSchema schema) 
    Add a custom schema to the root rdf. The schema has to have been created as a child of this XMPMetadata.
 public  void addXMLNSMapping(String namespace,
    Class<?> xmpSchema) 
    Will add a XMPSchema to the set of identified schemas. The class needs to have a constructor with parameter Element
 public byte[] asByteArray() throws Exception 
    Get the XML document as a byte array.
 protected XMPSchema basicAddSchema(XMPSchema schema) 
    Generic add schema method.
 public XMPSchemaBasicJobTicket getBasicJobTicketSchema() throws IOException 
    Get the Job Ticket Schema.
 public XMPSchemaBasic getBasicSchema() throws IOException 
    Get the Basic Schema.
 public XMPSchemaDublinCore getDublinCoreSchema() throws IOException 
    Get the Dublin Core Schema.
 public XMPSchemaDynamicMedia getDynamicMediaSchema() throws IOException 
    Get the Dynamic Media Schema.
 public String getEncoding() 
    Get the current encoding that will be used to write the XML.
 public XMPSchemaMediaManagement getMediaManagementSchema() throws IOException 
    Get the Media Management Schema.
 public XMPSchemaPDF getPDFSchema() throws IOException 
    Get the PDF Schema.
 public XMPSchemaPagedText getPagedTextSchema() throws IOException 
    Get the Paged Text Schema.
 public XMPSchemaRightsManagement getRightsManagementSchema() throws IOException 
    Get the Schema Rights Schema.
 public XMPSchema getSchemaByClass(Class<?> targetSchema) throws IOException 
    Tries to retrieve a schema from this by classname.
 public List<XMPSchema> getSchemas() throws IOException 
    This will get a list of XMPSchema(or subclass) objects.
 public List<XMPSchema> getSchemasByNamespaceURI(String namespaceURI) throws IOException 
    Will return all schemas that fit the given namespaceURI. Which is only done by using the namespace mapping (nsMapping) and not by actually checking the xmlns property.
 public Document getXMPDocument() 
    Get the XML document from this object.
 public boolean hasUnknownSchema() throws IOException 
    This will return true if the XMP contains an unknown schema.
 public static XMPMetadata load(String file) throws IOException 
    Load metadata from the filesystem.
 public static XMPMetadata load(InputSource is) throws IOException 
    Load a schema from an input source.
 public static XMPMetadata load(InputStream is) throws IOException 
    Load metadata from the filesystem.
 public static  void main(String[] args) throws Exception 
    Test main program.
 public  void merge(XMPMetadata metadata) throws IOException 
    Merge this metadata with the given metadata object.
 public  void save(String file) throws Exception 
    Save the XMP document to a file.
 public  void save(OutputStream outStream) throws TransformerException 
    Save the XMP document to a stream.
 public  void setEncoding(String xmlEncoding) 
    The encoding used to write the XML. Default value:UTF-8
    See the ENCODING_XXX constants