org.apache.abdera.protocol.server.context
Class StreamWriterResponseContext
java.lang.Object
org.apache.abdera.protocol.util.AbstractMessage
org.apache.abdera.protocol.util.AbstractResponse
org.apache.abdera.protocol.server.context.AbstractResponseContext
org.apache.abdera.protocol.server.context.SimpleResponseContext
org.apache.abdera.protocol.server.context.StreamWriterResponseContext
- All Implemented Interfaces:
- Message, Response, ResponseContext, ProtocolConstants
- Direct Known Subclasses:
- EntityProviderResponseContext, JsonObjectResponseContext
public abstract class StreamWriterResponseContext
- extends SimpleResponseContext
Abstract base class for creating ResponseContext implementations that use the StreamWriter interface. Using the
StreamWriter to write out documents is significantly faster than using the object model but requires developers to
know more about proper Atom syntax.
Methods inherited from class org.apache.abdera.protocol.server.context.AbstractResponseContext |
addEncodedHeader, addEncodedHeaders, addHeader, addHeaders, getCacheControl, getDateHeader, getHeader, getHeaderNames, getHeaders, getHeaders, getStatus, getStatusText, isBinary, removeHeader, setAge, setAllow, setAllow, setBinary, setContentLanguage, setContentLength, setContentLocation, setContentType, setContentType, setEncodedHeader, setEncodedHeader, setEntityTag, setEntityTag, setEscapedHeader, setExpires, setHeader, setHeader, setLastModified, setLocation, setSlug, setStatus, setStatusText, setWriter |
Methods inherited from class org.apache.abdera.protocol.util.AbstractResponse |
getAge, getAllow, getContentLength, getEntityTag, getExpires, getLastModified, getLocation, getNoCacheHeaders, getPrivateHeaders, getSMaxAge, getType, isMustRevalidate, isPrivate, isProxyRevalidate, isPublic, setMaxAge, setMustRevalidate, setNoCache, setNoCacheHeaders, setNoStore, setNoTransform, setPrivate, setPrivateHeaders, setProxyRevalidate, setPublic |
Methods inherited from class org.apache.abdera.protocol.util.AbstractMessage |
check, getContentLanguage, getContentLocation, getContentType, getDecodedHeader, getDecodedHeaders, getMaxAge, getSlug, isNoCache, isNoStore, isNoTransform, toggle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.abdera.protocol.Response |
getAge, getAllow, getContentLength, getEntityTag, getExpires, getLastModified, getLocation, getNoCacheHeaders, getPrivateHeaders, getSMaxAge, getType, isMustRevalidate, isPrivate, isProxyRevalidate, isPublic |
StreamWriterResponseContext
protected StreamWriterResponseContext(Abdera abdera)
- Create a new StreamWriterResponseContext
- Parameters:
abdera
- The Abdera instance
StreamWriterResponseContext
protected StreamWriterResponseContext(Abdera abdera,
String encoding)
- Create a new StreamWriterResponseContext
- Parameters:
abdera
- The Abdera instanceencoding
- The charset encoding
StreamWriterResponseContext
protected StreamWriterResponseContext(Abdera abdera,
String encoding,
String sw)
- Create a new StreamWriterResponseContext
- Parameters:
abdera
- The Abdera instanceencoding
- The charset encodingsw
- The name of the Named StreamWriter to use
getAbdera
protected final Abdera getAbdera()
- Get the Abdera instance
newStreamWriter
protected StreamWriter newStreamWriter()
- Create a new StreamWriter instance. If the sw property was set, the specified Named StreamWriter will be returned
writeEntity
protected void writeEntity(Writer writer)
throws IOException
- Specified by:
writeEntity
in class SimpleResponseContext
- Throws:
IOException
writeTo
protected abstract void writeTo(StreamWriter sw)
throws IOException
- Write to the specified StreamWriter. Subclasses of this class must implement this method.
- Throws:
IOException
setAutoIndent
public StreamWriterResponseContext setAutoIndent(boolean autoindent)
- True to enable automatic indenting on the StreamWriter
getAutoIndent
public boolean getAutoIndent()
- True if automatic indenting is enabled on the StreamWriter
hasEntity
public boolean hasEntity()
- Description copied from interface:
ResponseContext
- True if the response contains an entity
Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.