org.apache.oodt.cas.metadata
Class SerializableMetadata

java.lang.Object
  extended by org.apache.oodt.cas.metadata.Metadata
      extended by org.apache.oodt.cas.metadata.SerializableMetadata
All Implemented Interfaces:
Serializable

public class SerializableMetadata
extends Metadata
implements Serializable

Version:
$Revision$

Metadata that's Serializable.

.
Author:
mattmann, bfoster
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.oodt.cas.metadata.Metadata
Metadata.Group
 
Constructor Summary
SerializableMetadata()
           
SerializableMetadata(InputStream inputStream)
           
SerializableMetadata(InputStream inputStream, String xmlEncoding, boolean useCDATA)
           
SerializableMetadata(Metadata metadata)
           
SerializableMetadata(Metadata metadata, String xmlEncoding, boolean useCDATA)
          Builds a SerializableMetadata object from a Metadata object
SerializableMetadata(String xmlEncoding, boolean useCDATA)
          Accepts any encoding which is supported by java.net.URLEncoder If useCDATA is set true then element text will be wrapped in a CDATA tag.
 
Method Summary
 String getEncoding()
           
 Metadata getMetadata()
          Converts SerializableMetadata into a plain metadata object
 boolean isUsingCDATA()
           
 void loadMetadataFromXmlStream(InputStream in)
          Reloads this SerializableMetadata from an InputStream in the format created by writeMetadataToXmlStream(OutputStream).
 Document toXML()
           
 void writeMetadataToXmlStream(OutputStream os)
          Writes out this SerializableMetadata object in XML format to the OutputStream provided
 
Methods inherited from class org.apache.oodt.cas.metadata.Metadata
addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, addMetadata, containsGroup, containsKey, createNewRoot, equals, getAllKeys, getAllKeys, getAllKeys, getAllKeysWithName, getAllMetadata, getAllValues, getAllValues, getGroup, getGroup, getGroups, getGroups, getGroups, getHashtable, getKeys, getKeys, getKeys, getMetadata, getSubMetadata, getValues, getValues, isMultiValued, removeMetadata, removeMetadataGroup, replaceMetadata, replaceMetadata, replaceMetadata, replaceMetadata, replaceMetadata
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializableMetadata

public SerializableMetadata()

SerializableMetadata

public SerializableMetadata(String xmlEncoding,
                            boolean useCDATA)
                     throws InstantiationException
Accepts any encoding which is supported by java.net.URLEncoder If useCDATA is set true then element text will be wrapped in a CDATA tag.

Parameters:
xmlEncoding - The encoding to use when generating XML version of a SerializableMetadata
useCDATA - whether or not to use CDATA tags around an element's text.
Throws:
InstantiationException - if xmlEncoding equals null

SerializableMetadata

public SerializableMetadata(Metadata metadata)

SerializableMetadata

public SerializableMetadata(InputStream inputStream)
                     throws IOException
Throws:
IOException

SerializableMetadata

public SerializableMetadata(InputStream inputStream,
                            String xmlEncoding,
                            boolean useCDATA)
                     throws IOException
Throws:
IOException

SerializableMetadata

public SerializableMetadata(Metadata metadata,
                            String xmlEncoding,
                            boolean useCDATA)
Builds a SerializableMetadata object from a Metadata object

Parameters:
metadata -
xmlEncoding -
Method Detail

getEncoding

public String getEncoding()

isUsingCDATA

public boolean isUsingCDATA()

writeMetadataToXmlStream

public void writeMetadataToXmlStream(OutputStream os)
                              throws IOException
Writes out this SerializableMetadata object in XML format to the OutputStream provided

Parameters:
os - The OutputStream this method writes to
Throws:
IOException - for any Exception

toXML

public Document toXML()
               throws IOException
Throws:
IOException

loadMetadataFromXmlStream

public void loadMetadataFromXmlStream(InputStream in)
                               throws IOException
Reloads this SerializableMetadata from an InputStream in the format created by writeMetadataToXmlStream(OutputStream).

Parameters:
in - The InputStream which this object is loaded from
Throws:
IOException - for any exception

getMetadata

public Metadata getMetadata()
Converts SerializableMetadata into a plain metadata object

Returns:
Metadata object with the same metadata that this SerializableMetadata contains


Copyright © 1999-2013
Apache OODT. All Rights Reserved.