Class JavaParserAnonymousClassDeclaration

java.lang.Object
com.github.javaparser.symbolsolver.logic.AbstractTypeDeclaration
com.github.javaparser.symbolsolver.logic.AbstractClassDeclaration
com.github.javaparser.symbolsolver.javaparsermodel.declarations.JavaParserAnonymousClassDeclaration
All Implemented Interfaces:
com.github.javaparser.resolution.declarations.AssociableToAST, com.github.javaparser.resolution.declarations.HasAccessSpecifier, com.github.javaparser.resolution.declarations.ResolvedClassDeclaration, com.github.javaparser.resolution.declarations.ResolvedDeclaration, com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration, com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration, com.github.javaparser.resolution.declarations.ResolvedTypeParametrizable, com.github.javaparser.resolution.logic.MethodResolutionCapability, MethodUsageResolutionCapability

public class JavaParserAnonymousClassDeclaration extends AbstractClassDeclaration implements MethodUsageResolutionCapability
An anonymous class declaration representation.
  • Field Summary

    Fields inherited from interface com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration

    breadthFirstFunc, depthFirstFunc, JAVA_IO_SERIALIZABLE, JAVA_LANG_COMPARABLE, JAVA_LANG_ENUM, JAVA_LANG_OBJECT, JAVA_LANG_RECORD
  • Constructor Summary

    Constructors
    Constructor
    Description
    JavaParserAnonymousClassDeclaration(com.github.javaparser.ast.expr.ObjectCreationExpr wrappedNode, com.github.javaparser.resolution.TypeSolver typeSolver)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.github.javaparser.ast.AccessSpecifier
     
    Optional<com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration>
     
    <T extends com.github.javaparser.ast.Node>
    List<T>
    findMembersOfKind(Class<T> memberClass)
     
    List<com.github.javaparser.resolution.declarations.ResolvedFieldDeclaration>
     
    List<com.github.javaparser.resolution.types.ResolvedReferenceType>
    getAncestors(boolean acceptIncompleteList)
     
     
    List<com.github.javaparser.resolution.declarations.ResolvedConstructorDeclaration>
     
    com.github.javaparser.resolution.Context
     
    Set<com.github.javaparser.resolution.declarations.ResolvedMethodDeclaration>
     
    List<com.github.javaparser.resolution.types.ResolvedReferenceType>
     
     
     
     
    Optional<com.github.javaparser.resolution.types.ResolvedReferenceType>
     
    com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
     
    List<com.github.javaparser.resolution.declarations.ResolvedTypeParameterDeclaration>
     
    boolean
     
    Set<com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration>
     
    boolean
    isAssignableBy(com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration other)
     
    boolean
    isAssignableBy(com.github.javaparser.resolution.types.ResolvedType type)
     
    protected com.github.javaparser.resolution.types.ResolvedReferenceType
    An implementation of the Object class.
    com.github.javaparser.resolution.model.SymbolReference<com.github.javaparser.resolution.declarations.ResolvedMethodDeclaration>
    solveMethod(String name, List<com.github.javaparser.resolution.types.ResolvedType> argumentsTypes, boolean staticOnly)
     
    Optional<com.github.javaparser.resolution.MethodUsage>
    solveMethodAsUsage(String name, List<com.github.javaparser.resolution.types.ResolvedType> argumentTypes, com.github.javaparser.resolution.Context invocationContext, List<com.github.javaparser.resolution.types.ResolvedType> typeParameters)
     
    Optional<com.github.javaparser.ast.Node>
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.github.javaparser.resolution.declarations.AssociableToAST

    toAst

    Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedClassDeclaration

    isClass

    Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedDeclaration

    asEnumConstant, asField, asMethod, asParameter, asTypePattern, isArrayLength, isEnumConstant, isField, isMethod, isParameter, isTypePattern, isVariable

    Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration

    asReferenceType, canBeAssignedTo, findTypeParameter, getAllAncestors, getAllAncestors, getAllMethods, getAllNonStaticFields, getAllStaticFields, getAncestors, getDeclaredAnnotation, getDeclaredAnnotations, getDeclaredFields, getField, getVisibleField, getVisibleFields, hasAnnotation, hasField, hasVisibleField, isFunctionalInterface, isInheritedAnnotation, isJavaLangEnum, isJavaLangObject, isJavaLangRecord, isReferenceType

    Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration

    asAnnotation, asEnum, asInterface, asRecord, asType, asTypeParameter, getId, getInternalType, hasInternalType, isAnnotation, isAnonymousClass, isEnum, isInterface, isRecord, isType, isTypeParameter

    Methods inherited from interface com.github.javaparser.resolution.declarations.ResolvedTypeParametrizable

    isGeneric
  • Constructor Details

    • JavaParserAnonymousClassDeclaration

      public JavaParserAnonymousClassDeclaration(com.github.javaparser.ast.expr.ObjectCreationExpr wrappedNode, com.github.javaparser.resolution.TypeSolver typeSolver)
  • Method Details

    • getSuperTypeDeclaration

      public com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration getSuperTypeDeclaration()
    • findMembersOfKind

      public <T extends com.github.javaparser.ast.Node> List<T> findMembersOfKind(Class<T> memberClass)
    • getContext

      public com.github.javaparser.resolution.Context getContext()
    • solveMethod

      public com.github.javaparser.resolution.model.SymbolReference<com.github.javaparser.resolution.declarations.ResolvedMethodDeclaration> solveMethod(String name, List<com.github.javaparser.resolution.types.ResolvedType> argumentsTypes, boolean staticOnly)
      Specified by:
      solveMethod in interface com.github.javaparser.resolution.logic.MethodResolutionCapability
    • solveMethodAsUsage

      public Optional<com.github.javaparser.resolution.MethodUsage> solveMethodAsUsage(String name, List<com.github.javaparser.resolution.types.ResolvedType> argumentTypes, com.github.javaparser.resolution.Context invocationContext, List<com.github.javaparser.resolution.types.ResolvedType> typeParameters)
      Specified by:
      solveMethodAsUsage in interface MethodUsageResolutionCapability
    • object

      protected com.github.javaparser.resolution.types.ResolvedReferenceType object()
      Description copied from class: AbstractClassDeclaration
      An implementation of the Object class.
      Specified by:
      object in class AbstractClassDeclaration
    • getSuperClass

      public Optional<com.github.javaparser.resolution.types.ResolvedReferenceType> getSuperClass()
      Specified by:
      getSuperClass in interface com.github.javaparser.resolution.declarations.ResolvedClassDeclaration
    • getInterfaces

      public List<com.github.javaparser.resolution.types.ResolvedReferenceType> getInterfaces()
      Specified by:
      getInterfaces in interface com.github.javaparser.resolution.declarations.ResolvedClassDeclaration
    • getConstructors

      public List<com.github.javaparser.resolution.declarations.ResolvedConstructorDeclaration> getConstructors()
      Specified by:
      getConstructors in interface com.github.javaparser.resolution.declarations.ResolvedClassDeclaration
      Specified by:
      getConstructors in interface com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
    • accessSpecifier

      public com.github.javaparser.ast.AccessSpecifier accessSpecifier()
      Specified by:
      accessSpecifier in interface com.github.javaparser.resolution.declarations.HasAccessSpecifier
    • getAncestors

      public List<com.github.javaparser.resolution.types.ResolvedReferenceType> getAncestors(boolean acceptIncompleteList)
      Specified by:
      getAncestors in interface com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
    • getAllFields

      public List<com.github.javaparser.resolution.declarations.ResolvedFieldDeclaration> getAllFields()
      Specified by:
      getAllFields in interface com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
    • getDeclaredMethods

      public Set<com.github.javaparser.resolution.declarations.ResolvedMethodDeclaration> getDeclaredMethods()
      Specified by:
      getDeclaredMethods in interface com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
    • isAssignableBy

      public boolean isAssignableBy(com.github.javaparser.resolution.types.ResolvedType type)
      Specified by:
      isAssignableBy in interface com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
    • isAssignableBy

      public boolean isAssignableBy(com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration other)
      Specified by:
      isAssignableBy in interface com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
    • hasDirectlyAnnotation

      public boolean hasDirectlyAnnotation(String qualifiedName)
      Specified by:
      hasDirectlyAnnotation in interface com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
    • getPackageName

      public String getPackageName()
      Specified by:
      getPackageName in interface com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
    • getClassName

      public String getClassName()
      Specified by:
      getClassName in interface com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
    • getQualifiedName

      public String getQualifiedName()
      Specified by:
      getQualifiedName in interface com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
    • internalTypes

      public Set<com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration> internalTypes()
      Specified by:
      internalTypes in interface com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
    • getName

      public String getName()
      Specified by:
      getName in interface com.github.javaparser.resolution.declarations.ResolvedDeclaration
    • getTypeParameters

      public List<com.github.javaparser.resolution.declarations.ResolvedTypeParameterDeclaration> getTypeParameters()
      Specified by:
      getTypeParameters in interface com.github.javaparser.resolution.declarations.ResolvedTypeParametrizable
    • containerType

      public Optional<com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration> containerType()
      Specified by:
      containerType in interface com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
    • toAst

      public Optional<com.github.javaparser.ast.Node> toAst()
      Specified by:
      toAst in interface com.github.javaparser.resolution.declarations.AssociableToAST