Class JavaParserVariableDeclaration

  • All Implemented Interfaces:
    com.github.javaparser.resolution.declarations.AssociableToAST, com.github.javaparser.resolution.declarations.ResolvedDeclaration, com.github.javaparser.resolution.declarations.ResolvedValueDeclaration

    public class JavaParserVariableDeclaration
    extends Object
    implements com.github.javaparser.resolution.declarations.ResolvedValueDeclaration
    Author:
    Federico Tomassetti
    • Constructor Summary

      Constructors 
      Constructor Description
      JavaParserVariableDeclaration​(com.github.javaparser.ast.body.VariableDeclarator variableDeclarator, com.github.javaparser.resolution.TypeSolver typeSolver)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      String getName()  
      com.github.javaparser.resolution.types.ResolvedType getType()  
      com.github.javaparser.ast.body.VariableDeclarator getVariableDeclarator()  
      com.github.javaparser.ast.expr.VariableDeclarationExpr getWrappedNode()
      Returns the JavaParser node associated with this JavaParserFieldDeclaration.
      boolean isVariable()  
      Optional<com.github.javaparser.ast.Node> toAst()  
      String toString()  
      • 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, asType, asTypePattern, hasName, isEnumConstant, isField, isMethod, isParameter, isType, isTypePattern
    • Constructor Detail

      • JavaParserVariableDeclaration

        public JavaParserVariableDeclaration​(com.github.javaparser.ast.body.VariableDeclarator variableDeclarator,
                                             com.github.javaparser.resolution.TypeSolver typeSolver)
    • Method Detail

      • getType

        public com.github.javaparser.resolution.types.ResolvedType getType()
        Specified by:
        getType in interface com.github.javaparser.resolution.declarations.ResolvedValueDeclaration
      • getName

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

        public boolean isVariable()
        Specified by:
        isVariable in interface com.github.javaparser.resolution.declarations.ResolvedDeclaration
      • getWrappedNode

        public com.github.javaparser.ast.expr.VariableDeclarationExpr getWrappedNode()
        Returns the JavaParser node associated with this JavaParserFieldDeclaration.
        Returns:
        A visitable JavaParser node wrapped by this object.
      • getVariableDeclarator

        public com.github.javaparser.ast.body.VariableDeclarator getVariableDeclarator()
      • toAst

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