Class XJCJavaMethodImpl

java.lang.Object
org.eclipse.persistence.jaxb.javamodel.xjc.XJCJavaMethodImpl
All Implemented Interfaces:
JavaHasAnnotations, JavaMethod

public class XJCJavaMethodImpl extends Object implements JavaMethod
INTERNAL:

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

Responsibilities:

  • Provide Method information from the underlying JMethod.
See Also:
  • Constructor Details

    • XJCJavaMethodImpl

      public XJCJavaMethodImpl(com.sun.codemodel.JMethod javaMethod, com.sun.codemodel.JCodeModel codeModel, DynamicClassLoader loader, JavaClass owner)
      Construct a new instance of XJCJavaMethodImpl.
      Parameters:
      javaMethod - - the XJC JMethod to be wrapped.
      codeModel - - the XJC JCodeModel this method belongs to.
      loader - - the ClassLoader used to bootstrap the DynamicJAXBContext.
      owner - - the JavaClass this method belongs to.
  • Method Details

    • getAnnotation

      public JavaAnnotation getAnnotation(JavaClass aClass)
      If this JavaMethod is annotated with an Annotation matching aClass, return its JavaAnnotation representation.
      Specified by:
      getAnnotation in interface JavaHasAnnotations
      Parameters:
      aClass - a JavaClass representing the Annotation to look for.
      Returns:
      the JavaAnnotation represented by aClass, if one exists, otherwise return null.
    • getAnnotations

      public Collection<JavaAnnotation> getAnnotations()
      Return all of the Annotations for this JavaMethod.
      Specified by:
      getAnnotations in interface JavaHasAnnotations
      Returns:
      A Collection containing this JavaMethod's JavaAnnotations.
    • getName

      public String getName()
      Returns the name of this JavaMethod.
      Specified by:
      getName in interface JavaMethod
      Returns:
      the String name of this JavaMethod.
    • getParameterTypes

      public JavaClass[] getParameterTypes()
      Returns the array of parameters for this JavaMethod.
      Specified by:
      getParameterTypes in interface JavaMethod
      Returns:
      a JavaClass[] representing the argument types for this method.
    • getResolvedType

      public JavaClass getResolvedType()
      Returns this JavaMethod's return type.
      Returns:
      a JavaClass representing the return type of this method.
    • getReturnType

      public JavaClass getReturnType()
      Returns this JavaMethod's return type.
      Specified by:
      getReturnType in interface JavaMethod
      Returns:
      a JavaClass representing the return type of this method.
    • hasActualTypeArguments

      public boolean hasActualTypeArguments()
      Indicates if this JavaMethod has actual type arguments, i.e. is a parameterized type (for example, List<Employee).
      Returns:
      true if this JavaClass is parameterized, otherwise false.
    • getActualTypeArguments

      public Collection<Object> getActualTypeArguments()
      Not supported.
    • getModifiers

      public int getModifiers()
      Returns the Java language modifiers for this JavaMethod, encoded in an integer.
      Specified by:
      getModifiers in interface JavaMethod
      Returns:
      the int representing the modifiers for this method.
      See Also:
    • isAbstract

      public boolean isAbstract()
      Indicates if this JavaMethod is abstract.
      Specified by:
      isAbstract in interface JavaMethod
      Returns:
      true if this JavaMethod is abstract, otherwise false.
    • isPrivate

      public boolean isPrivate()
      Indicates if this JavaMethod is private.
      Specified by:
      isPrivate in interface JavaMethod
      Returns:
      true if this JavaMethod is private, otherwise false.
    • isProtected

      public boolean isProtected()
      Indicates if this JavaMethod is protected.
      Specified by:
      isProtected in interface JavaMethod
      Returns:
      true if this JavaMethod is protected, otherwise false.
    • isPublic

      public boolean isPublic()
      Indicates if this JavaMethod is public.
      Specified by:
      isPublic in interface JavaMethod
      Returns:
      true if this JavaMethod is public, otherwise false.
    • isStatic

      public boolean isStatic()
      Indicates if this JavaMethod is static.
      Specified by:
      isStatic in interface JavaMethod
      Returns:
      true if this JavaMethod is static, otherwise false.
    • isFinal

      public boolean isFinal()
      Indicates if this JavaMethod is final.
      Specified by:
      isFinal in interface JavaMethod
      Returns:
      true if this JavaMethod is final, otherwise false.
    • isSynthetic

      public boolean isSynthetic()
      Not supported.
      Specified by:
      isSynthetic in interface JavaMethod
    • getDeclaredAnnotation

      public JavaAnnotation getDeclaredAnnotation(JavaClass arg0)
      Not supported.
      Specified by:
      getDeclaredAnnotation in interface JavaHasAnnotations
    • getDeclaredAnnotations

      public Collection<JavaAnnotation> getDeclaredAnnotations()
      Not supported.
      Specified by:
      getDeclaredAnnotations in interface JavaHasAnnotations
    • getOwningClass

      public JavaClass getOwningClass()
      Returns the JavaClass which contains this method.
      Specified by:
      getOwningClass in interface JavaMethod
      Returns:
      JavaClass representing the owner of this JavaMethod.
    • setOwningClass

      public void setOwningClass(JavaClass owningClass)
      Set the JavaClass which contains this method.
      Parameters:
      owningClass - the JavaClass representing the owner of this JavaMethod.
    • isBridge

      public boolean isBridge()
      Not supported.
      Specified by:
      isBridge in interface JavaMethod