Class SuperficialValidation


  • public final class SuperficialValidation
    extends java.lang.Object
    A utility class that traverses Element instances and ensures that all type information is present and resolvable.
    Author:
    Gregory Kick
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean validateElement​(javax.lang.model.element.Element element)
      Returns true if all types referenced by the given element are defined.
      static boolean validateElements​(java.lang.Iterable<? extends javax.lang.model.element.Element> elements)
      Returns true if all of the given elements return true from validateElement(Element).
      static boolean validateType​(javax.lang.model.type.TypeMirror type)
      Returns true if the given type is fully defined.
      • Methods inherited from class java.lang.Object

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

      • validateElements

        public static boolean validateElements​(java.lang.Iterable<? extends javax.lang.model.element.Element> elements)
        Returns true if all of the given elements return true from validateElement(Element).
      • validateElement

        public static boolean validateElement​(javax.lang.model.element.Element element)
        Returns true if all types referenced by the given element are defined. The exact meaning of this depends on the kind of element. For packages, it means that all annotations on the package are fully defined. For other element kinds, it means that types referenced by the element, anything it contains, and any of its annotations element are all defined.
      • validateType

        public static boolean validateType​(javax.lang.model.type.TypeMirror type)
        Returns true if the given type is fully defined. This means that the type itself is defined, as are any types it references, such as any type arguments or type bounds. For an ExecutableType, the parameter and return types must be fully defined, as must types declared in a throws clause or in the bounds of any type parameters.