Top Description Fields Constructors Methods
org.apache.xmpbox

public Class XMPMetadata

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Iterator, .List, .Map, org.apache.xmpbox.schema.AdobePDFSchema, .DublinCoreSchema, .PDFAExtensionSchema, .PDFAIdentificationSchema, .PhotoshopSchema, .XMPBasicJobTicketSchema, .XMPBasicSchema, .XMPMediaManagementSchema, .XMPRightsManagementSchema, .XMPSchema, .XmpSchemaException, org.apache.xmpbox.type.StructuredType, .TypeMapping

Object representation of XMPMetaData Be CAREFUL: typically, metadata should contain only one schema for each type (each NSURI). Retrieval of common schemas (like DublinCore) is based on this fact and take the first schema of this type encountered. However, XmpBox allow you to place schemas of same type with different prefix. If you do that, you must retrieve all schemas by yourself with getAllSchemas or with getSchema which use prefix parameter.
Author
a183132

Field Summary

Modifier and TypeField and Description
private final List<XMPSchema>
private final TypeMapping
private String
private String
private String
private String
private String

Constructor Summary

AccessConstructor and Description
protected
XMPMetadata()

Constructor of an empty default XMPMetaData.

protected
XMPMetadata(String
Value of xpacketBegin
xpacketBegin
,
String
Value of xpacketId
xpacketId
,
String
Value of xpacketBytes
xpacketBytes
,
String
Value of xpacket encoding
xpacketEncoding
)

Creates blank XMP doc with specified parameters.

Method Summary

Modifier and TypeMethod and Description
public void
addSchema(XMPSchema
the schema to add
obj
)

Add a schema to the current structure.

public void
clearSchemas()

Removes all schemas defined.

public AdobePDFSchema

Returns:

schema added in order to work on it
createAndAddAdobePDFSchema
()

Create and add an Adobe PDF schema to this metadata.

public XMPBasicJobTicketSchema

Returns:

schema added in order to work on it.
createAndAddBasicJobTicketSchema
()

Create and add a default Basic Job Ticket schema to this metadata.

public XMPSchema

Returns:

The schema added in order to work on it
createAndAddDefaultSchema
(String
The prefix wanted for the schema
nsPrefix
,
String
The namespace URI wanted for the schema
nsURI
)

Create and add an unspecified schema.

public DublinCoreSchema

Returns:

schema added in order to work on it
createAndAddDublinCoreSchema
()

Create and add a default Dublin Core schema to this metadata.

public PDFAExtensionSchema

Returns:

PDFAExtension schema added in order to work on it
createAndAddPDFAExtensionSchemaWithDefaultNS
()

Create and add a default PDFA Extension schema to this metadata.

public PDFAExtensionSchema

Returns:

schema added in order to work on it
createAndAddPDFAExtensionSchemaWithNS
(Map<String, String>
Special namespaces list to use
namespaces
)

Create and add a default PDFA Extension schema to this metadata.

public PDFAIdentificationSchema

Returns:

schema added in order to work on it
createAndAddPDFAIdentificationSchema
()

Create and add a default PDFA Identification schema to this metadata.

public PhotoshopSchema

Returns:

schema added in order to work on it
createAndAddPhotoshopSchema
()

Create and add Photoshop Schema to this metadata.

public XMPBasicSchema

Returns:

schema added in order to work on it
createAndAddXMPBasicSchema
()

Create and add a XMP Basic schema to this metadata.

public XMPMediaManagementSchema

Returns:

schema added in order to work on it
createAndAddXMPMediaManagementSchema
()

Create and add a XMP Media Management schema to this metadata.

public XMPRightsManagementSchema

Returns:

schema added in order to work on it
createAndAddXMPRightsManagementSchema
()

Create and add a default XMP Rights Management Schema to this metadata.

public static XMPMetadata

Returns:

the XMPMetadata created.
createXMPMetadata
()

Creates blank XMP doc with default parameters.

public static XMPMetadata

Returns:

the XMPMetadata created.
createXMPMetadata
(String
Value of xpacketBegin
xpacketBegin
,
String
Value of xpacketId
xpacketId
,
String
Value of xpacketBytes
xpacketBytes
,
String
Value of xpacket encoding
xpacketEncoding
)

Creates blank XMP doc with specified parameters.

public AdobePDFSchema

Returns:

The AdobePDFSchema schema or null if not declared
getAdobePDFSchema
()

