org.directwebremoting.json.serialize
Class JsonSerializerFactory

java.lang.Object
  extended by org.directwebremoting.json.serialize.JsonSerializerFactory

public class JsonSerializerFactory
extends java.lang.Object

An accessor for the current JsonParser. The nested JsonSerializerFactory.JsonSerializerBuilder will only be of use to system implementors.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Nested Class Summary
static interface JsonSerializerFactory.JsonSerializerBuilder
          Hack to get around Generics not being implemented by erasure
 
Constructor Summary
JsonSerializerFactory()
           
 
Method Summary
static JsonSerializer attach(Container container)
          Internal method to allow us to get the Builder from which we will get JsonSerializer objects.
static JsonSerializer get()
          Accessor for the current JsonParser.
static JsonSerializer get(ServerContext ctx)
          Accessor for the current JsonSerializer in more complex setups.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonSerializerFactory

public JsonSerializerFactory()
Method Detail

get

public static JsonSerializer get()
Accessor for the current JsonParser.

Returns:
The current JsonParser.

get

public static JsonSerializer get(ServerContext ctx)
Accessor for the current JsonSerializer in more complex setups. For some setups DWR may not be able to discover the correct environment (i.e. ServerContext), so we need to tell it. This generally happens if you have DWR configured twice in a single context. Unless you are writing code that someone else will configure, it is probably safe to use the simpler get() method.

Parameters:
ctx - The servlet context to allow us to bootstrap
Returns:
The current JsonSerializer.

attach

public static JsonSerializer attach(Container container)
Internal method to allow us to get the Builder from which we will get JsonSerializer objects. Do NOT call this method from outside of DWR.


Copyright 2008