Interface IJavaPredicate
- All Superinterfaces:
IJavaElement
,IJavaExpression
Java AST interface to represent a Java predicate. A predicate is a boolean expression that
evaluates to true or false.
Note: Currently, logical expressions using non short-circuiting operators OR (|), AND (&), or XOR(^) are not allowed.
-
Field Summary
Fields inherited from interface com.pnfsoftware.jeb.core.units.code.java.IJavaElement
FLAG_BUILT, FLAG_FIELD_REFERENCES_OUTERCLASS, FLAG_LAMBDA_CLASS, FLAG_LAMBDA_IMPL, FLAG_OPTIONAL_RENDERING, FLAG_SECOND_PARAMETER_IS_OUTER_REF, FLAG_STICKY
-
Method Summary
Modifier and TypeMethodDescriptionDuplicate this element.boolean
Determine if the predicate represents the simple literal value 'false' (null IDENT 'false'
).boolean
Determine if the predicate represents the simple literal value 'true' (null IDENT 'true'
).void
Reverse the predicate.void
setExpression
(IJavaExpression expression) Methods inherited from interface com.pnfsoftware.jeb.core.units.code.java.IJavaElement
addFlags, addTag, canCauseException, collectAllPhysicalOffsets, generate, getData, getElementType, getFlags, getOrigin, getPhysicalMethodIndex, getPhysicalOffset, getReconAnon, getReconEnum, getReconEnummap, getReconLambda, getSubElements, getTags, hasFlags, hasPhysicalMethodIndex, hasPhysicalOffset, isReconArtifact, removeFlags, removeTag, replaceSubElement, setData, setFlags, setLambdaRecon, setOrigin, setPhysicalMethodIndex, setPhysicalOffset, setReconAnon, setReconEnum, setReconEnummap, toShortString, visitDepthPost, visitDepthPost, visitDepthPost, visitDepthPost, visitDepthPre, visitDepthPre, visitDepthPre
-
Method Details
-
getExpression
IJavaExpression getExpression()- Returns:
-
setExpression
- Parameters:
expression
-
-
isLitteralTrue
boolean isLitteralTrue()Determine if the predicate represents the simple literal value 'true' (null IDENT 'true'
).- Returns:
- true if the predicate represents the literal true
-
isLitteralFalse
boolean isLitteralFalse()Determine if the predicate represents the simple literal value 'false' (null IDENT 'false'
).- Returns:
- true if the predicate represents the literal false
-
reverse
Reverse the predicate. Example: "x == 3" becomes "x != 3". -
duplicateAndReverse
- Parameters:
of
-- Returns:
-
duplicate
IJavaPredicate duplicate()Description copied from interface:IJavaElement
Duplicate this element.- Specified by:
duplicate
in interfaceIJavaElement
- Specified by:
duplicate
in interfaceIJavaExpression
- Returns:
- a (possibly) duplicated object of the same type
-