org.apache.wink.common.model.atom
Class AtomText

java.lang.Object
  extended by org.apache.wink.common.model.atom.AtomCommonAttributes
      extended by org.apache.wink.common.model.atom.AtomText

public class AtomText
extends AtomCommonAttributes

Text Construct Per RFC4287

 A Text construct contains human-readable text, usually in small quantities. The content of Text
 constructs is Language-Sensitive.
 
 atomPlainTextConstruct =
       atomCommonAttributes,
       attribute type { "text" | "html" }?,
       text
 
    atomXHTMLTextConstruct =
       atomCommonAttributes,
       attribute type { "xhtml" },
       xhtmlDiv
 
    atomTextConstruct = atomPlainTextConstruct | atomXHTMLTextConstruct
 
 o The "type" Attribute
 
 Text constructs MAY have a "type" attribute. When present, the value MUST be one of "text",
 "html", or "xhtml". If the "type" attribute is not provided, Atom Processors MUST behave as
 though it were present with a value of "text". Unlike the atom:content element defined in Section
 4.1.3, MIME media types [MIMEREG] MUST NOT be used as values for the "type" attribute on Text
 constructs.
 
   o Text
 
     Example atom:title with text content:
 
     ... <title type="text"> Less: < </title> ...
 
     If the value is "text", the content of the Text construct MUST NOT contain child elements. Such
     text is intended to be presented to humans in a readable fashion. Thus, Atom Processors MAY
     collapse white space (including line breaks) and display the text using typographic techniques
     such as justification and proportional fonts.
 
   o HTML
 
     Example atom:title with HTML content:
 
     ... <title type="html"> Less: <em> &lt; </em> </title> ...
 
     If the value of "type" is "html", the content of the Text construct MUST NOT contain child
     elements and SHOULD be suitable for handling as HTML [HTML]. Any markup within MUST be escaped;
     for example, "<br>
     " as "<br>". HTML markup within SHOULD be such that it could validly appear directly within an
     HTML <DIV> element, after unescaping. Atom Processors that display such content MAY use that
     markup to aid in its display.
 
 
   o XHTML
 
     Example atom:title with XHTML content:
 
     ... <title type="xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml"> <xhtml:div> Less: <xhtml:em>
     < </xhtml:em> </xhtml:div> </title> ...
 
     If the value of "type" is "xhtml", the content of the Text construct MUST be a single XHTML div
     element [XHTML] and SHOULD be suitable for handling as XHTML. The XHTML div element itself MUST
     NOT be considered part of the content. Atom Processors that display the content MAY use the
     markup to aid in displaying it. The escaped versions of characters such as "&" and ">" represent
     those characters, not markup.
 
 
     Examples of valid XHTML content:
 
     ... <summary type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> This is <b>XHTML</b>
     content. </div> </summary> ... <summary type="xhtml"> <xhtml:div
     xmlns:xhtml="http://www.w3.org/1999/xhtml"> This is <xhtml:b>XHTML</xhtml:b> content.
     </xhtml:div> </summary> ...
 
     The following example assumes that the XHTML namespace has been bound to the "xh" prefix earlier
     in the document:
 
     ... <summary type="xhtml"> <xh:div> This is <xh:b>XHTML</xh:b> content. </xh:div> </summary> ...
 


Field Summary
protected  java.util.List<java.lang.Object> any
           
protected  AtomTextType type
           
 
Fields inherited from class org.apache.wink.common.model.atom.AtomCommonAttributes
base, lang
 
Constructor Summary
AtomText()
          Create an empty AtomText with no type and no value
AtomText(java.lang.String value)
          Create an AtomText with a type of AtomTextType.TEXT
AtomText(java.lang.String value, AtomTextType type)
          Create an AtomText with the specified value and type
AtomText(SyndText value)
           
 
Method Summary
 AtomTextType getType()
          Gets the value of type.
 java.lang.String getValue()
           
 void setType(AtomTextType type)
          Sets the value of type.
 void setValue(java.lang.String value)
           
 SyndText toSynd(SyndText value)
           
 
Methods inherited from class org.apache.wink.common.model.atom.AtomCommonAttributes
getBase, getLang, getOtherAttributes, setBase, setLang, toSynd
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

any

protected java.util.List<java.lang.Object> any

type

protected AtomTextType type
Constructor Detail

AtomText

public AtomText()
Create an empty AtomText with no type and no value


AtomText

public AtomText(java.lang.String value)
Create an AtomText with a type of AtomTextType.TEXT

Parameters:
value - the TEXT value

AtomText

public AtomText(java.lang.String value,
                AtomTextType type)
Create an AtomText with the specified value and type

Parameters:
value -
type -

AtomText

public AtomText(SyndText value)
Method Detail

toSynd

public SyndText toSynd(SyndText value)

setValue

public void setValue(java.lang.String value)

getValue

public java.lang.String getValue()

getType

public AtomTextType getType()
Gets the value of type.

Returns:
possible object is AtomTextType

setType

public void setType(AtomTextType type)
Sets the value of type.

Parameters:
value - allowed object is AtomTextType


Copyright © 2009 The Apache Software Foundation. All Rights Reserved.