Class Analyser.IsSubclassOfGeneratedTypeVisitor

  • All Implemented Interfaces:
    javax.lang.model.type.TypeVisitor<java.lang.Boolean,​java.lang.Void>
    Enclosing class:
    Analyser

    private static final class Analyser.IsSubclassOfGeneratedTypeVisitor
    extends javax.lang.model.util.SimpleTypeVisitor8<java.lang.Boolean,​java.lang.Void>
    Visitor that returns true if the visited type extends a generated superclass in the same package.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private QualifiedName superclass  
      private java.util.List<? extends javax.lang.model.element.TypeParameterElement> typeParameters  
      • Fields inherited from class javax.lang.model.util.SimpleTypeVisitor6

        DEFAULT_VALUE
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private IsSubclassOfGeneratedTypeVisitor​(QualifiedName superclass, java.util.List<? extends javax.lang.model.element.TypeParameterElement> typeParameters)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Boolean visitDeclared​(javax.lang.model.type.DeclaredType t, java.lang.Void p)
      However, with some setups (e.g.
      java.lang.Boolean visitError​(javax.lang.model.type.ErrorType t, java.lang.Void p)
      Any reference to the as-yet-ungenerated builder should be an unresolved ERROR.
      • Methods inherited from class javax.lang.model.util.SimpleTypeVisitor8

        visitIntersection
      • Methods inherited from class javax.lang.model.util.SimpleTypeVisitor7

        visitUnion
      • Methods inherited from class javax.lang.model.util.SimpleTypeVisitor6

        defaultAction, visitArray, visitExecutable, visitNoType, visitNull, visitPrimitive, visitTypeVariable, visitWildcard
      • Methods inherited from class javax.lang.model.util.AbstractTypeVisitor6

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

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

      • typeParameters

        private final java.util.List<? extends javax.lang.model.element.TypeParameterElement> typeParameters
    • Constructor Detail

      • IsSubclassOfGeneratedTypeVisitor

        private IsSubclassOfGeneratedTypeVisitor​(QualifiedName superclass,
                                                 java.util.List<? extends javax.lang.model.element.TypeParameterElement> typeParameters)
    • Method Detail

      • visitError

        public java.lang.Boolean visitError​(javax.lang.model.type.ErrorType t,
                                            java.lang.Void p)
        Any reference to the as-yet-ungenerated builder should be an unresolved ERROR. Similarly for many copy-and-paste errors
        Specified by:
        visitError in interface javax.lang.model.type.TypeVisitor<java.lang.Boolean,​java.lang.Void>
        Overrides:
        visitError in class javax.lang.model.util.SimpleTypeVisitor6<java.lang.Boolean,​java.lang.Void>
      • visitDeclared

        public java.lang.Boolean visitDeclared​(javax.lang.model.type.DeclaredType t,
                                               java.lang.Void p)
        However, with some setups (e.g. Eclipse+blaze), the builder may have already been generated and provided via a jar, in which case the reference will be DECLARED and qualified. We still want to generate it.
        Specified by:
        visitDeclared in interface javax.lang.model.type.TypeVisitor<java.lang.Boolean,​java.lang.Void>
        Overrides:
        visitDeclared in class javax.lang.model.util.SimpleTypeVisitor6<java.lang.Boolean,​java.lang.Void>