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 Details

    • type

      private String type
    • mediaType

      private javax.ws.rs.core.MediaType mediaType
    • text

      private String text
    • element

      private Element element
    • value

      private List<Object> value
    • jaxbObject

      private Object jaxbObject
    • finder

      protected JAXBContextFinder finder
  • Constructor Details

    • Text

      public Text()
    • Text

      public Text(String text, String type)
    • Text

      public Text(String text)
  • Method Details

    • setFinder

      protected void setFinder(JAXBContextFinder finder)
    • getValue

      public List<Object> getValue()
    • setValue

      public void setValue(List<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 String getRawType()
    • setRawType

      public void setRawType(String type)
    • getText

      public 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(String text)
      Set content as text
      Parameters:
      text -
    • getElement

      public Element getElement()
      Get content as an XML Element if the content is XML. Otherwise, this will just return null.
      Returns:
    • setElement

      public void setElement(Element element)
      Set the content to an XML Element
      Parameters:
      element -
    • getJAXBObject

      public <T> T getJAXBObject(Class<T> clazz, Class... otherPossibleClasses) throws 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 expecting
      otherPossibleClasses - Other classe you want to create the JAXBContext with
      Returns:
      null if there is no XML content
      Throws:
      JAXBException
    • getJAXBObject

      public Object getJAXBObject()
      Returns previous extracted jaxbobject from a call to getJAXBObject(Class clazz) or value passed in through a previous setJAXBObject().
      Returns:
    • setJAXBObject

      public void setJAXBObject(Object obj)