Project JXTA

net.jxta.impl.document
Class PlainTextDocument

java.lang.Object
  extended by net.jxta.impl.document.TextElementCommon
      extended by net.jxta.impl.document.PlainTextElement
          extended by net.jxta.impl.document.PlainTextDocument
All Implemented Interfaces:
Attributable, Document, Element, StructuredDocument, StructuredTextDocument, TextDocument, TextElement, TextDocumentCommon

public class PlainTextDocument
extends PlainTextElement
implements TextDocumentCommon

This class is an implementation of the StructuredDocument interface using simple text


Nested Class Summary
 
Nested classes/interfaces inherited from interface net.jxta.impl.document.TextDocumentCommon
TextDocumentCommon.Utils
 
Field Summary
static StructuredDocumentFactory.TextInstantiator INSTANTIATOR
           
 
Fields inherited from class net.jxta.impl.document.PlainTextElement
doc, name, parent, val
 
Constructor Summary
PlainTextDocument(MimeMediaType mimeType, String type)
          Creates new PlainTextDocument
PlainTextDocument(MimeMediaType mimeType, String type, String value)
          Creates new PlainTextDocument with a value for the root element
 
Method Summary
 Element createElement(Object key)
          
 Element createElement(Object key, Object val)
          
 TextElement createElement(String name)
          
 TextElement createElement(String name, String val)
          
 String getFileExtension()
          
 MimeMediaType getMimeType()
          get Type
 Reader getReader()
          
 InputStream getStream()
          
 void sendToStream(OutputStream stream)
          
 void sendToWriter(Writer stream)
          
 String toString()
          
 
Methods inherited from class net.jxta.impl.document.PlainTextElement
addAttribute, addAttribute, appendChild, equals, getAttribute, getAttributes, getChildren, getChildren, getName, getParent, getRoot, getTextValue, printNice
 
Methods inherited from class net.jxta.impl.document.TextElementCommon
appendChild, getChildren, getKey, getValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.jxta.document.Element
appendChild, getChildren, getChildren, getKey, getParent, getRoot, getValue
 
Methods inherited from interface net.jxta.document.TextElement
appendChild, getChildren, getName, getTextValue
 
Methods inherited from interface net.jxta.document.Element
appendChild, getChildren, getChildren, getKey, getParent, getRoot, getValue
 

Field Detail

INSTANTIATOR

public static final StructuredDocumentFactory.TextInstantiator INSTANTIATOR
Constructor Detail

PlainTextDocument

public PlainTextDocument(MimeMediaType mimeType,
                         String type)
Creates new PlainTextDocument


PlainTextDocument

public PlainTextDocument(MimeMediaType mimeType,
                         String type,
                         String value)
Creates new PlainTextDocument with a value for the root element

Method Detail

toString

public String toString()

Specified by:
toString in interface TextDocument
Overrides:
toString in class Object

getMimeType

public MimeMediaType getMimeType()
get Type

Specified by:
getMimeType in interface Document

getFileExtension

public String getFileExtension()

Specified by:
getFileExtension in interface Document

createElement

public Element createElement(Object key)

Specified by:
createElement in interface StructuredDocument

createElement

public Element createElement(Object key,
                             Object val)

Specified by:
createElement in interface StructuredDocument

createElement

public TextElement createElement(String name)

Specified by:
createElement in interface StructuredTextDocument

createElement

public TextElement createElement(String name,
                                 String val)

Specified by:
createElement in interface StructuredTextDocument

getStream

public InputStream getStream()
                      throws IOException

Specified by:
getStream in interface Document
Throws:
IOException

sendToStream

public void sendToStream(OutputStream stream)
                  throws IOException

Specified by:
sendToStream in interface Document
Throws:
IOException

getReader

public Reader getReader()

Specified by:
getReader in interface TextDocument

sendToWriter

public void sendToWriter(Writer stream)
                  throws IOException

Specified by:
sendToWriter in interface TextDocument
Throws:
IOException

JXTA J2SE