Get the Adobe PDF schema.

public List<XMPSchema>

Returns:

List of declared schemas
getAllSchemas
()

Get all Schemas declared in this metadata representation.

public XMPBasicJobTicketSchema

Returns:

The XMPBasicJobTicketSchema schema or null if not declared.
getBasicJobTicketSchema
()

Get the Basic Job Ticket Schema.

public DublinCoreSchema

Returns:

The DublinCoreSchema schema or null if not declared.
getDublinCoreSchema
()

Get the Dublin Core schema.

public String

Returns:

XPACKET END Value
getEndXPacket
()

get XPACKET END PI.

public PDFAIdentificationSchema

Returns:

The PDFAIdentificationSchema schema or null if not declared
getPDFAIdentificationSchema
()

Get the PDFA Identification schema.

public PDFAExtensionSchema

Returns:

The PDFAExtension schema or null if not declared
getPDFExtensionSchema
()

Get the PDFA Extension schema.

public PhotoshopSchema

Returns:

The PhotoshopSchema schema or null if not declared
getPhotoshopSchema
()

Get the Photoshop schema.

public XMPSchema

Returns:

The matching XMP schema representation
getSchema
(String
The namespace URI corresponding to the schema wanted
nsURI
)

Get the XMPSchema for the specified namespace.

public XMPSchema

Returns:

The matching XMP schema representation
getSchema
(Class<? extends XMPSchema>
The Class corresponding to the schema wanted
clz
)

Get the XMPSchema for the specified Class.

public XMPSchema

Returns:

The Class Schema representation
getSchema
(String
The prefix fixed in the schema wanted
prefix
,
String
The namespace URI corresponding to the schema wanted
nsURI
)

Return the schema corresponding to this nsURI and a prefix.

public TypeMapping

Returns:

the defined TypeMapping.
getTypeMapping
()

Get TypeMapping.

public XMPBasicSchema

Returns:

The XMPBasicSchema schema or null if not declared
getXMPBasicSchema
()

Get the XMP Basic schema.

public XMPMediaManagementSchema

Returns:

The XMPMediaManagementSchema schema or null if not declared
getXMPMediaManagementSchema
()

Get the XMP Media Management schema.

public XMPRightsManagementSchema

Returns:

The XMPRightsManagementSchema schema or null if not declared
getXMPRightsManagementSchema
()

Get the XMP Rights Management Schema.

public String

Returns:

value of xpacket Begin field
getXpacketBegin
()

Get xpacket Begin.

public String

Returns:

value of xpacketBytes field
getXpacketBytes
()

Get xpacketBytes.

public String

Returns:

value of xpacket Encoding field
getXpacketEncoding
()

Get xpacket encoding.

public String

Returns:

value of xpacket Id field
getXpacketId
()

Get xpacket Id.

public void
removeSchema(XMPSchema
The schema to remove
schema
)

Remove a schema.

public void
setEndXPacket(String
The XPacket End value
data
)

Set special XPACKET END PI.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

schemasback to summary
private final List<XMPSchema> schemas
typeMappingback to summary
private final TypeMapping typeMapping
xpacketBeginback to summary
private String xpacketBegin
xpacketBytesback to summary
private String xpacketBytes
xpacketEncodingback to summary
private String xpacketEncoding
xpacketEndDataback to summary
private String xpacketEndData
xpacketIdback to summary
private String xpacketId

Constructor Detail

XMPMetadataback to summary
protected XMPMetadata()

Constructor of an empty default XMPMetaData.

XMPMetadataback to summary
protected XMPMetadata(String xpacketBegin, String xpacketId, String xpacketBytes, String xpacketEncoding)

Creates blank XMP doc with specified parameters.

Parameters
xpacketBegin:String

Value of xpacketBegin

xpacketId:String

Value of xpacketId

xpacketBytes:String

Value of xpacketBytes

xpacketEncoding:String

Value of xpacket encoding

Method Detail

addSchemaback to summary
public void addSchema(XMPSchema obj)

Add a schema to the current structure.

Parameters
obj:XMPSchema

the schema to add

clearSchemasback to summary
public void clearSchemas()

Removes all schemas defined.

createAndAddAdobePDFSchemaback to summary
public AdobePDFSchema createAndAddAdobePDFSchema()

Create and add an Adobe PDF schema to this metadata. This method return the created schema to enter information

Returns:AdobePDFSchema

schema added in order to work on it

