|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jempbox.xmp.XMPMetadata
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 | |
static String |
ENCODING_UTF16BE
Supported encoding for persisted XML. |
static String |
ENCODING_UTF16LE
Supported encoding for persisted XML. |
static String |
ENCODING_UTF8
Supported encoding for persisted XML. |
protected Document |
xmpDocument
The DOM representation of the metadata. |
Constructor Summary | |
XMPMetadata()
Default constructor, creates blank XMP doc. |
|
XMPMetadata(Document doc)
Constructor from an existing XML document. |
Method Summary | |
XMPSchemaBasic |
addBasicSchema()
Create and add a new Basic Schema to this metadata. |
XMPSchemaDublinCore |
addDublinCoreSchema()
Create and add a new Dublin Core Schema to this metadata. |
XMPSchemaPDF |
addPDFSchema()
Create and add a new PDF Schema to this metadata. |
String |
getEncoding()
Get the current encoding that will be used to write the XML. |
List |
getSchemas()
This will get a list of XMPSchema(or subclass) objects. |
Document |
getXMPDocument()
Get the XML document from this object. |
static XMPMetadata |
load(InputStream is)
Load metadata from the filesystem. |
static XMPMetadata |
load(String file)
Load metadata from the filesystem. |
static void |
main(String[] args)
Test main program. |
void |
save(String file)
Save the XMP document to a file. |
void |
setEncoding(String xmlEncoding)
The encoding used to write the XML. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String ENCODING_UTF8
public static final String ENCODING_UTF16BE
public static final String ENCODING_UTF16LE
protected Document xmpDocument
Constructor Detail |
public XMPMetadata() throws IOException
IOException
- If there is an error creating the initial document.public XMPMetadata(Document doc)
doc
- The root XMP document.Method Detail |
public void save(String file) throws Exception
file
- The file to save the XMP document to.
Exception
- If there is an error while writing to the stream.public Document getXMPDocument()
public XMPSchemaPDF addPDFSchema()
public XMPSchemaDublinCore addDublinCoreSchema()
public XMPSchemaBasic addBasicSchema()
public void setEncoding(String xmlEncoding)
xmlEncoding
- The encoding to write the XML as.public String getEncoding()
public static XMPMetadata load(String file) throws IOException
file
- The file to load the metadata from.
IOException
- If there is an error reading the data.public static XMPMetadata load(InputStream is) throws IOException
is
- The stream to load the data from.
IOException
- If there is an error reading the data.public static void main(String[] args) throws Exception
args
- The command line arguments.
Exception
- If there is an error.public List getSchemas() throws IOException
IOException
- If there is an error creating a specific schema.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |