Google Data APIs Client Library (1.41.1)



com.google.gdata.data
Class HtmlTextConstruct

java.lang.Object
  extended by com.google.gdata.data.TextConstruct
      extended by com.google.gdata.data.HtmlTextConstruct
All Implemented Interfaces:
ITextConstruct

public class HtmlTextConstruct
extends TextConstruct

HTML variant of TextConstruct.


Nested Class Summary
 class HtmlTextConstruct.AtomHandler
          Parses XML in the Atom format.
 
Nested classes/interfaces inherited from class com.google.gdata.data.TextConstruct
TextConstruct.ChildHandlerInfo, TextConstruct.RssFormat, TextConstruct.Type
 
Field Summary
protected  java.lang.String html
          HTML contents.
 
Fields inherited from class com.google.gdata.data.TextConstruct
lang
 
Constructor Summary
HtmlTextConstruct()
          Class constructor.
HtmlTextConstruct(java.lang.String html)
          Class constructor specifying the HTML content for this text construct to contain.
HtmlTextConstruct(java.lang.String html, java.lang.String lang)
          Class constructor specifying the HTML content for this text construct to contain, plus the human language that the text is written in.
 
Method Summary
 void generateAtom(com.google.gdata.util.common.xml.XmlWriter w, java.lang.String elementName)
          Generates XML in the Atom format.
 void generateRss(com.google.gdata.util.common.xml.XmlWriter w, java.lang.String elementName, TextConstruct.RssFormat rssFormat)
          Generates XML in the RSS format.
 java.lang.String getHtml()
           
 java.lang.String getPlainText()
          Returns a plain-text representation of this text construct.
 int getType()
          Returns this text construct's type (text, HTML, or XHTML).
 boolean isEmpty()
          Returns true if this text construct has no contents.
 void setHtml(java.lang.String v)
          Specifies the HTML contents of this text construct.
 
Methods inherited from class com.google.gdata.data.TextConstruct
create, getChildHandler, getLang, html, plainText, setLang, xhtml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

html

protected java.lang.String html
HTML contents.

Constructor Detail

HtmlTextConstruct

public HtmlTextConstruct()
Class constructor.


HtmlTextConstruct

public HtmlTextConstruct(java.lang.String html)
Class constructor specifying the HTML content for this text construct to contain.


HtmlTextConstruct

public HtmlTextConstruct(java.lang.String html,
                         java.lang.String lang)
Class constructor specifying the HTML content for this text construct to contain, plus the human language that the text is written in.

Method Detail

getType

public int getType()
Description copied from class: TextConstruct
Returns this text construct's type (text, HTML, or XHTML).

Specified by:
getType in interface ITextConstruct
Specified by:
getType in class TextConstruct
Returns:
the type (HTML) of this text construct

isEmpty

public boolean isEmpty()
Description copied from class: TextConstruct
Returns true if this text construct has no contents.

Specified by:
isEmpty in class TextConstruct
Returns:
true if this text construct has no contents

getHtml

public java.lang.String getHtml()
Returns:
the HTML contents of this text construct

setHtml

public void setHtml(java.lang.String v)
Specifies the HTML contents of this text construct.


getPlainText

public java.lang.String getPlainText()
Description copied from class: TextConstruct
Returns a plain-text representation of this text construct.

Specified by:
getPlainText in interface ITextConstruct
Specified by:
getPlainText in class TextConstruct
Returns:
a plain-text representation of this text construct or null if there is no html content.

generateAtom

public void generateAtom(com.google.gdata.util.common.xml.XmlWriter w,
                         java.lang.String elementName)
                  throws java.io.IOException
Generates XML in the Atom format.

Specified by:
generateAtom in class TextConstruct
Parameters:
w - output writer
elementName - Atom element name
Throws:
java.io.IOException

generateRss

public void generateRss(com.google.gdata.util.common.xml.XmlWriter w,
                        java.lang.String elementName,
                        TextConstruct.RssFormat rssFormat)
                 throws java.io.IOException
Generates XML in the RSS format.

Specified by:
generateRss in class TextConstruct
Parameters:
w - output writer
elementName - RSS element name
rssFormat - the restrictions on what HTML tags are allowed
Throws:
java.io.IOException