|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.document.PlainTextElement
net.jxta.impl.document.PlainTextDocument
public class PlainTextDocument
This class is an implementation of the StructuredDocument interface using simple text
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 | |
---|---|
PlainTextElement |
createElement(Object key)
Create a new element without value. |
PlainTextElement |
createElement(Object key,
Object val)
Create a new element with value. |
PlainTextElement |
createElement(String name)
Create a new element without value. |
PlainTextElement |
createElement(String name,
String val)
Create a new element with value. |
String |
getFileExtension()
Returns the file extension type used by this Document . |
MimeMediaType |
getMimeType()
get Type |
Reader |
getReader()
Returns the sequence of characters which represents the content of the TextDocument . |
InputStream |
getStream()
Returns the stream of bytes which represents the content of this Document . |
void |
sendToStream(OutputStream stream)
Send the contents of this Document to the specified stream. |
void |
sendToWriter(Writer stream)
Send the contents of this TextDocument to the specified
Writer. |
String |
toString()
|
Methods inherited from class net.jxta.impl.document.PlainTextElement |
---|
addAttribute, addAttribute, appendChild, equals, getAttribute, getAttributes, getChildren, getChildren, getChildren, getKey, getName, getParent, getRoot, getTextValue, getValue, printNice |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.jxta.document.TextElement |
---|
getChildren, getKey, getName, getRoot, getTextValue, getValue |
Methods inherited from interface net.jxta.document.Element |
---|
appendChild, getChildren, getChildren, getParent |
Field Detail |
---|
public static final StructuredDocumentFactory.TextInstantiator INSTANTIATOR
Constructor Detail |
---|
public PlainTextDocument(MimeMediaType mimeType, String type)
public PlainTextDocument(MimeMediaType mimeType, String type, String value)
Method Detail |
---|
public String toString()
toString
in class Object
public MimeMediaType getMimeType()
getMimeType
in interface Document
Document
.public String getFileExtension()
Document
. This
value is usually chosen based upon the MIME Media Type.
getFileExtension
in interface Document
Document
.public PlainTextElement createElement(Object key)
createElement
in interface StructuredDocument<PlainTextElement>
key
- The key of the element to be created.
public PlainTextElement createElement(Object key, Object val)
createElement
in interface StructuredDocument<PlainTextElement>
key
- The name of the element to be created.val
- The value of the element to be created or
null
if no value is desired.
public PlainTextElement createElement(String name)
createElement
in interface StructuredTextDocument<PlainTextElement>
name
- The name of the element to be created.
public PlainTextElement createElement(String name, String val)
createElement
in interface StructuredTextDocument<PlainTextElement>
name
- The name of the element to be created.val
- The value of the element to be created.
public InputStream getStream() throws IOException
Document
.
getStream
in interface DocumentStreamIO
InputStream
containing the bytes
of this Document
.
IOException
- For errors while writing the Document
.public void sendToStream(OutputStream stream) throws IOException
Document
to the specified stream.
sendToStream
in interface DocumentStreamIO
stream
- The OutputStream to which the Document
will
be written.
IOException
- For errors while writing the Document
.public Reader getReader()
TextDocument
.
getReader
in interface TextDocumentReaderIO
Reader
containing the characters of the
TextDocument
.public void sendToWriter(Writer stream) throws IOException
TextDocument
to the specified
Writer.
sendToWriter
in interface TextDocumentReaderIO
stream
- The Writer
to which the characters of the
TextDocument
will be written.
IOException
- If an I/O error occurs.
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |