public class Text extends CommonAttributes
Represents an atomTextConstruct element.
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
Modifier and Type | Field and Description |
---|---|
protected JAXBContextFinder |
finder |
Constructor and Description |
---|
Text() |
Text(String text) |
Text(String text,
String type) |
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> clazz)
or value passed in through a previous setJAXBObject().
|
<T> T |
getJAXBObject(Class<T> clazz,
Class... otherPossibleClasses)
Extract the content as the provided JAXB annotated type.
|
String |
getRawType() |
String |
getText()
If content is text, return it as a String.
|
javax.ws.rs.core.MediaType |
getType()
Mime type.
|
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 |
setText(String text)
Set content as text.
|
void |
setType(javax.ws.rs.core.MediaType type) |
void |
setValue(List<Object> value) |
getBase, getExtensionAttributes, getLanguage, setBase, setLanguage
protected JAXBContextFinder finder
public Text()
public Text(String text)
protected void setFinder(JAXBContextFinder finder)
public javax.ws.rs.core.MediaType getType()
public void setType(javax.ws.rs.core.MediaType type)
public String getRawType()
public void setRawType(String type)
public String getText()
public void setText(String text)
text
- textpublic Element getElement()
Element
public void setElement(Element element)
element
- Element
public <T> T getJAXBObject(Class<T> clazz, Class... otherPossibleClasses) throws JAXBException
This method will use a cached JAXBContext used by the Resteasy JAXB providers or, if those are not existent, it will create a new JAXBContext from scratch using the class.
clazz
- class type you are expectingotherPossibleClasses
- Other classe you want to create the JAXBContext withJAXBException
- jaxb exceptionpublic Object getJAXBObject()
public void setJAXBObject(Object obj)
Copyright © 2018 JBoss by Red Hat. All rights reserved.