final class CommonAstSupport extends AbstractPatternWorker
The implementations of variables and user functions are contained within a
number of public, inner classes. They must be public in order for their
members to be accessible via reflection (without policy file changes). They
are registered just after construction with the AstSymbolResolver
provided by the PatternEngine. They are accessed by instances of
the Rule class via logical expressions at runtime.
| Modifier and Type | Class and Description |
|---|---|
class |
CommonAstSupport.Library
Implementation of basic symbol resolution and comparison-type user
function services specific to AST processing.
|
private static class |
CommonAstSupport.WorkArea
Context local work area.
|
| Modifier and Type | Field and Description |
|---|---|
private static ContextLocal<CommonAstSupport.WorkArea> |
context
Context local work area.
|
private PatternEngine |
engine
The engine which created this worker.
|
private static ConversionStatus |
LOG
Logger.
|
| Constructor and Description |
|---|
CommonAstSupport(PatternEngine engine)
Default constructor which defines the symbol libraries to be registered.
|
| Modifier and Type | Method and Description |
|---|---|
void |
finish()
Hook to provide termination processing for a pattern worker.
|
private java.lang.reflect.Constructor |
matchConstructor(java.lang.reflect.Constructor[] candidates,
java.lang.Class[] signature,
boolean strict)
Try to match a constructor from the list of candidates, based upon a
parameter signature.
|
static int |
resolveRuntimeAnnotationKey(java.lang.String key)
Resolve the numeric key for the specified annotation.
|
getCopy, getLibrary, getResolver, getSource, isConditionalRuleSets, isFlagActivated, isRuntimeQueryMode, registerTree, resolveConstant, setLibraryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitialize, leaveAst, visitAstprivate static final ConversionStatus LOG
private static final ContextLocal<CommonAstSupport.WorkArea> context
private final PatternEngine engine
CommonAstSupport(PatternEngine engine)
engine - The engine which created this worker.public static int resolveRuntimeAnnotationKey(java.lang.String key)
key - The string annotation.public void finish()
private java.lang.reflect.Constructor matchConstructor(java.lang.reflect.Constructor[] candidates,
java.lang.Class[] signature,
boolean strict)
candidates - An array of constructors from which to select a match.signature - The parameter signature to be matched among the candidate
constructors.strict - true to conduct a strict match of primitive
numeric arguments, else false. In a strict match,
a primitive, numeric parameter type (or its wrapper class
type) will match only the same primitive, numeric parameter
type (or its wrapper class type). In a non-strict match, any
primitive, numeric parameter type (or its wrapper class type)
will match any other primitive, numeric parameter type (or
its wrapper class type). The assumption in the non-strict case
is that with enough wrapping/unwrapping and casting, any
numeric type can be converted to any other numeric type
(though information may be lost in narrowing conversions).Constructor instance (if any), or
null if no match was found.java.lang.IllegalArgumentException - if more than one suitable matching constructor was detected
(indicating ambiguity).