public class JsonpRepresentation extends WrapperRepresentation
UNKNOWN_SIZE
Constructor and Description |
---|
JsonpRepresentation(String callback,
Status status,
Representation wrappedRepresentation)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getCallback()
Returns the name of the JavaScript callback method.
|
ReadableByteChannel |
getChannel() |
MediaType |
getMediaType() |
long |
getSize() |
Status |
getStatus()
Returns the actual status code.
|
InputStream |
getStream() |
String |
getText() |
void |
write(OutputStream outputStream)
Writes the callback method wrapper first, including the actual HTTP
status code, then the existing JSON content as a body.
|
void |
write(WritableByteChannel writableChannel) |
void |
write(Writer writer) |
exhaust, getAvailableSize, getCharacterSet, getDigest, getDisposition, getEncodings, getExpirationDate, getLanguages, getLocationRef, getModificationDate, getRange, getReader, getRegistration, getTag, getWrappedRepresentation, isAvailable, isSelectable, isTransient, release, setAvailable, setCharacterSet, setDigest, setDisposition, setEncodings, setExpirationDate, setLanguages, setLocationRef, setLocationRef, setMediaType, setModificationDate, setRange, setSize, setTag, setTransient
append, hasKnownSize, isEmpty, setListener
createClientInfo, equals, includes, isCompatible, toString
public JsonpRepresentation(String callback, Status status, Representation wrappedRepresentation)
callback
- The name of the JavaScript callback method.status
- The actual status code.wrappedRepresentation
- public String getCallback()
public ReadableByteChannel getChannel() throws IOException
getChannel
in class WrapperRepresentation
IOException
public MediaType getMediaType()
getMediaType
in class WrapperRepresentation
public long getSize()
getSize
in class WrapperRepresentation
public Status getStatus()
public InputStream getStream() throws IOException
getStream
in class WrapperRepresentation
IOException
public String getText() throws IOException
getText
in class WrapperRepresentation
IOException
public void write(Writer writer) throws IOException
write
in class WrapperRepresentation
IOException
public void write(OutputStream outputStream) throws IOException
write
in class WrapperRepresentation
IOException
public void write(WritableByteChannel writableChannel) throws IOException
write
in class WrapperRepresentation
IOException
Copyright © 2005-2014 Restlet.