Project JXTA

net.jxta.endpoint
Class NewTextMessageElement

java.lang.Object
  |
  +--net.jxta.endpoint.NewMessageElement
        |
        +--net.jxta.endpoint.NewTextMessageElement
All Implemented Interfaces:
java.lang.Cloneable, Document, TextDocument
Direct Known Subclasses:
NewStringMessageElement

Deprecated. Though new to this release, this class will be disappearing in the next stable release. Do not write code which imports this class!

public abstract class NewTextMessageElement
extends NewMessageElement
implements java.lang.Cloneable, TextDocument

An extension of NewMessageElement for managing elements that are composed of character text. (as opposed to raw bytes).


Fields inherited from class net.jxta.endpoint.NewMessageElement
name, properties, sig, type
 
Constructor Summary
protected NewTextMessageElement(java.lang.String name, MimeMediaType type, NewMessageElement sig)
          Deprecated. Internal constructor for initializaing everything but the data.
 
Method Summary
abstract  long getCharLength()
          Deprecated. Returns the size of the element data in characters
 java.lang.String getFileExtension()
          Deprecated. Return the file extension to use for this document.
abstract  java.io.Reader getReader()
          Deprecated. Returns a character reader containing the element character data.
 void sendToWriter(java.io.Writer sendTo)
          Deprecated. Sends the element character data to the specified character writer.
 
Methods inherited from class net.jxta.endpoint.NewMessageElement
clone, equals, getByteLength, getMessageProperty, getMimeType, getName, getSequentialName, getSignature, getStream, getUniqueName, sendToStream, setMessageProperty, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.jxta.document.Document
getMimeType, getStream, sendToStream
 

Constructor Detail

NewTextMessageElement

protected NewTextMessageElement(java.lang.String name,
                                MimeMediaType type,
                                NewMessageElement sig)
Deprecated. 
Internal constructor for initializaing everything but the data.
Parameters:
name - Name of the Element. May be the empty string ("") if the Element is not named.
type - Type of the Element. null is equivalent to specifying the type "Application/Octet-stream"
sig - optional message digest/digital signature elemnent. If no signature is to be specified, pass null.
Since:
JXTA 1.0
Method Detail

getFileExtension

public java.lang.String getFileExtension()
Deprecated. 
Return the file extension to use for this document. We use the "text" extension and leave it to sub-classes to extend this. if we had a mailcap facility we could do better classification based on mimetype.
Specified by:
getFileExtension in interface Document
Overrides:
getFileExtension in class NewMessageElement
Following copied from interface: net.jxta.document.Document
Returns:
a string containing an appropriate file extension

getCharLength

public abstract long getCharLength()
Deprecated. 
Returns the size of the element data in characters
Returns:
long containing the size of the element data.
Since:
JXTA 1.0

getReader

public abstract java.io.Reader getReader()
                                  throws java.io.IOException
Deprecated. 
Returns a character reader containing the element character data.
Specified by:
getReader in interface TextDocument
Returns:
Reader of the stream containing element character data.
Throws:
java.io.IOException - if there is a problem getting the stream
Since:
JXTA 1.0

sendToWriter

public void sendToWriter(java.io.Writer sendTo)
                  throws java.io.IOException
Deprecated. 
Sends the element character data to the specified character writer.
Specified by:
sendToWriter in interface TextDocument
Parameters:
sendTo - the output stream to send the data to.
Throws:
java.io.IOException - if there is a problem sending the data to the specified stream
Since:
JXTA 1.0

Project JXTA