Class IfStatementContext
java.lang.Object
com.github.javaparser.symbolsolver.javaparsermodel.contexts.AbstractJavaParserContext<com.github.javaparser.ast.stmt.IfStmt>
com.github.javaparser.symbolsolver.javaparsermodel.contexts.StatementContext<com.github.javaparser.ast.stmt.IfStmt>
com.github.javaparser.symbolsolver.javaparsermodel.contexts.IfStatementContext
- All Implemented Interfaces:
com.github.javaparser.resolution.Context
-
Field Summary
Fields inherited from class AbstractJavaParserContext
typeSolver, wrappedNode -
Constructor Summary
ConstructorsConstructorDescriptionIfStatementContext(com.github.javaparser.ast.stmt.IfStmt wrappedNode, com.github.javaparser.resolution.TypeSolver typeSolver) -
Method Summary
Modifier and TypeMethodDescriptionList<com.github.javaparser.ast.expr.TypePatternExpr> The following rules apply to a statement if (e) S: - A pattern variable is introduced by if (e) S iff (i) it is introduced by e when false and (ii) S cannot complete normally.booleannodeContextIsChainedIfElseIf(com.github.javaparser.resolution.Context parentContext) if() { // Does not match here (doesn't need to, as stuff inside of the if() is likely in context..) } else if() { // Matches here } else { // Matches here }booleannodeContextIsConditionOfIfStmt(com.github.javaparser.resolution.Context parentContext) booleannodeContextIsImmediateChildElse(com.github.javaparser.resolution.Context parentContext) if() { // Does not match here (doesn't need to, as stuff inside of the if() is likely in context..) } else { // Does not match here, as the else block is a field inside of an ifstmt as opposed to child }booleannodeContextIsThenOfIfStmt(com.github.javaparser.resolution.Context parentContext) if() { // Does not match here (doesn't need to, as stuff inside of the if() is likely in context..) } else { // Does not match here, as the else block is a field inside of an ifstmt as opposed to child }List<com.github.javaparser.ast.expr.TypePatternExpr> typePatternExprsExposedToChild(com.github.javaparser.ast.Node child) The following rules apply to a statement if (e) S: - A pattern variable introduced by e when true is definitely matched at S.Methods inherited from class StatementContext
solveInBlock, solveInBlockAsValue, solveMethod, solveSymbol, solveSymbolAsValue, solveWithAsValueMethods inherited from class AbstractJavaParserContext
equals, findExposedPatternInParentContext, findTypeDeclarations, getParent, getScope, getWrappedNode, hashCode, negatedTypePatternExprsExposedFromChildren, solveMethodAsUsage, solveSymbolInParentContext, solveWith, typePatternExprsDiscoveredInPattern, typePatternExprsExposedFromChildrenMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.github.javaparser.resolution.Context
fieldDeclarationInScope, fieldsExposedToChild, localVariableDeclarationInScope, localVariablesExposedToChild, parameterDeclarationInScope, parametersExposedToChild, solveConstructor, solveGenericType, solveGenericTypeInParentContext, solveMethodInParentContext, solveSymbolAsValueInParentContext, solveType, solveType, solveTypeInParentContext, solveTypeInParentContext, typePatternExprInScope
-
Constructor Details
-
IfStatementContext
public IfStatementContext(com.github.javaparser.ast.stmt.IfStmt wrappedNode, com.github.javaparser.resolution.TypeSolver typeSolver)
-
-
Method Details
-
typePatternExprsExposedToChild
public List<com.github.javaparser.ast.expr.TypePatternExpr> typePatternExprsExposedToChild(com.github.javaparser.ast.Node child) The following rules apply to a statement if (e) S: - A pattern variable introduced by e when true is definitely matched at S. The following rules apply to a statement if (e) S else T: - A pattern variable introduced by e when true is definitely matched at S. - A pattern variable introduced by e when false is definitely matched at T. https://docs.oracle.com/javase/specs/jls/se22/html/jls-6.html#jls-6.3.2.2 -
getIntroducedTypePatterns
The following rules apply to a statement if (e) S: - A pattern variable is introduced by if (e) S iff (i) it is introduced by e when false and (ii) S cannot complete normally. The following rules apply to a statement if (e) S else T: - A pattern variable is introduced by if (e) S else T iff either: - It is introduced by e when true, and S can complete normally, and T cannot complete normally; or - It is introduced by e when false, and S cannot complete normally, and T can complete normally.- Overrides:
getIntroducedTypePatternsin classStatementContext<com.github.javaparser.ast.stmt.IfStmt>
-
nodeContextIsChainedIfElseIf
public boolean nodeContextIsChainedIfElseIf(com.github.javaparser.resolution.Context parentContext) if() { // Does not match here (doesn't need to, as stuff inside of the if() is likely in context..) } else if() { // Matches here } else { // Matches here }- Returns:
- true, If this is an if inside of an if...
-
nodeContextIsImmediateChildElse
public boolean nodeContextIsImmediateChildElse(com.github.javaparser.resolution.Context parentContext) if() { // Does not match here (doesn't need to, as stuff inside of the if() is likely in context..) } else { // Does not match here, as the else block is a field inside of an ifstmt as opposed to child }- Returns:
- true, If this is an else inside of an if...
-
nodeContextIsThenOfIfStmt
public boolean nodeContextIsThenOfIfStmt(com.github.javaparser.resolution.Context parentContext) if() { // Does not match here (doesn't need to, as stuff inside of the if() is likely in context..) } else { // Does not match here, as the else block is a field inside of an ifstmt as opposed to child }- Returns:
- true, If this is an else inside of an if...
-
nodeContextIsConditionOfIfStmt
public boolean nodeContextIsConditionOfIfStmt(com.github.javaparser.resolution.Context parentContext)
-