public class StackMachineCompiler extends Object implements Compiler
Compiler interface that generates opcodes used by the
StackMachine execution engine.
This implementation traverses that expression tree and generates a vector of opcodes using a reverse policy notation strategy .
| Constructor and Description |
|---|
StackMachineCompiler()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
Vector<Opcode> |
compile(X509Certificate cert,
PolicyExpression expression)
Compiles the given certificate and a parsed
PolicyExpression tree in a series of executables Opcode objects. |
Collection<String> |
getCompilationReport()
Gets a collection of compilation issues.
|
boolean |
isReportModeEnabled()
Indicates whether or not the compiler is in report mode.
|
void |
setReportModeEnabled(boolean reportMode)
Sets or removes the compiler from report mode.
|
public Vector<Opcode> compile(X509Certificate cert, PolicyExpression expression) throws PolicyProcessException
PolicyExpression tree in a series of executables Opcode objects.
Implementations should be thread same meaning multiple expressions can be compiled concurrently with the same compiler.
compile in interface Compilercert - The certificate that will be evaluated for policy compliance.expression - The parsed expression tree.Opcode objects that are fed into an ExecutionEngine for final evaluation of policy compliance.PolicyProcessException - Thrown if a required certificate attribute does not exist in the given certification. However, this exception
is suppressed if the compiler is placed into report model.public void setReportModeEnabled(boolean reportMode)
setReportModeEnabled in interface CompilerreportMode - true if the compiler is to be set into report mode. false otherwisepublic boolean isReportModeEnabled()
isReportModeEnabled in interface Compilerpublic Collection<String> getCompilationReport()
The collection is reset each time a compilation occurs. For concurrent compilation, the generated report is specific to the thread that compilation process was executed on.
getCompilationReport in interface CompilerCopyright © 2010-2016 The Direct Project. All Rights Reserved.