Class Content
java.lang.Object
org.jboss.resteasy.plugins.providers.atom.CommonAttributes
org.jboss.resteasy.plugins.providers.atom.Content
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
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
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(Class<T> clazz) or value passed in through a previous setJAXBObject().<T> TgetJAXBObject(Class<T> clazz, Class... otherPossibleClasses) Extract the content as the provided JAXB annotated type.getSrc()getText()If content is text, return it as a String.jakarta.ws.rs.core.MediaTypegetType()Mime type of the content.getValue()voidsetElement(Element element) Set the content to an XML Element.protected voidsetFinder(JAXBContextFinder finder) voidsetJAXBObject(Object obj) voidsetRawType(String type) voidvoidSet content as text.voidsetType(jakarta.ws.rs.core.MediaType type) voidMethods inherited from class org.jboss.resteasy.plugins.providers.atom.CommonAttributes
getBase, getExtensionAttributes, getLanguage, setBase, setLanguage
-
Field Details
-
finder
-
-
Constructor Details
-
Content
public Content()
-
-
Method Details
-
setFinder
-
getValue
-
setValue
-
getSrc
-
setSrc
-
getType
public jakarta.ws.rs.core.MediaType getType()Mime type of the content.- Returns:
- media type
-
setType
public void setType(jakarta.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:
- text
-
setText
Set content as text.- Parameters:
text- text
-
getElement
Get content as an XML Element if the content is XML. Otherwise, this will just return null.- Returns:
Element
-
setElement
Set the content to an XML Element.- Parameters:
element-Element
-
getJAXBObject
public <T> T getJAXBObject(Class<T> clazz, Class... otherPossibleClasses) throws jakarta.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.
- Type Parameters:
T- type- 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:
jakarta.xml.bind.JAXBException- jaxb exception
-
getJAXBObject
Returns previous extracted jaxbobject from a call to getJAXBObject(Class<T> clazz) or value passed in through a previous setJAXBObject().- Returns:
- jaxb object
-
setJAXBObject
-