Class XJCJavaModelImpl

java.lang.Object
org.eclipse.persistence.jaxb.javamodel.xjc.XJCJavaModelImpl
All Implemented Interfaces:
JavaModel

public class XJCJavaModelImpl extends 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:
  • Constructor Details

    • 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 Details

    • getClass

      public JavaClass getClass(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(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 Annotation getAnnotation(JavaAnnotation annotation, 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 Map<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(Map<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 ClassLoader getClassLoader()
      Returns this JavaModel's ClassLoader.
      Specified by:
      getClassLoader in interface JavaModel
      Returns:
      the ClassLoader used by this JavaModel.