Skip navigation links

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

E10653-11


oracle.jbo
Class AbstractExprCompileContextImpl

java.lang.Object
  extended by groovy.lang.GroovyObjectSupport
      extended by groovy.lang.Binding
          extended by oracle.jbo.AbstractExprCompileContextImpl

All Implemented Interfaces:
groovy.lang.GroovyObject, ExprCompileContext

public abstract class AbstractExprCompileContextImpl
extends groovy.lang.Binding
implements ExprCompileContext

An abstract version of an ExprCompileContext. The abstract context implements a strategy patter for method and variable resolution that is based upon the strategy that is used at script execute time.

Many of the abstract methods defined by this class are designed to return information about the compile context source. This source object usually represents the BC4J owner of the script that is compiling. At execute time it is frequently implemented by an oracle.jbo.Row. At compile time it is exepcted that it will be represented by a BC4J def object or its DT equivalent.

Note that many of the typing methods deal with String types rather than the type classes. This is intentional. Type classes are not available in all compile contexts (DT).

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

Constructor Summary
AbstractExprCompileContextImpl()
           

 

Method Summary
abstract  boolean canTypeCheck()
          Returns whether this compile context can be used for type checking.
protected  java.lang.Class[] classesFor(java.lang.String[] types)
           
protected  java.lang.Class classFor(java.lang.String type)
           
abstract  ExprDef getExprDef()
          Return the definition of the expressio that is compiling.
abstract  groovy.lang.Script getGlobalScript()
           
 java.lang.String getMethodReturnType(java.lang.String receiver, java.lang.String name, java.lang.String... argtypes)
          Return the return type of the given method.
abstract  java.lang.String getNewValueType()
          In validator contexts this returns the type of the new attribute or row.
abstract  java.lang.String getOldValueType()
          In validator contexts this returns the type of the new attribute or row.
abstract  groovy.lang.Script getOperationsScript()
          Return the operations script for the current compile context.
 java.lang.String getPropertyType(java.lang.String objectType, java.lang.String name)
          Return the type of the given property.
protected  java.lang.String getReturnType(java.lang.Class receiver, java.lang.String name, java.lang.Class... argtypes)
           
protected  java.lang.String getReturnType(java.lang.String receiverType, java.lang.String name, java.lang.String... argtypes)
          Get the return type of the specified method on the specified receiver type.
abstract  java.lang.String getSourceAttributeType(java.lang.String name)
          Return the source attribute type.
abstract  java.lang.String getSourceMethodReturnType(java.lang.String name, java.lang.String... argtypes)
          Return the return type of a source method.
abstract  java.lang.String getSourcePropertyType(java.lang.String name)
          Return the source property type.
abstract  java.lang.String getSourceType()
          Return the source type of the current compile context.
 java.lang.String getVariableType(java.lang.String name)
          Return the type of the given variable.
protected  boolean isAssignableFrom(java.lang.Class intrf, java.lang.String type)
          Determines if the specified interface class is assignable from the type.
protected  void setNestedContext(ExprCompileContext nestedContext)
          May be used to define a nested context in which future ADF properties/methods may be evaluated.

 

Methods inherited from class groovy.lang.Binding
getProperty, getVariable, getVariables, hasVariable, setProperty, setVariable

 

Methods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, invokeMethod, setMetaClass

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Methods inherited from interface oracle.jbo.ExprCompileContext
getEnclosingContext, getErrorCollector, getExprTrustSupplier, getGlobalOperationReturnType, isRowAttribute, setErrorCollector

 

Constructor Detail

AbstractExprCompileContextImpl

public AbstractExprCompileContextImpl()

Method Detail

getExprDef

public abstract ExprDef getExprDef()
Description copied from interface: ExprCompileContext
Return the definition of the expressio that is compiling.
Specified by:
getExprDef in interface ExprCompileContext

canTypeCheck

public abstract boolean canTypeCheck()
Description copied from interface: ExprCompileContext
Returns whether this compile context can be used for type checking.
Specified by:
canTypeCheck in interface ExprCompileContext

getPropertyType

public java.lang.String getPropertyType(java.lang.String objectType,
                                        java.lang.String name)
Description copied from interface: ExprCompileContext
Return the type of the given property.

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

Specified by:
getPropertyType in interface ExprCompileContext

getVariableType

public java.lang.String getVariableType(java.lang.String name)
Description copied from interface: ExprCompileContext
Return the type of the given variable.

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

Specified by:
getVariableType in interface ExprCompileContext

getMethodReturnType

public java.lang.String getMethodReturnType(java.lang.String receiver,
                                            java.lang.String name,
                                            java.lang.String... argtypes)
Description copied from interface: ExprCompileContext
Return the return type of the given method.

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

Specified by:
getMethodReturnType in interface ExprCompileContext

setNestedContext

protected void setNestedContext(ExprCompileContext nestedContext)
May be used to define a nested context in which future ADF properties/methods may be evaluated. The nested context will be cleared whenever a new unresolved variable is detected.

The nested context may be used to store the structure of a BC4J association so that properties of the association may be resolved. For example, in an emp context the nested context could be used to resolve the Emps property in the expression 'Dept.Emps'.


getGlobalScript

public abstract groovy.lang.Script getGlobalScript()

getOperationsScript

public abstract groovy.lang.Script getOperationsScript()
Return the operations script for the current compile context. This is usually defined by the owner of the script that is compiling.

getSourceType

public abstract java.lang.String getSourceType()
Return the source type of the current compile context.

getSourceAttributeType

public abstract java.lang.String getSourceAttributeType(java.lang.String name)
Return the source attribute type. Many sources like a ViewObject definition may define named attributes. This returns the type of a named attribute.

getSourcePropertyType

public abstract java.lang.String getSourcePropertyType(java.lang.String name)
Return the source property type. This is usually a bean property of the source.

getSourceMethodReturnType

public abstract java.lang.String getSourceMethodReturnType(java.lang.String name,
                                                           java.lang.String... argtypes)
Return the return type of a source method. Many sources may also define custom interfaces (like a row class). This returns the return type of a source's custom interface.

getNewValueType

public abstract java.lang.String getNewValueType()
In validator contexts this returns the type of the new attribute or row.

getOldValueType

public abstract java.lang.String getOldValueType()
In validator contexts this returns the type of the new attribute or row.

getReturnType

protected java.lang.String getReturnType(java.lang.String receiverType,
                                         java.lang.String name,
                                         java.lang.String... argtypes)
Get the return type of the specified method on the specified receiver type.

The default implementation uses the groovy MOP to find the method on the receiver class. Concrete implementations may override this method if the receiver class is not available.

Parameters:
receiverType - the type of the Object that will receive the method invocation
name - the name of the method that will be invoked
argtypes - the types of arguments that will be passed

getReturnType

protected java.lang.String getReturnType(java.lang.Class receiver,
                                         java.lang.String name,
                                         java.lang.Class... argtypes)

isAssignableFrom

protected boolean isAssignableFrom(java.lang.Class intrf,
                                   java.lang.String type)
Determines if the specified interface class is assignable from the type.

The assignable rules should be java.lang.Class. The default implementation looks up the Class to determine if it is assignable. Concrete implementations that may not have the type Class available may override this to perform there own checking.

Parameters:
intrf - the interface to check for
type - the type to be checked

classFor

protected java.lang.Class classFor(java.lang.String type)

classesFor

protected java.lang.Class[] classesFor(java.lang.String[] types)

Skip navigation links

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

E10653-11


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