Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.9.1)

E67681-01


oracle.jbo
Interface ExprCompileContext

All Known Implementing Classes:
AbstractCompileContext, AbstractCompileContext.UntypedExtendedType, DefaultCompileContext, EvaluateExprCompileContextImpl

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.

Since:
release specific (what release of product did this appear in)

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

UNKNOWN_PARAMETER_TYPE_NAME

static final java.lang.String UNKNOWN_PARAMETER_TYPE_NAME
See Also:
Constant Field Values

VOID_RETURN_TYPE

static final java.lang.String VOID_RETURN_TYPE
May be returned from getMethodReturnType to indicate that the method is recognized, but returns void.
See Also:
Constant Field Values

GLOBAL_RECEIVER_NAME

static final java.lang.String GLOBAL_RECEIVER_NAME
Used by {@link #getMethodReturnType(String, String, String[], String[]). Indicates that the receiver is a global utility function.
See Also:
Constant Field Values

Method Detail

getExprDef

ExprDef getExprDef()
Return the definition of the expressio that is compiling.

getStructureDefinition

StructureDefinition getStructureDefinition()
Return the oracle.binding.meta.StructureDefnition of the compile context. For example, when compiling an entity validation rule this should return the StructureDefinition of the entity.

isTypeChecked

boolean isTypeChecked()
Returns whether type checking should be performed in this compile context.

getPropertyType

java.lang.String getPropertyType(java.lang.String objectType,
                                 java.lang.String name)
Return the type of the given property.

Invoked by the type checker if it cannot resolve the specifid property.


getVariableType

java.lang.String getVariableType(java.lang.String name)
Return the type of the given variable.

Invoked by the type checker if it cannot resolve the specified variable.


isRowAttribute

boolean isRowAttribute(java.lang.String name)
Returns whether the variable resolves to an row attribute.

Invoked by the type checker to perform additional validation of attribute variables.


isMandatoryAttribute

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.
Returns whether the specified attribute is mandatory. The compiler may use this information to perform special checking for the attribute. For example, the compiler will not log warnings for mandatory attribute access that is not null protected.

getMethodReturnType

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.

Invoked by the type checker if it cannot resolve the specified method.


getGlobalOperationReturnType

java.lang.String getGlobalOperationReturnType(java.lang.String name,
                                              java.lang.String... argtypes)
Return the type of the given global operations.

getExprTrustSupplier

ExprTrustSupplier getExprTrustSupplier()
Return the security policiy that is associated with this context.

getExtendedType

ExprCompileContext getExtendedType()
Return a compile context to type an unhandled variable/property/method that is defined within the context of another variable/property/method.

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.

Returns:
an ExprCompileContext that may be used to further type a variable, property, or method. The extended data should be reset after each call to getExtendedData.

getErrorCollector

org.codehaus.groovy.control.ErrorCollector getErrorCollector()
Returns the error collector that was used during type checking. This is set by the type checker and will not be available until after the type checking phase is complete.

Applications may use the ErrorCollector to get a list of errors/warnings that were discovered during type checking.


setErrorCollector

void setErrorCollector(org.codehaus.groovy.control.ErrorCollector errorCollector)
For internal use only. Application developers should not use this

setCurrentNode

void setCurrentNode(org.codehaus.groovy.ast.MethodNode method)
For internal use only. Application developers should not use this

setCurrentASTNode

void setCurrentASTNode(org.codehaus.groovy.ast.ASTNode node)
For internal use only. Application developers should not use this

setTypeCheckerClassLoader

void setTypeCheckerClassLoader(java.lang.ClassLoader classLoader)
For internal use only. Application developers should not use this

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.9.1)

E67681-01


Copyright © 1997, 2016, Oracle. All rights reserved.