Class Text
java.lang.Object
org.jboss.resteasy.plugins.providers.atom.CommonAttributes
org.jboss.resteasy.plugins.providers.atom.Text
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
- Version:
- $Revision: 1 $
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet content as an XML Element if the content is XML.Returns previous extracted jaxbobject from a call to getJAXBObject(Classclazz) or value passed in through a previous setJAXBObject(). <T> TgetJAXBObject(Class<T> clazz, Class... otherPossibleClasses) Extract the content as the provided JAXB annotated type.getText()If content is text, return it as a String.javax.ws.rs.core.MediaTypegetType()Mime typegetValue()voidsetElement(Element element) Set the content to an XML Elementprotected voidsetFinder(JAXBContextFinder finder) voidsetJAXBObject(Object obj) voidsetRawType(String type) voidSet content as textvoidsetType(javax.ws.rs.core.MediaType type) voidMethods inherited from class org.jboss.resteasy.plugins.providers.atom.CommonAttributes
getBase, getExtensionAttributes, getLanguage, setBase, setLanguage
-
Field Details
-
type
-
mediaType
private javax.ws.rs.core.MediaType mediaType -
text
-
element
-
value
-
jaxbObject
-
finder
-
-
Constructor Details
-
Text
public Text() -
Text
-
Text
-
-
Method Details
-
setFinder
-
getValue
-
setValue
-
getType
public javax.ws.rs.core.MediaType getType()Mime type- Returns:
-
setType
public void setType(javax.ws.rs.core.MediaType type) -
getRawType
-
setRawType
-
getText
If content is text, return it as a String. Otherwise, if content is not text this will return null.- Returns:
-
setText
Set content as text- Parameters:
text-
-
getElement
Get content as an XML Element if the content is XML. Otherwise, this will just return null.- Returns:
-
setElement
Set the content to an XML Element- Parameters:
element-
-
getJAXBObject
Extract the content as the provided JAXB annotated type. 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.- Parameters:
clazz- class type you are expectingotherPossibleClasses- Other classe you want to create the JAXBContext with- Returns:
- null if there is no XML content
- Throws:
JAXBException
-
getJAXBObject
Returns previous extracted jaxbobject from a call to getJAXBObject(Classclazz) or value passed in through a previous setJAXBObject(). - Returns:
-
setJAXBObject
-