|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.data.Message
public abstract class Message
Generic message exchanged between client and server connectors.
Constructor Summary | |
---|---|
Message()
Constructor. |
|
Message(Representation entity)
Constructor. |
Method Summary | |
---|---|
Map<String,Object> |
getAttributes()
Returns a modifiable attributes map that can be used by developers to save information relative to the message. |
Representation |
getEntity()
Returns the entity representation. |
DomRepresentation |
getEntityAsDom()
Returns the entity as a DOM representation. Note that this triggers the parsing of the entity into a reusable DOM document stored in memory. This method and the related getEntity*() methods can only be invoked once. |
Form |
getEntityAsForm()
Returns the entity as a form. Note that this triggers the parsing of the entity. This method and the related getEntity*() methods can only be invoked once. |
Object |
getEntityAsObject()
Returns the entity as a higher-level object. |
SaxRepresentation |
getEntityAsSax()
Returns the entity as a SAX representation. Note that this kind of representation can only be parsed once. |
boolean |
isEntityAvailable()
Indicates if a content is available and can be sent. |
void |
setEntity(Object object)
Sets the entity from a higher-level object. |
void |
setEntity(Representation entity)
Sets the entity representation. |
void |
setEntity(String value,
MediaType mediaType)
Sets a textual entity. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Message()
public Message(Representation entity)
entity
- The payload of the message.Method Detail |
---|
public Map<String,Object> getAttributes()
Attribute name | Class name | Description |
---|---|---|
org.restlet.http.headers | org.restlet.data.Form | Server HTTP connectors must provide all request headers and client HTTP connectors must provide all response headers, exactly as they were received. In addition, developers can also use this attribute to specify non-standard headers that should be added to the request or to the response. |
public Representation getEntity()
public DomRepresentation getEntityAsDom()
public Form getEntityAsForm()
public Object getEntityAsObject()
ConverterService
public SaxRepresentation getEntityAsSax()
public boolean isEntityAvailable()
public void setEntity(Object object)
object
- The higher-level object.ConverterService
public void setEntity(Representation entity)
entity
- The entity representation.public void setEntity(String value, MediaType mediaType)
value
- The represented string.mediaType
- The representation's media type.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |