org.drools.guvnor.server.jaxrs.providers.atom
Class Content

java.lang.Object
  extended by org.drools.guvnor.server.jaxrs.providers.atom.CommonAttributes
      extended by org.drools.guvnor.server.jaxrs.providers.atom.Content

public class Content
extends CommonAttributes

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

TODO remove this file when JBoss AS includes RESTEasy 2.3.4.Final or higher


Field Summary
protected  org.jboss.resteasy.plugins.providers.jaxb.JAXBContextFinder finder
           
 
Constructor Summary
Content()
           
 
Method Summary
 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 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()
           
 URI getSrc()
           
 String getText()
          If content is text, return it as a String.
 javax.ws.rs.core.MediaType getType()
          Mime type of the content
 List<Object> getValue()
           
 void setElement(Element element)
          Set the content to an XML Element
protected  void setFinder(org.jboss.resteasy.plugins.providers.jaxb.JAXBContextFinder finder)
           
 void setJAXBObject(Object obj)
           
 void setRawType(String type)
           
 void setSrc(URI src)
           
 void setText(String text)
          Set content as text
 void setType(javax.ws.rs.core.MediaType type)
           
 void setValue(List<Object> value)
           
 
Methods inherited from class org.drools.guvnor.server.jaxrs.providers.atom.CommonAttributes
getBase, getExtensionAttributes, getLanguage, setBase, setLanguage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

finder

protected org.jboss.resteasy.plugins.providers.jaxb.JAXBContextFinder finder
Constructor Detail

Content

public Content()
Method Detail

setFinder

protected void setFinder(org.jboss.resteasy.plugins.providers.jaxb.JAXBContextFinder finder)

getValue

public List<Object> getValue()

setValue

public void setValue(List<Object> value)

getSrc

public URI getSrc()

setSrc

public void setSrc(URI src)

getType

public javax.ws.rs.core.MediaType getType()
Mime type of the content

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)


Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.