org.restlet.ext.atom
Class Text

java.lang.Object
  extended by org.restlet.ext.atom.Text

public class Text
extends Object

A Text construct contains human-readable text, usually in small quantities. The content of Text constructs is Language-Sensitive.

Author:
Jerome Louvel

Constructor Summary
Text(MediaType type)
          Constructor.
Text(MediaType type, String content)
          Constructor.
Text(String content)
          Constructor.
 
Method Summary
 String getContent()
          Returns the content.
 MediaType getType()
          Returns the content type.
 void setContent(String content)
          Sets the content.
 void setType(MediaType type)
          Sets the content type.
 String toString()
           
static void writeElement(XmlWriter writer, Date date, String namespace, String localName)
          Writes the current object as an XML element using the given SAX writer.
 void writeElement(XmlWriter writer, String localName)
          Writes the current object as an XML element using the given SAX writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Text

public Text(MediaType type)
Constructor.

Parameters:
type - The content type.

Text

public Text(MediaType type,
            String content)
Constructor.

Parameters:
type - The content type.
content - The content.

Text

public Text(String content)
Constructor.

Parameters:
content - The content.
Method Detail

writeElement

public static void writeElement(XmlWriter writer,
                                Date date,
                                String namespace,
                                String localName)
                         throws SAXException
Writes the current object as an XML element using the given SAX writer.

Parameters:
writer - The SAX writer.
namespace - The element namespace URI.
localName - The local name of the element.
Throws:
SAXException

getContent

public String getContent()
Returns the content.

Returns:
The content.

getType

public MediaType getType()
Returns the content type.

Returns:
The content type.

setContent

public void setContent(String content)
Sets the content.

Parameters:
content - The content.

setType

public void setType(MediaType type)
Sets the content type.

Parameters:
type - The content type.

toString

public String toString()
Overrides:
toString in class Object

writeElement

public void writeElement(XmlWriter writer,
                         String localName)
                  throws SAXException
Writes the current object as an XML element using the given SAX writer.

Parameters:
writer - The SAX writer.
localName - The local name of the element.
Throws:
SAXException


Copyright © 2005-2013 Restlet.