createAndAddBasicJobTicketSchemaback to summary
public XMPBasicJobTicketSchema createAndAddBasicJobTicketSchema()

Create and add a default Basic Job Ticket schema to this metadata. This method return the created schema to enter information.

Returns:XMPBasicJobTicketSchema

schema added in order to work on it.

createAndAddDefaultSchemaback to summary
public XMPSchema createAndAddDefaultSchema(String nsPrefix, String nsURI)

Create and add an unspecified schema.

Parameters
nsPrefix:String

The prefix wanted for the schema

nsURI:String

The namespace URI wanted for the schema

Returns:XMPSchema

The schema added in order to work on it

createAndAddDublinCoreSchemaback to summary
public DublinCoreSchema createAndAddDublinCoreSchema()

Create and add a default Dublin Core schema to this metadata. This method return the created schema to enter information

Returns:DublinCoreSchema

schema added in order to work on it

createAndAddPDFAExtensionSchemaWithDefaultNSback to summary
public PDFAExtensionSchema createAndAddPDFAExtensionSchemaWithDefaultNS()

Create and add a default PDFA Extension schema to this metadata. This method return the created schema to enter information. This PDFAExtension is created with all default namespaces used in PDFAExtensionSchema.

Returns:PDFAExtensionSchema

PDFAExtension schema added in order to work on it

createAndAddPDFAExtensionSchemaWithNSback to summary
public PDFAExtensionSchema createAndAddPDFAExtensionSchemaWithNS(Map<String, String> namespaces) throws XmpSchemaException

Create and add a default PDFA Extension schema to this metadata. This method return the created schema to enter information. This PDFAExtension is created with specified list of namespaces.

Parameters
namespaces:Map<String, String>

Special namespaces list to use

Returns:PDFAExtensionSchema

schema added in order to work on it

Exceptions
XmpSchemaException:
If namespaces list not contains PDF/A Extension namespace URI
createAndAddPDFAIdentificationSchemaback to summary
public PDFAIdentificationSchema createAndAddPDFAIdentificationSchema()

Create and add a default PDFA Identification schema to this metadata. This method return the created schema to enter information.

Returns:PDFAIdentificationSchema

schema added in order to work on it

createAndAddPhotoshopSchemaback to summary
public PhotoshopSchema createAndAddPhotoshopSchema()

Create and add Photoshop Schema to this metadata. This method return the created schema to enter information

Returns:PhotoshopSchema

schema added in order to work on it

createAndAddXMPBasicSchemaback to summary
public XMPBasicSchema createAndAddXMPBasicSchema()

Create and add a XMP Basic schema to this metadata. This method return the created schema to enter information

Returns:XMPBasicSchema

schema added in order to work on it

createAndAddXMPMediaManagementSchemaback to summary
public XMPMediaManagementSchema createAndAddXMPMediaManagementSchema()

Create and add a XMP Media Management schema to this metadata. This method return the created schema to enter information

Returns:XMPMediaManagementSchema

schema added in order to work on it

createAndAddXMPRightsManagementSchemaback to summary
public XMPRightsManagementSchema createAndAddXMPRightsManagementSchema()

Create and add a default XMP Rights Management Schema to this metadata. This method return the created schema to enter information.

Returns:XMPRightsManagementSchema

schema added in order to work on it

createXMPMetadataback to summary
public static XMPMetadata createXMPMetadata()

Creates blank XMP doc with default parameters.

Returns:XMPMetadata

the XMPMetadata created.

createXMPMetadataback to summary
public static XMPMetadata createXMPMetadata(String xpacketBegin, String xpacketId, String xpacketBytes, String xpacketEncoding)

Creates blank XMP doc with specified parameters.

Parameters
xpacketBegin:String

Value of xpacketBegin

xpacketId:String

Value of xpacketId

xpacketBytes:String

Value of xpacketBytes

xpacketEncoding:String

Value of xpacket encoding

Returns:XMPMetadata

the XMPMetadata created.

getAdobePDFSchemaback to summary
public AdobePDFSchema getAdobePDFSchema()

Get the Adobe PDF schema. This method return null if not found

Returns:AdobePDFSchema

The AdobePDFSchema schema or null if not declared

getAllSchemasback to summary
public List<XMPSchema> getAllSchemas()

Get all Schemas declared in this metadata representation.

Returns:List<XMPSchema>

List of declared schemas

