public class Content extends CommonAttributes
Represents an atom:content element.
Per RFC4287:
The "atom:content" element either contains or links to the content of the entry. The content of atom:content is Language-Sensitive. atomInlineTextContent = element atom:content { atomCommonAttributes, attribute type { "text" | "html" }?, (text)* } atomInlineXHTMLContent = element atom:content { atomCommonAttributes, attribute type { "xhtml" }, xhtmlDiv } atomInlineOtherContent = element atom:content { atomCommonAttributes, attribute type { atomMediaType }?, (text|anyElement)* } atomOutOfLineContent = element atom:content { atomCommonAttributes, attribute type { atomMediaType }?, attribute src { atomUri }, empty } atomContent = atomInlineTextContent | atomInlineXHTMLContent | atomInlineOtherContent | atomOutOfLineContent
Modifier and Type | Field and Description |
---|---|
protected JAXBContextFinder |
finder |
Constructor and Description |
---|
Content() |
Modifier and Type | Method and Description |
---|---|
Element |
getElement()
Get content as an XML Element if the content is XML.
|
Object |
getJAXBObject()
Returns previous extracted jaxbobject from a call to getJAXBObject(Class
|
<T> T |
getJAXBObject(Class<T> clazz,
Class... otherPossibleClasses)
Extract the content as the provided JAXB annotated type.
|
String |
getRawType() |
URI |
getSrc() |
String |
getText()
If content is text, return it as a String.
|
MediaType |
getType()
Mime type of the content
|
List<Object> |
getValue() |
void |
setElement(Element element)
Set the content to an XML Element
|
protected void |
setFinder(JAXBContextFinder finder) |
void |
setJAXBObject(Object obj) |
void |
setRawType(String type) |
void |
setSrc(URI src) |
void |
setText(String text)
Set content as text
|
void |
setType(MediaType type) |
void |
setValue(List<Object> value) |
getBase, getExtensionAttributes, getLanguage, setBase, setLanguage
protected JAXBContextFinder finder
protected void setFinder(JAXBContextFinder finder)
public URI getSrc()
public void setSrc(URI src)
public MediaType getType()
public void setType(MediaType type)
public String getRawType()
public void setRawType(String type)
public String getText()
public void setText(String text)
text
- public Element getElement()
public void setElement(Element element)
element
- public <T> T getJAXBObject(Class<T> clazz, Class... otherPossibleClasses) throws JAXBException
clazz
- class type you are expectingotherPossibleClasses
- Other classe you want to create the JAXBContext withJAXBException
public Object getJAXBObject()
public void setJAXBObject(Object obj)
Copyright © 2016 JBoss by Red Hat. All rights reserved.