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

E10653-05

oracle.adf.model.adapter
Class AbstractImpl

java.lang.Object
  extended by oracle.adf.model.adapter.AbstractImpl
Direct Known Subclasses:
CSVDataControl, UpdatableBeanDataControl, WSDataControl, XMLDataControl

public abstract class AbstractImpl
extends java.lang.Object

An abstract base class for all metadata driven data control implementations.

Data Controls implementations, child classes of this abstract class, must also implement any of the Data Control interfaces defined by the JSR 227 specification. The data control interfaces are available under "oracle.binding" package.

Since:
10.1.3

Field Summary
static java.lang.String METHOD_CREATE
          Name of the method to create the adapter instance.
static java.lang.String METHOD_EXECUTE
          Name of the method to execute the adapter instance.
protected  java.lang.String mName
          Name of the data control.
static java.lang.String SORT_CRITERIA
          Key name for the sort criteria set for the data control.
 
Constructor Summary
AbstractImpl()
           
 
Method Summary
 void addParameter(java.lang.String name, java.lang.String val)
          Adds a parameter to the data control.
protected  java.lang.Object createAndAddNewRow(RowContext ctx)
          Helper method to create a row and add the new row to the master row.
 java.lang.Object createEmptyDataSet(StructureDefinition struc, boolean isCollection)
          Creates an empty data set for a given structure.
 AdapterContext getAdapterContext()
          Returns the current adapter context.
 AbstractDefinition getDefinition()
          Gets the data control definition.
 java.lang.String[] getParameterNames()
          Returns the name of the parameters set to this data control instance.
 java.lang.String getParameterValue(java.lang.String name)
          Gets the value of an existing definition parameter.
 AdapterSortCriteria[] getSortCriteria(OperationBinding action)
          Extracts and returns the sort criteria, if any, defined for the method action.
 StructureDefinition getStructureDef()
          Gets the structure defintion for the data for this data control.
 StructureDefinition getStructureDef(java.lang.String typeName)
          Gets the structure definition of a complex type.
 void processResult(java.lang.Object result, java.util.Map bindingContext, OperationBinding action)
          Processes result created by the adapter's invokeOperation call.
 void setDefinition(AbstractDefinition def)
          Sets the definition of this data control.
 void setName(java.lang.String name)
          Sets the name of the data control implementation.
 void setParameterValue(java.lang.String name, java.lang.String val)
          Sets the value of an existing definition parameter.
 void setStructureDef(StructureDefImpl def)
          Sets the structure definition of the data for this data control.
 boolean shouldReexecuteOperation(OperationInfo operationInfo)
          Determines if a method should be reexecuted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METHOD_CREATE

public static final java.lang.String METHOD_CREATE
Name of the method to create the adapter instance. Data control implementations should look for this method name from the OperationBinding passed to the invokeAction call.

See Also:
Constant Field Values

METHOD_EXECUTE

public static final java.lang.String METHOD_EXECUTE
Name of the method to execute the adapter instance. Data control implementations should look for this method name from the OperationBinding passed to the invokeAction call.

See Also:
Constant Field Values

SORT_CRITERIA

public static final java.lang.String SORT_CRITERIA
Key name for the sort criteria set for the data control. Sort criteria are passed to the data control's invokeOperation method via the MethodOperationBinding object. Implementation may use getSortCriteria helper method to get the sort criteria.

See Also:
Constant Field Values

mName

protected java.lang.String mName
Name of the data control.

Constructor Detail

AbstractImpl

public AbstractImpl()
Method Detail

shouldReexecuteOperation

public boolean shouldReexecuteOperation(OperationInfo operationInfo)
Determines if a method should be reexecuted.

If the parameter value of a method changes, the framework executes the method. If the parameter values are not changed or the method has no parameters, the framework asks if the method should be reexecuted or the values that are already fetched before can be used.

Returns:
the default implementation returns false.

setName

public final void setName(java.lang.String name)
Sets the name of the data control implementation.


getSortCriteria

public final AdapterSortCriteria[] getSortCriteria(OperationBinding action)
Extracts and returns the sort criteria, if any, defined for the method action.

Parameters:
action - the operation for which the sort criteria can be defined.
Returns:
the sort criteria defined for the operation.

getParameterNames

public final java.lang.String[] getParameterNames()
Returns the name of the parameters set to this data control instance.


getParameterValue

public final java.lang.String getParameterValue(java.lang.String name)
Gets the value of an existing definition parameter.

Parameters:
name - Name of the parameter.
Returns:
value of the parameter. If the parameter is not available, it returns null.

setParameterValue

public final void setParameterValue(java.lang.String name,
                                    java.lang.String val)
Sets the value of an existing definition parameter.

Parameters:
name - Name of the parameter.
val - Value of the parameter.

addParameter

public final void addParameter(java.lang.String name,
                               java.lang.String val)
Adds a parameter to the data control.

Parameters:
name - name of the parameter.
val - value of the parameter.

setStructureDef

public final void setStructureDef(StructureDefImpl def)
Sets the structure definition of the data for this data control.


getStructureDef

public final StructureDefinition getStructureDef()
Gets the structure defintion for the data for this data control.


getStructureDef

public final StructureDefinition getStructureDef(java.lang.String typeName)
Gets the structure definition of a complex type.

Parameters:
typeName - name of the complex type.
Returns:
the structure definition of the type. If not found, returns null.

createEmptyDataSet

public final java.lang.Object createEmptyDataSet(StructureDefinition struc,
                                                 boolean isCollection)
Creates an empty data set for a given structure.

Parameters:
struc - the structure for which the empty row will be created.
isCollection - true if the return data set is a collection.
Returns:
a Map representing the row structure. In case of a collection data, it returns a Collection. The returned object will preserve the structure hierarchy as defined by the given structure definition.

createAndAddNewRow

protected final java.lang.Object createAndAddNewRow(RowContext ctx)
Helper method to create a row and add the new row to the master row.

Parameters:
ctx - current row context.
Returns:
the new row.

setDefinition

public final void setDefinition(AbstractDefinition def)
Sets the definition of this data control.


getDefinition

public final AbstractDefinition getDefinition()
Gets the data control definition.


processResult

public final void processResult(java.lang.Object result,
                                java.util.Map bindingContext,
                                OperationBinding action)
Processes result created by the adapter's invokeOperation call.

ADFm expects the result of a method call should be set to the binding context in a way that the framework can retrieve it according to the bind path created in the page definiion. This method takes the result and sets it properly in thge binding context properly.

Adapters should call this method from their invokeOperation call after fetching the data from the data source.

Parameters:
result - returned result of the method call.
bindingContext - the binding context.
action - action that is called on the data control.

getAdapterContext

public final AdapterContext getAdapterContext()
Returns the current adapter context.


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

E10653-05

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