src/share/classes/sun/misc/JavaLangAccess.java

Print this page




  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.misc;
  27 
  28 import java.lang.annotation.Annotation;
  29 import java.lang.reflect.Executable;
  30 import sun.reflect.ConstantPool;
  31 import sun.reflect.annotation.AnnotationType;
  32 import sun.nio.ch.Interruptible;
  33 
  34 public interface JavaLangAccess {
  35     /** Return the constant pool for a class. */
  36     ConstantPool getConstantPool(Class<?> klass);
  37 
  38     /**
  39      * Set the AnnotationType instance corresponding to this class.
  40      * (This method only applies to annotation types.)
  41      */
  42     void setAnnotationType(Class<?> klass, AnnotationType annotationType);
  43 
  44     /**
  45      * Get the AnnotationType instance corresponding to this class.
  46      * (This method only applies to annotation types.)
  47      */
  48     AnnotationType getAnnotationType(Class<?> klass);






  49 
  50     /**
  51      * Get the array of bytes that is the class-file representation
  52      * of this Class' type annotations.
  53      */
  54     byte[] getRawClassTypeAnnotations(Class<?> klass);
  55 
  56     /**
  57      * Get the array of bytes that is the class-file representation
  58      * of this Executable's type annotations.
  59      */
  60     byte[] getRawExecutableTypeAnnotations(Executable executable);
  61 
  62     /**
  63      * Returns the elements of an enum class or null if the
  64      * Class object does not represent an enum type;
  65      * the result is uncloned, cached, and shared by all callers.
  66      */
  67     <E extends Enum<E>> E[] getEnumConstantsShared(Class<E> klass);
  68 




  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.misc;
  27 
  28 import java.lang.annotation.Annotation;
  29 import java.lang.reflect.Executable;
  30 import sun.reflect.ConstantPool;
  31 import sun.reflect.annotation.AnnotationType;
  32 import sun.nio.ch.Interruptible;
  33 
  34 public interface JavaLangAccess {
  35     /** Return the constant pool for a class. */
  36     ConstantPool getConstantPool(Class<?> klass);
  37 
  38     /**
  39      * Compare-And-Swap the AnnotationType instance corresponding to this class.
  40      * (This method only applies to annotation types.)
  41      */
  42     boolean casAnnotationType(Class<?> klass, AnnotationType oldType, AnnotationType newType);
  43 
  44     /**
  45      * Get the AnnotationType instance corresponding to this class.
  46      * (This method only applies to annotation types.)
  47      */
  48     AnnotationType getAnnotationType(Class<?> klass);
  49 
  50     /**
  51      * Get the array of bytes that is the class-file representation
  52      * of this Class' annotations.
  53      */
  54     byte[] getRawClassAnnotations(Class<?> klass);
  55 
  56     /**
  57      * Get the array of bytes that is the class-file representation
  58      * of this Class' type annotations.
  59      */
  60     byte[] getRawClassTypeAnnotations(Class<?> klass);
  61 
  62     /**
  63      * Get the array of bytes that is the class-file representation
  64      * of this Executable's type annotations.
  65      */
  66     byte[] getRawExecutableTypeAnnotations(Executable executable);
  67 
  68     /**
  69      * Returns the elements of an enum class or null if the
  70      * Class object does not represent an enum type;
  71      * the result is uncloned, cached, and shared by all callers.
  72      */
  73     <E extends Enum<E>> E[] getEnumConstantsShared(Class<E> klass);
  74