Package org.apache.xmlgraphics.xmp
Class XMPSerializer
- java.lang.Object
-
- org.apache.xmlgraphics.xmp.XMPSerializer
-
public final class XMPSerializer extends java.lang.Object
Serializes an XMP tree to XML or to an XMP packet.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
DEFAULT_ENCODING
-
Constructor Summary
Constructors Modifier Constructor Description private
XMPSerializer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
writeXML(Metadata meta, javax.xml.transform.Result res)
Writes the in-memory representation of the XMP metadata to a JAXP Result.private static void
writeXML(Metadata meta, javax.xml.transform.Result res, boolean asXMPPacket, boolean readOnlyXMP)
static void
writeXMPPacket(Metadata meta, java.io.OutputStream out, boolean readOnlyXMP)
Writes the in-memory representation of the XMP metadata to an OutputStream as an XMP packet.
-
-
-
Field Detail
-
DEFAULT_ENCODING
private static final java.lang.String DEFAULT_ENCODING
- See Also:
- Constant Field Values
-
-
Method Detail
-
writeXML
public static void writeXML(Metadata meta, javax.xml.transform.Result res) throws javax.xml.transform.TransformerConfigurationException, org.xml.sax.SAXException
Writes the in-memory representation of the XMP metadata to a JAXP Result.- Parameters:
meta
- the metadatares
- the JAXP Result to write to- Throws:
javax.xml.transform.TransformerConfigurationException
- if an error occurs setting up the XML infrastructure.org.xml.sax.SAXException
- if a SAX-related problem occurs while writing the XML
-
writeXMPPacket
public static void writeXMPPacket(Metadata meta, java.io.OutputStream out, boolean readOnlyXMP) throws javax.xml.transform.TransformerConfigurationException, org.xml.sax.SAXException
Writes the in-memory representation of the XMP metadata to an OutputStream as an XMP packet.- Parameters:
meta
- the metadataout
- the stream to write toreadOnlyXMP
- true if the generated XMP packet should be read-only- Throws:
javax.xml.transform.TransformerConfigurationException
- if an error occurs setting up the XML infrastructure.org.xml.sax.SAXException
- if a SAX-related problem occurs while writing the XML
-
writeXML
private static void writeXML(Metadata meta, javax.xml.transform.Result res, boolean asXMPPacket, boolean readOnlyXMP) throws javax.xml.transform.TransformerConfigurationException, org.xml.sax.SAXException
- Throws:
javax.xml.transform.TransformerConfigurationException
org.xml.sax.SAXException
-
-