Class XJCJavaModelImpl

  • All Implemented Interfaces:
    JavaModel

    public class XJCJavaModelImpl
    extends java.lang.Object
    implements JavaModel
    INTERNAL:

    Purpose: JavaModel implementation wrapping XJC's JCodeModel. Used when bootstrapping a DynamicJAXBContext from an XML Schema.

    Responsibilities:

    • Return a JavaClass based on a Class or Class name.
    • Return a Java Annotation for a given JavaAnnotation.
    See Also:
    JavaModel
    Since:
    EclipseLink 2.1
    • Constructor Summary

      Constructors 
      Constructor Description
      XJCJavaModelImpl​(com.sun.codemodel.JCodeModel codeModel, DynamicClassLoader loader)
      Construct a new instance of XJCJavaModelImpl.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.annotation.Annotation getAnnotation​(JavaAnnotation annotation, java.lang.Class<?> jClass)
      Return a Java Annotation representation of the given JavaAnnotation.
      JavaClass getClass​(java.lang.Class<?> jClass)
      Obtain the JavaClass given the corresponding Java Class.
      JavaClass getClass​(java.lang.String className)
      Obtain the JavaClass given the corresponding Java Class' name.
      java.lang.ClassLoader getClassLoader()
      Returns this JavaModel's ClassLoader.
      java.util.Map<java.lang.String,​JavaClass> getJavaModelClasses()
      Returns a Map of this JavaModel's JavaClasses, keyed on class name.
      void setJavaModelClasses​(java.util.Map<java.lang.String,​JavaClass> javaModelClasses)
      Sets the Map of JavaClasses for this JavaModel's, keyed on class name.
      • Methods inherited from class java.lang.Object

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

      • XJCJavaModelImpl

        public XJCJavaModelImpl​(com.sun.codemodel.JCodeModel codeModel,
                                DynamicClassLoader loader)
        Construct a new instance of XJCJavaModelImpl.
        Parameters:
        codeModel - - the XJC JCodeModel to be wrapped.
        loader - - the ClassLoader used to bootstrap the DynamicJAXBContext.
    • Method Detail

      • getClass

        public JavaClass getClass​(java.lang.Class<?> jClass)
        Obtain the JavaClass given the corresponding Java Class.
        Specified by:
        getClass in interface JavaModel
        Parameters:
        jClass - - the Java Class to search for.
        Returns:
        the JavaClass corresponding to jClass.
      • getClass

        public JavaClass getClass​(java.lang.String className)
        Obtain the JavaClass given the corresponding Java Class' name.
        Specified by:
        getClass in interface JavaModel
        Parameters:
        className - - the name of the Java Class to search for.
        Returns:
        the JavaClass corresponding to className.
      • getAnnotation

        public java.lang.annotation.Annotation getAnnotation​(JavaAnnotation annotation,
                                                             java.lang.Class<?> jClass)
        Return a Java Annotation representation of the given JavaAnnotation.
        Specified by:
        getAnnotation in interface JavaModel
        Parameters:
        annotation - - the JavaAnnotation to be converted.
        jClass - - the Java Class this annotation belogs to.
        Returns:
        a Java Annotation representation of the given JavaAnnotation.
      • getJavaModelClasses

        public java.util.Map<java.lang.String,​JavaClass> getJavaModelClasses()
        Returns a Map of this JavaModel's JavaClasses, keyed on class name.
        Returns:
        this JavaModel's Map of JavaClasses.
      • setJavaModelClasses

        public void setJavaModelClasses​(java.util.Map<java.lang.String,​JavaClass> javaModelClasses)
        Sets the Map of JavaClasses for this JavaModel's, keyed on class name.
        Parameters:
        javaModelClasses - - a Map of JavaClasses, keyed on class name.
      • getClassLoader

        public java.lang.ClassLoader getClassLoader()
        Returns this JavaModel's ClassLoader.
        Specified by:
        getClassLoader in interface JavaModel
        Returns:
        the ClassLoader used by this JavaModel.