Class Context


  • public final class Context
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Context()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void error​(java.lang.String message, java.lang.Object... args)  
      javax.lang.model.type.DeclaredType getType​(java.lang.Class<?> clazz, java.lang.Class<?>... typeParameters)  
      boolean isEnum​(javax.lang.model.type.TypeMirror type)
      Checks whether the given type is an enum type.
      boolean isSame​(javax.lang.model.type.TypeMirror type, java.lang.Class<?> clazz, java.lang.Class<?>... typeParameters)
      Checks whether the given type and class are the same after type erasure.
      javax.lang.model.type.TypeMirror tryBox​(javax.lang.model.type.TypeMirror type)
      Boxes the given type when it is a primitive and returns it unchanged if not.
      javax.lang.model.type.TypeMirror tryUnbox​(javax.lang.model.type.TypeMirror type)
      Unboxes the given type when possible and returns it unchanged if it is not a primitive wrapper.
      • Methods inherited from class java.lang.Object

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

      • Context

        public Context()
    • Method Detail

      • isSame

        public boolean isSame​(javax.lang.model.type.TypeMirror type,
                              java.lang.Class<?> clazz,
                              java.lang.Class<?>... typeParameters)
        Checks whether the given type and class are the same after type erasure.
      • isEnum

        public boolean isEnum​(javax.lang.model.type.TypeMirror type)
        Checks whether the given type is an enum type.
      • tryUnbox

        public javax.lang.model.type.TypeMirror tryUnbox​(javax.lang.model.type.TypeMirror type)
        Unboxes the given type when possible and returns it unchanged if it is not a primitive wrapper.
      • tryBox

        public javax.lang.model.type.TypeMirror tryBox​(javax.lang.model.type.TypeMirror type)
        Boxes the given type when it is a primitive and returns it unchanged if not.
      • getType

        public javax.lang.model.type.DeclaredType getType​(java.lang.Class<?> clazz,
                                                          java.lang.Class<?>... typeParameters)
      • error

        public void error​(java.lang.String message,
                          java.lang.Object... args)