org.apache.abdera.ext.json
Class JSONWriter

java.lang.Object
  extended by org.apache.abdera.util.AbstractNamedWriter
      extended by org.apache.abdera.ext.json.JSONWriter
All Implemented Interfaces:
NamedWriter, Writer

public class JSONWriter
extends org.apache.abdera.util.AbstractNamedWriter
implements NamedWriter


Field Summary
static java.lang.String[] FORMATS
           
static java.lang.String NAME
           
 
Fields inherited from class org.apache.abdera.util.AbstractNamedWriter
formats, name
 
Constructor Summary
JSONWriter()
           
 
Method Summary
 java.lang.String getName()
          Return the name used to acquire an instance of this Writer (case insensitive)
static org.json.JSONObject toJSON(Entry entry)
           
static org.json.JSONObject toJSON(Feed feed)
           
static java.lang.Object toJSON(java.lang.Object object)
           
static org.json.JSONObject toJSON(Service service)
           
 java.lang.Object write(Base base)
          Return the serialized form of the Abdera Base
 void writeTo(Base base, java.io.OutputStream out)
          Serialized the given Abdera Base to the given outputstream
 void writeTo(Base base, java.io.Writer out)
          Serialized the given Abdera Base to the given writer
 
Methods inherited from class org.apache.abdera.util.AbstractNamedWriter
getOutputFormats, outputsFormat
 
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.writer.NamedWriter
getOutputFormats, outputsFormat
 

Field Detail

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

FORMATS

public static final java.lang.String[] FORMATS
Constructor Detail

JSONWriter

public JSONWriter()
Method Detail

getName

public java.lang.String getName()
Description copied from interface: NamedWriter
Return the name used to acquire an instance of this Writer (case insensitive)

Specified by:
getName in interface NamedWriter
Overrides:
getName in class org.apache.abdera.util.AbstractNamedWriter

write

public java.lang.Object write(Base base)
                       throws java.io.IOException
Description copied from interface: Writer
Return the serialized form of the Abdera Base

Specified by:
write in interface Writer
Throws:
java.io.IOException

writeTo

public void writeTo(Base base,
                    java.io.OutputStream out)
             throws java.io.IOException
Description copied from interface: Writer
Serialized the given Abdera Base to the given outputstream

Specified by:
writeTo in interface Writer
Throws:
java.io.IOException

writeTo

public void writeTo(Base base,
                    java.io.Writer out)
             throws java.io.IOException
Description copied from interface: Writer
Serialized the given Abdera Base to the given writer

Specified by:
writeTo in interface Writer
Throws:
java.io.IOException

toJSON

public static java.lang.Object toJSON(java.lang.Object object)
                               throws java.lang.Exception
Throws:
java.lang.Exception

toJSON

public static org.json.JSONObject toJSON(Entry entry)
                                  throws java.lang.Exception
Throws:
java.lang.Exception

toJSON

public static org.json.JSONObject toJSON(Feed feed)
                                  throws java.lang.Exception
Throws:
java.lang.Exception

toJSON

public static org.json.JSONObject toJSON(Service service)
                                  throws java.lang.Exception
Throws:
java.lang.Exception