org.granite.messaging.amf.io.util.externalizer
Class DefaultExternalizer

java.lang.Object
  extended by org.granite.messaging.amf.io.util.externalizer.DefaultExternalizer
All Implemented Interfaces:
Externalizer
Direct Known Subclasses:
BigDecimalExternalizer, BigIntegerExternalizer, EnumExternalizer, LongExternalizer, MathContextExternalizer

public class DefaultExternalizer
extends Object
implements Externalizer

Author:
Franck WOLFF

Field Summary
protected static byte[] BYTES_0
           
protected  ConcurrentHashMap<String,Constructor<?>> constructors
           
protected  boolean dynamicClass
           
protected  ConcurrentHashMap<Class<?>,List<Property>> orderedFields
           
protected  ConcurrentHashMap<Class<?>,List<Property>> orderedSetterFields
           
 
Constructor Summary
DefaultExternalizer()
           
 
Method Summary
 int accept(Class<?> clazz)
           
 void configure(XMap properties)
           
protected
<T> Constructor<T>
findDefaultConstructor(Class<T> clazz)
           
 List<Property> findOrderedFields(Class<?> clazz)
           
 List<Property> findOrderedFields(Class<?> clazz, boolean returnSettersWhenAvailable)
           
protected  boolean isPropertyIgnored(Field field)
           
protected  boolean isValueIgnored(Object value)
           
 Object newInstance(String type, ObjectInput in)
           
 void readExternal(Object o, ObjectInput in)
           
 void writeExternal(Object o, ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BYTES_0

protected static final byte[] BYTES_0

orderedFields

protected final ConcurrentHashMap<Class<?>,List<Property>> orderedFields

orderedSetterFields

protected final ConcurrentHashMap<Class<?>,List<Property>> orderedSetterFields

constructors

protected final ConcurrentHashMap<String,Constructor<?>> constructors

dynamicClass

protected boolean dynamicClass
Constructor Detail

DefaultExternalizer

public DefaultExternalizer()
Method Detail

configure

public void configure(XMap properties)
Specified by:
configure in interface Externalizer

newInstance

public Object newInstance(String type,
                          ObjectInput in)
                   throws IOException,
                          ClassNotFoundException,
                          InstantiationException,
                          InvocationTargetException,
                          IllegalAccessException
Specified by:
newInstance in interface Externalizer
Throws:
IOException
ClassNotFoundException
InstantiationException
InvocationTargetException
IllegalAccessException

readExternal

public void readExternal(Object o,
                         ObjectInput in)
                  throws IOException,
                         ClassNotFoundException,
                         IllegalAccessException
Specified by:
readExternal in interface Externalizer
Throws:
IOException
ClassNotFoundException
IllegalAccessException

writeExternal

public void writeExternal(Object o,
                          ObjectOutput out)
                   throws IOException,
                          IllegalAccessException
Specified by:
writeExternal in interface Externalizer
Throws:
IOException
IllegalAccessException

isValueIgnored

protected boolean isValueIgnored(Object value)

findOrderedFields

public List<Property> findOrderedFields(Class<?> clazz)
Specified by:
findOrderedFields in interface Externalizer

findOrderedFields

public List<Property> findOrderedFields(Class<?> clazz,
                                        boolean returnSettersWhenAvailable)

isPropertyIgnored

protected boolean isPropertyIgnored(Field field)

findDefaultConstructor

protected <T> Constructor<T> findDefaultConstructor(Class<T> clazz)

accept

public int accept(Class<?> clazz)
Specified by:
accept in interface Externalizer