Class Text
- java.lang.Object
-
- org.jboss.resteasy.plugins.providers.atom.CommonAttributes
-
- org.jboss.resteasy.plugins.providers.atom.Text
-
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
- Version:
- $Revision: 1 $
-
-
Field Summary
Fields Modifier and Type Field Description private org.w3c.dom.Element
element
protected JAXBContextFinder
finder
private java.lang.Object
jaxbObject
private javax.ws.rs.core.MediaType
mediaType
private java.lang.String
text
private java.lang.String
type
private java.util.List<java.lang.Object>
value
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.w3c.dom.Element
getElement()
Get content as an XML Element if the content is XML.java.lang.Object
getJAXBObject()
Returns previous extracted jaxbobject from a call to getJAXBObject(Classclazz) or value passed in through a previous setJAXBObject(). <T> T
getJAXBObject(java.lang.Class<T> clazz, java.lang.Class... otherPossibleClasses)
Extract the content as the provided JAXB annotated type.java.lang.String
getRawType()
java.lang.String
getText()
If content is text, return it as a String.javax.ws.rs.core.MediaType
getType()
Mime typejava.util.List<java.lang.Object>
getValue()
void
setElement(org.w3c.dom.Element element)
Set the content to an XML Elementprotected void
setFinder(JAXBContextFinder finder)
void
setJAXBObject(java.lang.Object obj)
void
setRawType(java.lang.String type)
void
setText(java.lang.String text)
Set content as textvoid
setType(javax.ws.rs.core.MediaType type)
void
setValue(java.util.List<java.lang.Object> value)
-
Methods inherited from class org.jboss.resteasy.plugins.providers.atom.CommonAttributes
getBase, getExtensionAttributes, getLanguage, setBase, setLanguage
-
-
-
-
Field Detail
-
type
private java.lang.String type
-
mediaType
private javax.ws.rs.core.MediaType mediaType
-
text
private java.lang.String text
-
element
private org.w3c.dom.Element element
-
value
private java.util.List<java.lang.Object> value
-
jaxbObject
private java.lang.Object jaxbObject
-
finder
protected JAXBContextFinder finder
-
-
Method Detail
-
setFinder
protected void setFinder(JAXBContextFinder finder)
-
getValue
public java.util.List<java.lang.Object> getValue()
-
setValue
public void setValue(java.util.List<java.lang.Object> value)
-
getType
public javax.ws.rs.core.MediaType getType()
Mime type- Returns:
-
setType
public void setType(javax.ws.rs.core.MediaType type)
-
getRawType
public java.lang.String getRawType()
-
setRawType
public void setRawType(java.lang.String type)
-
getText
public java.lang.String getText()
If content is text, return it as a String. Otherwise, if content is not text this will return null.- Returns:
-
setText
public void setText(java.lang.String text)
Set content as text- Parameters:
text
-
-
getElement
public org.w3c.dom.Element getElement()
Get content as an XML Element if the content is XML. Otherwise, this will just return null.- Returns:
-
setElement
public void setElement(org.w3c.dom.Element element)
Set the content to an XML Element- Parameters:
element
-
-
getJAXBObject
public <T> T getJAXBObject(java.lang.Class<T> clazz, java.lang.Class... otherPossibleClasses) throws javax.xml.bind.JAXBException
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:
javax.xml.bind.JAXBException
-
getJAXBObject
public java.lang.Object getJAXBObject()
Returns previous extracted jaxbobject from a call to getJAXBObject(Classclazz) or value passed in through a previous setJAXBObject(). - Returns:
-
setJAXBObject
public void setJAXBObject(java.lang.Object obj)
-
-