Class TypeSimplifier

  • All Implemented Interfaces:
    javax.lang.model.type.TypeVisitor<javax.lang.model.type.TypeMirror,​State>

    public class TypeSimplifier
    extends javax.lang.model.util.SimpleTypeVisitor6<javax.lang.model.type.TypeMirror,​State>
    Utility type for reducing complex type declarations to ones suitable for determining assignability based on RequestFactory's type-mapping semantics.

    Rules:

    • primitive type -> boxed type (optional)
    • void -> Void (optional)
    • <T extends Foo> -> Foo
    • ? extends Foo -> Foo
    • Foo<complex type> -> Foo<simplified type>
    • Field Summary

      • Fields inherited from class javax.lang.model.util.SimpleTypeVisitor6

        DEFAULT_VALUE
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected javax.lang.model.type.TypeMirror defaultAction​(javax.lang.model.type.TypeMirror x, State state)  
      static javax.lang.model.type.TypeMirror simplify​(javax.lang.model.type.TypeMirror toBox, boolean boxPrimitives, State state)  
      javax.lang.model.type.TypeMirror visitDeclared​(javax.lang.model.type.DeclaredType x, State state)  
      javax.lang.model.type.TypeMirror visitNoType​(javax.lang.model.type.NoType x, State state)  
      javax.lang.model.type.TypeMirror visitPrimitive​(javax.lang.model.type.PrimitiveType x, State state)  
      javax.lang.model.type.TypeMirror visitTypeVariable​(javax.lang.model.type.TypeVariable x, State state)  
      javax.lang.model.type.TypeMirror visitWildcard​(javax.lang.model.type.WildcardType x, State state)  
      • Methods inherited from class javax.lang.model.util.SimpleTypeVisitor6

        visitArray, visitError, visitExecutable, visitNull
      • Methods inherited from class javax.lang.model.util.AbstractTypeVisitor6

        visit, visit, visitIntersection, visitUnion, visitUnknown
      • Methods inherited from class java.lang.Object

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

      • simplify

        public static javax.lang.model.type.TypeMirror simplify​(javax.lang.model.type.TypeMirror toBox,
                                                                boolean boxPrimitives,
                                                                State state)
      • visitDeclared

        public javax.lang.model.type.TypeMirror visitDeclared​(javax.lang.model.type.DeclaredType x,
                                                              State state)
        Specified by:
        visitDeclared in interface javax.lang.model.type.TypeVisitor<javax.lang.model.type.TypeMirror,​State>
        Overrides:
        visitDeclared in class javax.lang.model.util.SimpleTypeVisitor6<javax.lang.model.type.TypeMirror,​State>
      • visitNoType

        public javax.lang.model.type.TypeMirror visitNoType​(javax.lang.model.type.NoType x,
                                                            State state)
        Specified by:
        visitNoType in interface javax.lang.model.type.TypeVisitor<javax.lang.model.type.TypeMirror,​State>
        Overrides:
        visitNoType in class javax.lang.model.util.SimpleTypeVisitor6<javax.lang.model.type.TypeMirror,​State>
      • visitPrimitive

        public javax.lang.model.type.TypeMirror visitPrimitive​(javax.lang.model.type.PrimitiveType x,
                                                               State state)
        Specified by:
        visitPrimitive in interface javax.lang.model.type.TypeVisitor<javax.lang.model.type.TypeMirror,​State>
        Overrides:
        visitPrimitive in class javax.lang.model.util.SimpleTypeVisitor6<javax.lang.model.type.TypeMirror,​State>
      • visitTypeVariable

        public javax.lang.model.type.TypeMirror visitTypeVariable​(javax.lang.model.type.TypeVariable x,
                                                                  State state)
        Specified by:
        visitTypeVariable in interface javax.lang.model.type.TypeVisitor<javax.lang.model.type.TypeMirror,​State>
        Overrides:
        visitTypeVariable in class javax.lang.model.util.SimpleTypeVisitor6<javax.lang.model.type.TypeMirror,​State>
      • visitWildcard

        public javax.lang.model.type.TypeMirror visitWildcard​(javax.lang.model.type.WildcardType x,
                                                              State state)
        Specified by:
        visitWildcard in interface javax.lang.model.type.TypeVisitor<javax.lang.model.type.TypeMirror,​State>
        Overrides:
        visitWildcard in class javax.lang.model.util.SimpleTypeVisitor6<javax.lang.model.type.TypeMirror,​State>
      • defaultAction

        protected javax.lang.model.type.TypeMirror defaultAction​(javax.lang.model.type.TypeMirror x,
                                                                 State state)
        Overrides:
        defaultAction in class javax.lang.model.util.SimpleTypeVisitor6<javax.lang.model.type.TypeMirror,​State>