Class JavaParserInterfaceDeclaration

java.lang.Object
com.github.javaparser.symbolsolver.logic.AbstractTypeDeclaration
com.github.javaparser.symbolsolver.javaparsermodel.declarations.JavaParserInterfaceDeclaration
All Implemented Interfaces:
com.github.javaparser.resolution.declarations.AssociableToAST, com.github.javaparser.resolution.declarations.HasAccessSpecifier, com.github.javaparser.resolution.declarations.ResolvedDeclaration, com.github.javaparser.resolution.declarations.ResolvedInterfaceDeclaration, 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, SymbolResolutionCapability

public class JavaParserInterfaceDeclaration extends AbstractTypeDeclaration implements com.github.javaparser.resolution.declarations.ResolvedInterfaceDeclaration, com.github.javaparser.resolution.logic.MethodResolutionCapability, MethodUsageResolutionCapability, SymbolResolutionCapability
Author:
Federico Tomassetti
  • 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
    JavaParserInterfaceDeclaration(com.github.javaparser.ast.body.ClassOrInterfaceDeclaration wrappedNode, com.github.javaparser.resolution.TypeSolver typeSolver)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.github.javaparser.ast.AccessSpecifier
     
    com.github.javaparser.resolution.declarations.ResolvedInterfaceDeclaration
     
    boolean
    canBeAssignedTo(com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration other)
     
    Optional<com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration>
     
    boolean
     
    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.ResolvedAnnotationDeclaration>
     
    Set<com.github.javaparser.resolution.declarations.ResolvedMethodDeclaration>
     
    List<com.github.javaparser.resolution.types.ResolvedReferenceType>
     
     
     
     
    List<com.github.javaparser.resolution.declarations.ResolvedTypeParameterDeclaration>
     
    com.github.javaparser.resolution.types.ResolvedType
    getUsage(com.github.javaparser.ast.Node node)
     
    com.github.javaparser.ast.body.ClassOrInterfaceDeclaration
    Returns the JavaParser node associated with this JavaParserInterfaceDeclaration.
    boolean
     
    int
     
    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)
     
    boolean
     
    boolean
     
    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)
     
    com.github.javaparser.resolution.model.SymbolReference<? extends com.github.javaparser.resolution.declarations.ResolvedValueDeclaration>
    solveSymbol(String name, com.github.javaparser.resolution.TypeSolver typeSolver)
     
    com.github.javaparser.resolution.model.SymbolReference<com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration>
    Deprecated.
    Optional<com.github.javaparser.ast.Node>
     
     

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

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

    toAst

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

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

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

    getAllInterfacesExtended

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

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

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

    asAnnotation, asClass, asEnum, asRecord, asType, asTypeParameter, getId, getInternalType, hasInternalType, isAnnotation, isAnonymousClass, isClass, isEnum, isRecord, isType

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

    isGeneric
  • Constructor Details

    • JavaParserInterfaceDeclaration

      public JavaParserInterfaceDeclaration(com.github.javaparser.ast.body.ClassOrInterfaceDeclaration wrappedNode, com.github.javaparser.resolution.TypeSolver typeSolver)
  • Method Details

    • getDeclaredMethods

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

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

      public com.github.javaparser.resolution.types.ResolvedType getUsage(com.github.javaparser.ast.Node node)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getName

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

      public com.github.javaparser.resolution.declarations.ResolvedInterfaceDeclaration asInterface()
      Specified by:
      asInterface in interface com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
    • hasDirectlyAnnotation

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

      public Set<com.github.javaparser.resolution.declarations.ResolvedAnnotationDeclaration> getDeclaredAnnotations()
      Specified by:
      getDeclaredAnnotations in interface com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration
    • isInterface

      public boolean isInterface()
      Specified by:
      isInterface in interface com.github.javaparser.resolution.declarations.ResolvedInterfaceDeclaration
      Specified by:
      isInterface in interface com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
    • getInterfacesExtended

      public List<com.github.javaparser.resolution.types.ResolvedReferenceType> getInterfacesExtended()
      Specified by:
      getInterfacesExtended in interface com.github.javaparser.resolution.declarations.ResolvedInterfaceDeclaration
    • 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
    • isAssignableBy

      public boolean isAssignableBy(com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration other)
      Specified by:
      isAssignableBy 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
    • canBeAssignedTo

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

      public boolean isTypeParameter()
      Specified by:
      isTypeParameter in interface com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration
    • getAllFields

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

      public String toString()
      Overrides:
      toString in class Object
    • solveType

      @Deprecated public com.github.javaparser.resolution.model.SymbolReference<com.github.javaparser.resolution.declarations.ResolvedTypeDeclaration> solveType(String name)
      Deprecated.
      This method is deprecated because it receives the TypesSolver as a parameter. Eventually we would like to remove all usages of TypeSolver as a parameter. Also, resolution should move out of declarations, so that they are pure declarations and the resolution should work for JavaParser, Reflection and Javassist classes in the same way and not be specific to the three implementations.
    • 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
    • solveSymbol

      public com.github.javaparser.resolution.model.SymbolReference<? extends com.github.javaparser.resolution.declarations.ResolvedValueDeclaration> solveSymbol(String name, com.github.javaparser.resolution.TypeSolver typeSolver)
      Specified by:
      solveSymbol in interface SymbolResolutionCapability
      Parameters:
      name - Field / symbol name.
      typeSolver - Symbol solver to resolve type usage.
      Returns:
      Symbol reference of the resolved value.
    • getAncestors

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

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

      public com.github.javaparser.ast.body.ClassOrInterfaceDeclaration getWrappedNode()
      Returns the JavaParser node associated with this JavaParserInterfaceDeclaration.
      Returns:
      A visitable JavaParser node wrapped by this object.
    • accessSpecifier

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

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

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

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

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