|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.9.1) E67681-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ExprCompileContext
Provides context about the groovy expression that is currently compiling. A compiler extension may acquire the ExprCompileContext from the ExprEval during compilation. Note that a compile context is not available when the compiler is not running. The compile context may be used to provide additional information to the compiler about the cpmpiling groovy expression/operation. For example, the ADF type checked extension uses the compiler context to provide more information about variables that are defined by the context.
Field Summary | |
---|---|
static java.lang.String |
GLOBAL_RECEIVER_NAME Used by {@link #getMethodReturnType(String, String, String[], String[]). |
static java.lang.String |
UNKNOWN_PARAMETER_TYPE_NAME |
static java.lang.String |
VOID_RETURN_TYPE May be returned from getMethodReturnType to indicate that the method is recognized, but returns void. |
Method Summary | |
---|---|
org.codehaus.groovy.control.ErrorCollector |
getErrorCollector() Returns the error collector that was used during type checking. |
ExprDef |
getExprDef() Return the definition of the expressio that is compiling. |
ExprTrustSupplier |
getExprTrustSupplier() Return the security policiy that is associated with this context. |
ExprCompileContext |
getExtendedType() Return a compile context to type an unhandled variable/property/method that is defined within the context of another variable/property/method. |
java.lang.String |
getGlobalOperationReturnType(java.lang.String name, java.lang.String... argtypes) Return the type of the given global operations. |
java.lang.String |
getMethodReturnType(java.lang.String receiverType, java.lang.String name, java.lang.String[] argtypes, java.lang.String[] argvals) Return the return type of the given method. |
java.lang.String |
getPropertyType(java.lang.String objectType, java.lang.String name) Return the type of the given property. |
StructureDefinition |
getStructureDefinition() Return the oracle.binding.meta.StructureDefnition of the compile context. |
java.lang.String |
getVariableType(java.lang.String name) Return the type of the given variable. |
boolean |
isMandatoryAttribute(java.lang.String name) Deprecated. since 11.1.1.7.1 This should be available as a property of the AttributeDefinition that is retrieved from the compile context's StructureDefinition. See oracle.adf.model.utils.JSR227Util.IS_MANDATORY . |
boolean |
isRowAttribute(java.lang.String name) Returns whether the variable resolves to an row attribute. |
boolean |
isTypeChecked() Returns whether type checking should be performed in this compile context. |
void |
setCurrentASTNode(org.codehaus.groovy.ast.ASTNode node) |
void |
setCurrentNode(org.codehaus.groovy.ast.MethodNode method) |
void |
setErrorCollector(org.codehaus.groovy.control.ErrorCollector errorCollector) |
void |
setTypeCheckerClassLoader(java.lang.ClassLoader classLoader) |
Field Detail |
---|
static final java.lang.String UNKNOWN_PARAMETER_TYPE_NAME
static final java.lang.String VOID_RETURN_TYPE
getMethodReturnType
to indicate that the method is recognized, but returns void.
static final java.lang.String GLOBAL_RECEIVER_NAME
Method Detail |
---|
ExprDef getExprDef()
StructureDefinition getStructureDefinition()
oracle.binding.meta.StructureDefnition
of the compile context. For example, when compiling an entity validation rule this should return the StructureDefinition of the entity.boolean isTypeChecked()
java.lang.String getPropertyType(java.lang.String objectType, java.lang.String name)
Invoked by the type checker if it cannot resolve the specifid property.
java.lang.String getVariableType(java.lang.String name)
Invoked by the type checker if it cannot resolve the specified variable.
boolean isRowAttribute(java.lang.String name)
Invoked by the type checker to perform additional validation of attribute variables.
boolean isMandatoryAttribute(java.lang.String name)
AttributeDefinition
that is retrieved from the compile context's StructureDefinition. See oracle.adf.model.utils.JSR227Util.IS_MANDATORY
.java.lang.String getMethodReturnType(java.lang.String receiverType, java.lang.String name, java.lang.String[] argtypes, java.lang.String[] argvals)
Invoked by the type checker if it cannot resolve the specified method.
java.lang.String getGlobalOperationReturnType(java.lang.String name, java.lang.String... argtypes)
ExprTrustSupplier getExprTrustSupplier()
ExprCompileContext getExtendedType()
This will be invoked once by the type checker after it resolves an unhandled variable/property/method. This method may be used to pass a compile context back to the compile context that will be invoked later to handle types in the enclosing context.
For example, consider an expression that is evaluated in the context of an Emp validator: Dept.Loc
where 'Dept' is defined as an accessor that references the Emp's department.
When the compile context is asked for the java type of the 'Dept' variable (i.e. 'oracle.jbo.Row') an extended type may also be defined by instantiating a new compile context for the 'Dept' structure and returning that when the type checker invokes getExtendedType. The ADF type checking extension will store the extended type with the returned java type. When the 'Loc' property is later typed the type checker will query the 'Dept' variable extended data rather than the base script context.
org.codehaus.groovy.control.ErrorCollector getErrorCollector()
Applications may use the ErrorCollector to get a list of errors/warnings that were discovered during type checking.
void setErrorCollector(org.codehaus.groovy.control.ErrorCollector errorCollector)
void setCurrentNode(org.codehaus.groovy.ast.MethodNode method)
void setCurrentASTNode(org.codehaus.groovy.ast.ASTNode node)
void setTypeCheckerClassLoader(java.lang.ClassLoader classLoader)
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.9.1) E67681-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |