|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wink.common.model.atom.AtomCommonAttributes
org.apache.wink.common.model.atom.AtomText
public class AtomText
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> < </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 |
|---|
protected java.util.List<java.lang.Object> any
protected AtomTextType type
| Constructor Detail |
|---|
public AtomText()
public AtomText(java.lang.String value)
value - the TEXT value
public AtomText(java.lang.String value,
AtomTextType type)
value - type - public AtomText(SyndText value)
| Method Detail |
|---|
public SyndText toSynd(SyndText value)
public void setValue(java.lang.String value)
public java.lang.String getValue()
public AtomTextType getType()
AtomTextTypepublic void setType(AtomTextType type)
value - allowed object is AtomTextType
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||