getBasicJobTicketSchemaback to summary
public XMPBasicJobTicketSchema getBasicJobTicketSchema()

Get the Basic Job Ticket Schema. This method return null if not found

Returns:XMPBasicJobTicketSchema

The XMPBasicJobTicketSchema schema or null if not declared.

getDublinCoreSchemaback to summary
public DublinCoreSchema getDublinCoreSchema()

Get the Dublin Core schema. This method return null if not found

Returns:DublinCoreSchema

The DublinCoreSchema schema or null if not declared.

getEndXPacketback to summary
public String getEndXPacket()

get XPACKET END PI.

Returns:String

XPACKET END Value

getPDFAIdentificationSchemaback to summary
public PDFAIdentificationSchema getPDFAIdentificationSchema()

Get the PDFA Identification schema. This method return null if not found.

Returns:PDFAIdentificationSchema

The PDFAIdentificationSchema schema or null if not declared

getPDFExtensionSchemaback to summary
public PDFAExtensionSchema getPDFExtensionSchema()

Get the PDFA Extension schema. This method return null if not found.

Returns:PDFAExtensionSchema

The PDFAExtension schema or null if not declared

getPhotoshopSchemaback to summary
public PhotoshopSchema getPhotoshopSchema()

Get the Photoshop schema. This method return null if not found

Returns:PhotoshopSchema

The PhotoshopSchema schema or null if not declared

getSchemaback to summary
public XMPSchema getSchema(String nsURI)

Get the XMPSchema for the specified namespace. Return the schema corresponding to this nsURI
BE CAREFUL: typically, Metadata should contain one schema for each type. This method returns the first schema encountered corresponding to this NSURI.
Return null if unknown

Parameters
nsURI:String

The namespace URI corresponding to the schema wanted

Returns:XMPSchema

The matching XMP schema representation

getSchemaback to summary
public XMPSchema getSchema(Class<? extends XMPSchema> clz)

Get the XMPSchema for the specified Class. Return the schema corresponding to this Class
BE CAREFUL: typically, Metadata should contain one schema for each type. This method returns the first schema encountered corresponding to this Class.
Return null if unknown

Parameters
clz:Class<? extends XMPSchema>

The Class corresponding to the schema wanted

Returns:XMPSchema

The matching XMP schema representation

getSchemaback to summary
public XMPSchema getSchema(String prefix, String nsURI)

Return the schema corresponding to this nsURI and a prefix. This method is here to treat metadata which embed more than one time the same schema. It permits to retrieve a specific schema with its prefix

Parameters
prefix:String

The prefix fixed in the schema wanted

nsURI:String

The namespace URI corresponding to the schema wanted

Returns:XMPSchema

The Class Schema representation

getTypeMappingback to summary
public TypeMapping getTypeMapping()

Get TypeMapping.

Returns:TypeMapping

the defined TypeMapping.

getXMPBasicSchemaback to summary
public XMPBasicSchema getXMPBasicSchema()

Get the XMP Basic schema. This method return null if not found

Returns:XMPBasicSchema

The XMPBasicSchema schema or null if not declared

getXMPMediaManagementSchemaback to summary
public XMPMediaManagementSchema getXMPMediaManagementSchema()

Get the XMP Media Management schema. This method return null if not found

Returns:XMPMediaManagementSchema

The XMPMediaManagementSchema schema or null if not declared

getXMPRightsManagementSchemaback to summary
public XMPRightsManagementSchema getXMPRightsManagementSchema()

Get the XMP Rights Management Schema. This method return null if not found.

Returns:XMPRightsManagementSchema

The XMPRightsManagementSchema schema or null if not declared

getXpacketBeginback to summary
public String getXpacketBegin()

Get xpacket Begin.

Returns:String

value of xpacket Begin field

getXpacketBytesback to summary
public String getXpacketBytes()

Get xpacketBytes.

Returns:String

value of xpacketBytes field

getXpacketEncodingback to summary
public String getXpacketEncoding()

Get xpacket encoding.

Returns:String

value of xpacket Encoding field

getXpacketIdback to summary
public String getXpacketId()

Get xpacket Id.

Returns:String

value of xpacket Id field

removeSchemaback to summary
public void removeSchema(XMPSchema schema)

Remove a schema.

Parameters
schema:XMPSchema

The schema to remove

setEndXPacketback to summary
public void setEndXPacket(String data)

Set special XPACKET END PI.

Parameters
data:String

The XPacket End value