Class StatementContext<N extends Statement>

java.lang.Object
com.github.javaparser.symbolsolver.javaparsermodel.contexts.AbstractJavaParserContext<N>
com.github.javaparser.symbolsolver.javaparsermodel.contexts.StatementContext<N>
All Implemented Interfaces:
Context
Direct Known Subclasses:
BlockStmtContext, DoStatementContext, ForEachStatementContext, ForStatementContext, IfStatementContext, TryWithResourceContext, WhileStatementContext

public class StatementContext<N extends Statement> extends AbstractJavaParserContext<N>
  • Constructor Details

    • StatementContext

      public StatementContext(N wrappedNode, TypeSolver typeSolver)
  • Method Details

    • solveInBlock

      public static SymbolReference<? extends ResolvedValueDeclaration> solveInBlock(String name, TypeSolver typeSolver, Statement stmt)
    • solveInBlockAsValue

      public static Optional<Value> solveInBlockAsValue(String name, TypeSolver typeSolver, Statement stmt)
    • solveSymbolAsValue

      public Optional<Value> solveSymbolAsValue(String name)
      Description copied from interface: Context
      Used where a symbol is being used (e.g. solving x when used as an argument doubleThis(x), or calculation return x * 2;).
      Parameters:
      name - the variable / reference / identifier used.
      Returns:
      // FIXME: Better documentation on how this is different to solveSymbol()
    • solveWithAsValue

      protected Optional<Value> solveWithAsValue(SymbolDeclarator symbolDeclarator, String name)
      Overrides:
      solveWithAsValue in class AbstractJavaParserContext<N extends Statement>
    • solveSymbol

      public SymbolReference<? extends ResolvedValueDeclaration> solveSymbol(String name)
      Description copied from interface: Context
      Used where a symbol is being used (e.g. solving x when used as an argument doubleThis(x), or calculation return x * 2;).
      Parameters:
      name - the variable / reference / identifier used.
      Returns:
      // FIXME: Better documentation on how this is different to solveSymbolAsValue()
    • solveSymbol

      private SymbolReference<? extends ResolvedValueDeclaration> solveSymbol(String name, boolean iterateAdjacentStmts)
      Used where a symbol is being used (e.g. solving x when used as an argument doubleThis(x), or calculation return x * 2;).
      Parameters:
      name - the variable / reference / identifier used.
      iterateAdjacentStmts - flag to iterate adjacent statements, should be set to true except when calling itself in order to prevent revisiting already visited symbols.
      Returns:
      // FIXME: Better documentation on how this is different to solveSymbolAsValue()
    • solveMethod

      public SymbolReference<ResolvedMethodDeclaration> solveMethod(String name, List<ResolvedType> argumentsTypes, boolean staticOnly)
      Description copied from interface: Context
      We find the method declaration which is the best match for the given name and list of typeParametersValues.
    • getIntroducedTypePatterns

      public List<TypePatternExpr> getIntroducedTypePatterns()