Class XMPMetaFactory
Creates XMPMeta
-instances from an InputStream
public sealed class XMPMetaFactory
- Inheritance
-
XMPMetaFactory
- Inherited Members
Methods
Create()
public static XMPMeta Create()
Returns
- XMPMeta
Returns an empty
XMPMeta
-object.
GetSchemaRegistry()
public static XMPSchemaRegistry GetSchemaRegistry()
Returns
- XMPSchemaRegistry
Returns the singleton instance of the
XMPSchemaRegistry
.
GetVersionInfo()
Obtain version information.
public static XMPVersionInfo GetVersionInfo()
Returns
- XMPVersionInfo
Returns the version information.
Remarks
Obtain version information. The XMPVersionInfo singleton is created the first time its requested.
Parse(Stream)
Parsing with default options.
public static XMPMeta Parse(Stream @in)
Parameters
in
Streaman
InputStream
Returns
- XMPMeta
Returns the
XMPMeta
-object created from the input.
- See Also
Parse(Stream, ParseOptions)
These functions support parsing serialized RDF into an XMP object, and serailizing an XMP object into RDF.
public static XMPMeta Parse(Stream @in, ParseOptions options)
Parameters
in
Streaman
InputStream
options
ParseOptionsOptions controlling the parsing.
The available options are:- XMP_REQUIRE_XMPMETA - The <x:xmpmeta> XML element is required around <rdf:RDF>.
- XMP_STRICT_ALIASING - Do not reconcile alias differences, throw an exception.
Returns
- XMPMeta
Returns the
XMPMeta
-object created from the input.
Remarks
These functions support parsing serialized RDF into an XMP object, and serailizing an XMP
object into RDF. The input for parsing may be any valid Unicode
encoding. ISO Latin-1 is also recognized, but its use is strongly discouraged. Serialization
is always as UTF-8.
parseFromBuffer()
parses RDF from an InputStream
. The encoding
is recognized automatically.
ParseFromBuffer(byte[])
Parsing with default options.
public static XMPMeta ParseFromBuffer(byte[] buffer)
Parameters
buffer
byte[]a String contain an XMP-file.
Returns
- XMPMeta
Returns the
XMPMeta
-object created from the input.
- See Also
ParseFromBuffer(byte[], ParseOptions)
Creates an XMPMeta
-object from a byte-buffer.
public static XMPMeta ParseFromBuffer(byte[] buffer, ParseOptions options)
Parameters
buffer
byte[]a String contain an XMP-file.
options
ParseOptionsOptions controlling the parsing.
Returns
- XMPMeta
Returns the
XMPMeta
-object created from the input.
- See Also
ParseFromString(string)
Parsing with default options.
public static XMPMeta ParseFromString(string packet)
Parameters
packet
stringa String contain an XMP-file.
Returns
- XMPMeta
Returns the
XMPMeta
-object created from the input.
- See Also
ParseFromString(string, ParseOptions)
Creates an XMPMeta
-object from a string.
public static XMPMeta ParseFromString(string packet, ParseOptions options)
Parameters
packet
stringa String contain an XMP-file.
options
ParseOptionsOptions controlling the parsing.
Returns
- XMPMeta
Returns the
XMPMeta
-object created from the input.
- See Also
Reset()
Resets the schema registry to its original state (creates a new one).
public static void Reset()
Remarks
Resets the schema registry to its original state (creates a new one). Be careful this might break all existing XMPMeta-objects and should be used only for testing purpurses.
Serialize(XMPMeta, Stream)
Serializes an XMPMeta
-object as RDF into an OutputStream
with default options.
public static void Serialize(XMPMeta xmp, Stream @out)
Parameters
Serialize(XMPMeta, Stream, SerializeOptions)
Serializes an XMPMeta
-object as RDF into an OutputStream
.
public static void Serialize(XMPMeta xmp, Stream @out, SerializeOptions options)
Parameters
xmp
XMPMetaa metadata object
out
Streaman
OutputStream
to write the serialized RDF to.options
SerializeOptionsOptions to control the serialization (see SerializeOptions ).
SerializeToBuffer(XMPMeta, SerializeOptions)
Serializes an XMPMeta
-object as RDF into a byte buffer.
public static byte[] SerializeToBuffer(XMPMeta xmp, SerializeOptions options)
Parameters
xmp
XMPMetaa metadata object
options
SerializeOptionsOptions to control the serialization (see SerializeOptions ).
Returns
- byte[]
Returns a byte buffer containing the serialized RDF.
SerializeToString(XMPMeta, SerializeOptions)
Serializes an XMPMeta
-object as RDF into a string.
public static string SerializeToString(XMPMeta xmp, SerializeOptions options)
Parameters
xmp
XMPMetaa metadata object
options
SerializeOptionsOptions to control the serialization (see SerializeOptions ).
Returns
- string
Returns a string containing the serialized RDF.
Remarks
Serializes an XMPMeta
-object as RDF into a string. Note: Encoding
is ignored when serializing to a string.