cc.plural.jsonij.marshal
Class JSONCodecStore

java.lang.Object
  extended by cc.plural.jsonij.marshal.JSONCodecStore

public class JSONCodecStore
extends Object

Author:
openecho

Field Summary
static String CREATE_INSTANCE_METHOD_SIGNATURE
           
static String DECODE_METHOD_SIGNATURE
           
static String ENCODE_METHOD_SIGNATURE
           
 
Constructor Summary
JSONCodecStore()
           
 
Method Summary
 void deregisterCodec(Class<?> codec)
           
 JSONCodec<?> getCodec(Class<?> type)
          Finds the codec for the specified type.
 Class<?>[] getTypeParameterSet(Class<?> codec)
           
 boolean hasCodec(Class<?> type)
          Check if the codec store has a codec registered for the class specified.
 boolean isEmpty()
           
 void printSuperClasses(Class<?> c)
           
 void registerCodec(Class<?> codec)
           
 void registerCodec(Class<?> type, Class<?> codec)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CREATE_INSTANCE_METHOD_SIGNATURE

public static final String CREATE_INSTANCE_METHOD_SIGNATURE

ENCODE_METHOD_SIGNATURE

public static final String ENCODE_METHOD_SIGNATURE

DECODE_METHOD_SIGNATURE

public static final String DECODE_METHOD_SIGNATURE
Constructor Detail

JSONCodecStore

public JSONCodecStore()
Method Detail

size

public int size()

isEmpty

public boolean isEmpty()

printSuperClasses

public void printSuperClasses(Class<?> c)

getTypeParameterSet

public Class<?>[] getTypeParameterSet(Class<?> codec)

registerCodec

public void registerCodec(Class<?> codec)

registerCodec

public void registerCodec(Class<?> type,
                          Class<?> codec)

deregisterCodec

public void deregisterCodec(Class<?> codec)

hasCodec

public boolean hasCodec(Class<?> type)
Check if the codec store has a codec registered for the class specified. If a codec is found then this will return true. The check will test the specified class then all parents of the specified class.

Parameters:
type - Class instance to check for.
Returns:
true when codec is found or false when there is not a codec.

getCodec

public JSONCodec<?> getCodec(Class<?> type)
Finds the codec for the specified type. The check will check if a codec exists for the specified class then all parents of the specified class. When it finds a codec it will return it.

Parameters:
type - The Class type to check for.
Returns:
JSONCodec the codec for the specified class or null if none is found.


Copyright © 2012. All Rights Reserved.