flexjson.locators
Class TypeLocator<T>

java.lang.Object
  extended by flexjson.locators.TypeLocator<T>
All Implemented Interfaces:
ClassLocator

public class TypeLocator<T>
extends Object
implements ClassLocator

This implementation uses a single field out of the object as the type discriminator. Each unique value of the type field is mapped to a java class using the add(Object, Class) method.


Constructor Summary
TypeLocator(String fieldname)
           
 
Method Summary
 TypeLocator add(T value, Class type)
           
 Class locate(ObjectBinder context, Path currentPath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeLocator

public TypeLocator(String fieldname)
Method Detail

add

public TypeLocator add(T value,
                       Class type)

locate

public Class locate(ObjectBinder context,
                    Path currentPath)
             throws ClassNotFoundException
Specified by:
locate in interface ClassLocator
Throws:
ClassNotFoundException


Copyright © 2014. All Rights Reserved.