Class JSONElementVisitor

  • All Implemented Interfaces:
    javax.lang.model.element.ElementVisitor<java.lang.Boolean,​java.lang.StringBuilder>
    Direct Known Subclasses:
    AnnotatedElementJSONElementVisitor

    public abstract class JSONElementVisitor
    extends javax.lang.model.util.ElementKindVisitor6<java.lang.Boolean,​java.lang.StringBuilder>
    ElementVisitor to assemble the JSON content
    Since:
    1.0.0
    Author:
    Mercy
    See Also:
    AbstractElementVisitor6
    • Field Summary

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

        DEFAULT_VALUE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean doVisitPackage​(javax.lang.model.element.PackageElement e, java.lang.StringBuilder jsonBuilder)
      Visits a package element and appends its JSON representation to the builder.
      protected boolean doVisitTypeParameter​(javax.lang.model.element.TypeParameterElement e, java.lang.StringBuilder jsonBuilder)
      Visits a type parameter element and appends its JSON representation to the builder.
      protected boolean supports​(javax.lang.model.element.Element e)
      Determines whether the specified element is supported for processing.
      protected boolean supportsExecutable​(javax.lang.model.element.ExecutableElement e)
      Determines whether the specified executable element is supported for processing.
      protected boolean supportsPackage​(javax.lang.model.element.PackageElement e)
      Determines whether the specified package element is supported for processing.
      protected boolean supportsType​(javax.lang.model.element.TypeElement e)
      Determines whether the specified type element is supported for processing.
      protected boolean supportsTypeParameter​(javax.lang.model.element.TypeParameterElement e)
      Determines whether the specified type parameter element is supported for processing.
      protected boolean supportsVariable​(javax.lang.model.element.VariableElement e)
      Determines whether the specified variable element is supported for processing.
      java.lang.Boolean visitExecutable​(javax.lang.model.element.ExecutableElement e, java.lang.StringBuilder jsonBuilder)  
      protected boolean visitMembers​(java.util.List<? extends javax.lang.model.element.Element> members, java.lang.StringBuilder jsonBuilder)  
      java.lang.Boolean visitPackage​(javax.lang.model.element.PackageElement e, java.lang.StringBuilder jsonBuilder)  
      java.lang.Boolean visitType​(javax.lang.model.element.TypeElement e, java.lang.StringBuilder jsonBuilder)  
      java.lang.Boolean visitTypeParameter​(javax.lang.model.element.TypeParameterElement e, java.lang.StringBuilder jsonBuilder)  
      java.lang.Boolean visitVariable​(javax.lang.model.element.VariableElement e, java.lang.StringBuilder stringBuilder)  
      • Methods inherited from class javax.lang.model.util.ElementKindVisitor6

        visitExecutableAsConstructor, visitExecutableAsInstanceInit, visitExecutableAsMethod, visitExecutableAsStaticInit, visitTypeAsAnnotationType, visitTypeAsClass, visitTypeAsEnum, visitTypeAsInterface, visitVariableAsEnumConstant, visitVariableAsExceptionParameter, visitVariableAsField, visitVariableAsLocalVariable, visitVariableAsParameter, visitVariableAsResourceVariable
      • Methods inherited from class javax.lang.model.util.SimpleElementVisitor6

        defaultAction
      • Methods inherited from class javax.lang.model.util.AbstractElementVisitor6

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

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

      • JSONElementVisitor

        public JSONElementVisitor()
    • Method Detail

      • visitPackage

        public final java.lang.Boolean visitPackage​(javax.lang.model.element.PackageElement e,
                                                    java.lang.StringBuilder jsonBuilder)
        Specified by:
        visitPackage in interface javax.lang.model.element.ElementVisitor<java.lang.Boolean,​java.lang.StringBuilder>
        Overrides:
        visitPackage in class javax.lang.model.util.ElementKindVisitor6<java.lang.Boolean,​java.lang.StringBuilder>
      • visitVariable

        public final java.lang.Boolean visitVariable​(javax.lang.model.element.VariableElement e,
                                                     java.lang.StringBuilder stringBuilder)
        Specified by:
        visitVariable in interface javax.lang.model.element.ElementVisitor<java.lang.Boolean,​java.lang.StringBuilder>
        Overrides:
        visitVariable in class javax.lang.model.util.ElementKindVisitor6<java.lang.Boolean,​java.lang.StringBuilder>
      • visitExecutable

        public final java.lang.Boolean visitExecutable​(javax.lang.model.element.ExecutableElement e,
                                                       java.lang.StringBuilder jsonBuilder)
        Specified by:
        visitExecutable in interface javax.lang.model.element.ElementVisitor<java.lang.Boolean,​java.lang.StringBuilder>
        Overrides:
        visitExecutable in class javax.lang.model.util.ElementKindVisitor6<java.lang.Boolean,​java.lang.StringBuilder>
      • visitType

        public final java.lang.Boolean visitType​(javax.lang.model.element.TypeElement e,
                                                 java.lang.StringBuilder jsonBuilder)
        Specified by:
        visitType in interface javax.lang.model.element.ElementVisitor<java.lang.Boolean,​java.lang.StringBuilder>
        Overrides:
        visitType in class javax.lang.model.util.ElementKindVisitor6<java.lang.Boolean,​java.lang.StringBuilder>
      • visitTypeParameter

        public final java.lang.Boolean visitTypeParameter​(javax.lang.model.element.TypeParameterElement e,
                                                          java.lang.StringBuilder jsonBuilder)
        Specified by:
        visitTypeParameter in interface javax.lang.model.element.ElementVisitor<java.lang.Boolean,​java.lang.StringBuilder>
        Overrides:
        visitTypeParameter in class javax.lang.model.util.ElementKindVisitor6<java.lang.Boolean,​java.lang.StringBuilder>
      • visitMembers

        protected boolean visitMembers​(java.util.List<? extends javax.lang.model.element.Element> members,
                                       java.lang.StringBuilder jsonBuilder)
      • supports

        protected boolean supports​(javax.lang.model.element.Element e)
        Determines whether the specified element is supported for processing.

        This method can be overridden to provide custom logic for deciding if an element should be processed by this visitor.

        Parameters:
        e - the element to check
        Returns:
        true if the element is supported; false otherwise
      • supportsPackage

        protected boolean supportsPackage​(javax.lang.model.element.PackageElement e)
        Determines whether the specified package element is supported for processing.

        This method can be overridden to provide custom logic for deciding if a package element should be processed by this visitor.

        Parameters:
        e - the package element to check
        Returns:
        true if the package element is supported; false otherwise
      • supportsVariable

        protected boolean supportsVariable​(javax.lang.model.element.VariableElement e)
        Determines whether the specified variable element is supported for processing.

        This method can be overridden to provide custom logic for deciding if a variable element should be processed by this visitor.

        Parameters:
        e - the variable element to check
        Returns:
        true if the variable element is supported; false otherwise
      • supportsExecutable

        protected boolean supportsExecutable​(javax.lang.model.element.ExecutableElement e)
        Determines whether the specified executable element is supported for processing.

        This method can be overridden to provide custom logic for deciding if an executable element should be processed by this visitor.

        Parameters:
        e - the executable element to check
        Returns:
        true if the executable element is supported; false otherwise
      • supportsType

        protected boolean supportsType​(javax.lang.model.element.TypeElement e)
        Determines whether the specified type element is supported for processing.

        This method can be overridden to provide custom logic for deciding if a type element should be processed by this visitor.

        Parameters:
        e - the type element to check
        Returns:
        true if the type element is supported; false otherwise
      • supportsTypeParameter

        protected boolean supportsTypeParameter​(javax.lang.model.element.TypeParameterElement e)
        Determines whether the specified type parameter element is supported for processing.

        This method can be overridden to provide custom logic for deciding if a type parameter element should be processed by this visitor.

        Parameters:
        e - the type parameter element to check
        Returns:
        true if the type parameter element is supported; false otherwise
      • doVisitPackage

        protected boolean doVisitPackage​(javax.lang.model.element.PackageElement e,
                                         java.lang.StringBuilder jsonBuilder)
        Visits a package element and appends its JSON representation to the builder.
        Parameters:
        e - the package element to visit
        jsonBuilder - the string builder used to construct the JSON output
        Returns:
        true if any content was appended; false otherwise
      • doVisitTypeParameter

        protected boolean doVisitTypeParameter​(javax.lang.model.element.TypeParameterElement e,
                                               java.lang.StringBuilder jsonBuilder)
        Visits a type parameter element and appends its JSON representation to the builder.
        Parameters:
        e - the type parameter element to visit
        jsonBuilder - the string builder used to construct the JSON output
        Returns:
        true if any content was appended; false otherwise