JXTA

net.jxta.document
Interface StructuredDocumentFactory.Instantiator

All Known Subinterfaces:
StructuredDocumentFactory.TextInstantiator
Enclosing class:
StructuredDocumentFactory

public static interface StructuredDocumentFactory.Instantiator

Interface for instantiators of StructuredDocuments


Nested Class Summary
static class StructuredDocumentFactory.Instantiator.ExtensionMapping
          For mapping between extensions and MIME types.
 
Method Summary
 StructuredDocumentFactory.Instantiator.ExtensionMapping[] getSupportedFileExtensions()
          Returns the mapping of file extension and mime-types for this type of document.
 MimeMediaType[] getSupportedMimeTypes()
          Returns the MIME Media types supported by this this Document per IETF RFC 2046 MIME : Media Types.
 StructuredDocument newInstance(MimeMediaType mimeType, InputStream source)
          Create a structured document from a stream containing an appropriately serialized instance of the same document.
 StructuredDocument newInstance(MimeMediaType mimeType, String doctype)
          Create a new structured document of the type specified by doctype.
 StructuredDocument newInstance(MimeMediaType mimeType, String doctype, String value)
          Create a new structured document of the type specified by doctype.
 

Method Detail

getSupportedMimeTypes

MimeMediaType[] getSupportedMimeTypes()
Returns the MIME Media types supported by this this Document per IETF RFC 2046 MIME : Media Types.

JXTA does not currently support the 'Multipart' or 'Message' media types.

Returns:
An array of MimeMediaType objects containing the MIME Media Type for this Document.

getSupportedFileExtensions

StructuredDocumentFactory.Instantiator.ExtensionMapping[] getSupportedFileExtensions()
Returns the mapping of file extension and mime-types for this type of document. The default extension is mapped to the 'null' mime-type and should only be used if no other mapping matches.

Returns:
An array of objects containing file extensions

newInstance

StructuredDocument newInstance(MimeMediaType mimeType,
                               String doctype)
Create a new structured document of the type specified by doctype.

Parameters:
mimeType - The MIME type to be associated with this instance. the base type must be one of the types returned by getSupportedMimeTypes. Some implementations may accept parameters in the params section of the MIME type.
doctype - Type for the base node of the document.
Returns:
StructuredDocument instance.

newInstance

StructuredDocument newInstance(MimeMediaType mimeType,
                               String doctype,
                               String value)
Create a new structured document of the type specified by doctype.

Parameters:
mimeType - The MIME type to be associated with this instance. The base type must be one of the types returned by getSupportedMimeTypes. Some implementations may accept parameters in the params section of the MIME type.
doctype - Type for the base node of the document.
value - Value for the base node of the document.
Returns:
StructuredDocument instance.

newInstance

StructuredDocument newInstance(MimeMediaType mimeType,
                               InputStream source)
                               throws IOException
Create a structured document from a stream containing an appropriately serialized instance of the same document.

Parameters:
mimeType - The MIME type to be associated with this instance. The base type must be one of the types returned by getSupportedMimeTypes. Some implementations may accept parameters in the params section of the MIME type.
source - The Inputstream from which to read the document.
Returns:
StructuredDocument instance.
Throws:
IOException - Thrown for problems reading from the source.

JXSE