public abstract class OutputWriter extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Object> |
customOutputs |
static String |
KEY_ITEMS |
static String |
KEY_SIZE |
protected long |
max |
static int |
NB_MAX |
static String |
PARAM_SIZE |
static String |
PARAM_WRITER |
static String |
PATH_KEY |
protected Pipe |
pipe |
protected long |
size |
protected Writer |
writer |
| Constructor and Description |
|---|
OutputWriter() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
ends()
writes the end of the output
|
abstract boolean |
handleRequest(org.apache.sling.api.SlingHttpServletRequest request) |
void |
init(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response)
Init the writer, writes beginning of the output
|
protected abstract void |
initResponse(org.apache.sling.api.SlingHttpServletResponse response)
Specifically init the response
|
void |
setMax(int max)
Setter for max (will put to max if value is negative)
|
void |
setPipe(Pipe pipe)
Setter
|
void |
setWriter(Writer writer)
x
Set the writer
|
abstract void |
starts()
Init the writer, writes beginning of the output
|
String |
toString() |
void |
write(org.apache.sling.api.resource.Resource resource)
Write a given resource
|
protected abstract void |
writeItem(org.apache.sling.api.resource.Resource resource)
Write a given resource
|
public static final String KEY_SIZE
public static final String KEY_ITEMS
public static final String PARAM_SIZE
public static final int NB_MAX
protected long size
protected long max
protected Pipe pipe
protected Writer writer
public static final String PATH_KEY
public static final String PARAM_WRITER
public abstract boolean handleRequest(org.apache.sling.api.SlingHttpServletRequest request)
request - current requestpublic void init(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response)
throws IOException
request - request from which writer will outputresponse - response on which writer will outputIOException - error handling streamsprotected abstract void initResponse(org.apache.sling.api.SlingHttpServletResponse response)
response - response on which to writepublic abstract void starts()
public void setMax(int max)
max - positive max value to setpublic void setWriter(Writer writer)
writer - writer on which to write outputpublic void write(org.apache.sling.api.resource.Resource resource)
resource - resource that will be writtenprotected abstract void writeItem(org.apache.sling.api.resource.Resource resource)
resource - resource that will be writtenpublic abstract void ends()
public void setPipe(Pipe pipe)
pipe - pipe this writer should be associated withCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.