org.apache.tapestry.markup
Class JSONWriterImpl

java.lang.Object
  extended by org.apache.tapestry.markup.JSONWriterImpl
All Implemented Interfaces:
IJSONWriter

public class JSONWriterImpl
extends Object
implements IJSONWriter

Implementation of IJSONWriter.

Author:
jkuhnert

Field Summary
protected  PrintWriter _writer
          Outputstream writer.
 
Constructor Summary
JSONWriterImpl(PrintWriter writer)
          Creates a new instance that will write all content to the specified PrintWriter.
 
Method Summary
 JSONArray array()
          Provides access to the core outer JSONArray being rendered to a response.
 void close()
          Causes any un-ended blocks to be closed, as well as any reasources associated with writer to be flushed/written.
 void flush()
          Forwards flush() to this IJSONWriter's PrintWriter.
protected  PrintWriter getWriter()
          The outputstream being used to write this instance's content.
 JSONObject object()
          Provides access to the core outer JSONObject being rendered to a response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_writer

protected PrintWriter _writer
Outputstream writer.

Constructor Detail

JSONWriterImpl

public JSONWriterImpl(PrintWriter writer)
Creates a new instance that will write all content to the specified PrintWriter.

Parameters:
writer - The outputstream to write to.
Method Detail

close

public void close()
Causes any un-ended blocks to be closed, as well as any reasources associated with writer to be flushed/written.

Specified by:
close in interface IJSONWriter

object

public JSONObject object()
Provides access to the core outer JSONObject being rendered to a response. The object may not necessarily be instantiated until requested, for instances where a response should be a pure array or other.

Specified by:
object in interface IJSONWriter
Returns:
The JSONObject being delegated to.

array

public JSONArray array()
Provides access to the core outer JSONArray being rendered to a response. The object may not necessarily be instantiated until requested.

Specified by:
array in interface IJSONWriter
Returns:
The JSONArray being delegated to.

flush

public void flush()
Description copied from interface: IJSONWriter
Forwards flush() to this IJSONWriter's PrintWriter.

Specified by:
flush in interface IJSONWriter

getWriter

protected PrintWriter getWriter()
The outputstream being used to write this instance's content.

Returns:
The writer being written to.


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.