flexjson.locators
Class TypeLocator<T>
java.lang.Object
flexjson.locators.TypeLocator<T>
- All Implemented Interfaces:
- ClassLocator
public class TypeLocator<T>
- extends java.lang.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(java.lang.String fieldname)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TypeLocator
public TypeLocator(java.lang.String fieldname)
add
public TypeLocator add(T value,
java.lang.Class type)
locate
public java.lang.Class locate(java.util.Map map,
Path currentPath)
throws java.lang.ClassNotFoundException
- Specified by:
locate in interface ClassLocator
- Throws:
java.lang.ClassNotFoundException