public interface ExprCompileContext
Modifier and Type | Field and Description |
---|---|
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. |
Modifier and Type | Method and Description |
---|---|
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.
|
java.lang.String |
getVariableType(java.lang.String name)
Return the type of the given variable.
|
boolean |
isCodeSource()
Indicates whether the compile source belongs to an ADF/BC code source.
|
boolean |
isMandatoryAttribute(java.lang.String name)
Returns whether the specified attribute 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) |
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.ExprDef getExprDef()
boolean isTypeChecked()
boolean isCodeSource()
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)
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)