Class MappingTypeLoader

  • All Implemented Interfaces:
    TypeLoader

    public class MappingTypeLoader
    extends java.lang.Object
    implements TypeLoader
    Allows loading pre-registered classes with arbitrary names, or with names determined by the SchemaElement annotation.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map<java.lang.String,​java.lang.Class<?>> map  
      protected TypeLoader parent  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void bind​(ClassDescriptor cd, java.lang.Class<?> cls)  
      void bind​(java.lang.Class<?> cls)  
      void bind​(java.lang.String className, java.lang.Class<?> cls)  
      java.util.Map<java.lang.String,​java.lang.Class<?>> getMap()  
      java.lang.Class<?> load​(ClassDescriptor cd)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • map

        protected final java.util.Map<java.lang.String,​java.lang.Class<?>> map
    • Constructor Detail

      • MappingTypeLoader

        public MappingTypeLoader()
      • MappingTypeLoader

        public MappingTypeLoader​(TypeLoader parent)
    • Method Detail

      • bind

        public void bind​(java.lang.Class<?> cls)
      • bind

        public void bind​(java.lang.String className,
                         java.lang.Class<?> cls)
      • load

        public java.lang.Class<?> load​(ClassDescriptor cd)
                                throws java.lang.ClassNotFoundException
        Specified by:
        load in interface TypeLoader
        Returns:
        Class for type specified by given descriptor (never null). Implementation of this function must return the same class for identical class descriptors (i.e. must be "pure function").
        Throws:
        java.lang.ClassNotFoundException
      • getMap

        public java.util.Map<java.lang.String,​java.lang.Class<?>> getMap()