Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 2 (11.1.2.2.0)

E17483-03


oracle.adf.model.adapter
Class AbstractDefinition

java.lang.Object
  extended by oracle.adf.model.adapter.AbstractDefinition

All Implemented Interfaces:
DataControlDefinition, Definition, NamedDefinition
Direct Known Subclasses:
AbstractBeanDefinition, CSVDCDef, WSDefinition, XMLDCDef

public abstract class AbstractDefinition
extends java.lang.Object
implements DataControlDefinition

Definition of a data control instance.

There are several ways that this class can be generated.

The implementation of this class MUST have a default constructor.

Note: When the definition loaded at the runtime, runtime sets the name of the definition as stored in the metadata. The implementation of this class MUST use getName() to get the name of the definition.

See Also:
AbstractAdapter

Field Summary
static int CACHE_TO_SOURCEPATH
           
static int DONT_CACHE
           
protected  java.lang.String mFullName
           

 

Fields inherited from interface oracle.binding.meta.Definition
TYPE_ACCESSOR, TYPE_ATTRIBUTE, TYPE_CRITERIA, TYPE_CRITERIA_ITEM, TYPE_CRITERIA_OPERATOR, TYPE_CRITERIA_ROW, TYPE_DATACONTROL, TYPE_DEFINITION, TYPE_DEFINITIONCONTEXT, TYPE_NAMED, TYPE_OPERATION, TYPE_OPERATIONRETURN, TYPE_PARAMETER, TYPE_STRUCTURE, TYPE_VARIABLE

 

Constructor Summary
AbstractDefinition()
           

 

Method Summary
 boolean assignDefaultPackage()
          Data controls which do not already have their own package structure need to use a default package.
abstract  DataControl createDataControl()
          Creates an instance of data control generated from the metadata definition.
 boolean createDuplicateDetailIterator()
          If the data control needs a distinct iterator to be created for the control binding, this method should return true.
 AdapterContext getAdapterContext()
          Gets the adapter context.
 java.lang.String getAdapterType()
          Returns the name of the corresponding adapter type, if any.
 int getCachingMode()
           
 java.lang.String getConfigurationFullName()
           
protected abstract  java.lang.String getDCName()
          Returns the name of the data control.
 java.lang.String getDefClassName()
          Returns the class name of the definition class that will load the metadata that describes the data control.
 Definition getDefinitionParent()
          Returns the parent of this metadata definition, which is the Definition that contains this Definition.
 int getDefinitionType()
          Type of definition
 java.lang.String getFactoryClassName()
          Advanced internal placeholder method.
 java.lang.String getFullName()
          Returns the full name of this Definition, which includes the name of any parent objects.
abstract  Node getMetadata()
          Returns the element that defines the metadata for the data control.
 java.lang.String getName()
          Gets the name of the data control.
 ParameterDefinition[] getParameters()
          Returns the parameters that are defined for the data control metadata.
 java.util.Hashtable getProperties()
          Gets a hashtable of all properties.
 java.lang.Object getProperty(java.lang.String name)
          Gets a property value.
abstract  StructureDefinition getStructure()
          Gets the structure definition of the output data.
 boolean isStructureDirty(boolean refresh)
          The implementation should return true if the structure of the back end data is changed.
 boolean isSupported(java.lang.String flag)
          Indicates if the adapter support things like sorting, transaction etc.
abstract  void loadFromMetadata(Node node, java.util.Map params)
          Loads the definition from a metadata Node.
 void setAdapterContext(AdapterContext ctx)
          Sets the adapter context.
 void setCachingMode(int cachingMode)
           
 void setCompileProjectOnCreate(boolean flag)
          Sets the flag to indicate the requirement of compilation when a data control will be created from this definition.
 void setConfigurationFullName(java.lang.String configFullName)
           
 void setFullName(java.lang.String fullName)
           
 void setName(java.lang.String name)
          Sets the name of the definiiton.
 void setProperty(java.lang.String name, java.lang.Object val)
          Stores a property value.
 boolean shouldCompileProjectOnCreate()
          Indicates if the project needs to be compiled when a data control is created from this definition.
 boolean useDefinitionProvider()
          Indicates if datacontrol uses DC definition provider
 boolean usePersistedStructure()
          Indicates whether the definition delegates to the framework the task of deserializing its StructureDefinition (for example, from bean .xml files on disk).

 

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

 

Field Detail

CACHE_TO_SOURCEPATH

public static final int CACHE_TO_SOURCEPATH
See Also:
Constant Field Values

DONT_CACHE

public static final int DONT_CACHE
See Also:
Constant Field Values

mFullName

protected java.lang.String mFullName

Constructor Detail

AbstractDefinition

public AbstractDefinition()

Method Detail

getMetadata

public abstract Node getMetadata()
Returns the element that defines the metadata for the data control.
Returns:
a Node that defines the metadata for this instance. This metadata will be used at the runtime to fetch data from the data source.

getStructure

public abstract StructureDefinition getStructure()
Gets the structure definition of the output data.
Specified by:
getStructure in interface DataControlDefinition
Returns:
Definition of the output data structure.

getDefinitionType

public int getDefinitionType()
Type of definition
Specified by:
getDefinitionType in interface Definition
Returns:
TYPE_DATACONTROL. All subclasses are definitions for Data controls.

getCachingMode

public int getCachingMode()

setCachingMode

public void setCachingMode(int cachingMode)

loadFromMetadata

public abstract void loadFromMetadata(Node node,
                                      java.util.Map params)
Loads the definition from a metadata Node.
Parameters:
node - the metadata node. It can be null if no metadata is defined.
params - context parameters.

createDataControl

public abstract DataControl createDataControl()
Creates an instance of data control generated from the metadata definition.
Returns:
the data control instance.

getDCName

protected abstract java.lang.String getDCName()
Returns the name of the data control.

getAdapterType

public java.lang.String getAdapterType()
Returns the name of the corresponding adapter type, if any. The framework calls this method to find out a corresponding adapter for this definition.
Returns:
name of the corresponding adapter that matches this definition. If there is no adapter defined for this type, the method returns null. The default implementation returns null.
See Also:
AdapterDefinition

getDefClassName

public java.lang.String getDefClassName()
Returns the class name of the definition class that will load the metadata that describes the data control.

The framework will call this method at the design time to store the definition class name that will load the metadata. The returned class must be a derived class of this astract class. The default implementation returns the class name of this instance only. The derived class needs to override this only if the definition class that may load a metadata is different than this instance.


usePersistedStructure

public boolean usePersistedStructure()
Indicates whether the definition delegates to the framework the task of deserializing its StructureDefinition (for example, from bean .xml files on disk).
Returns:
by default true.

useDefinitionProvider

public boolean useDefinitionProvider()
Indicates if datacontrol uses DC definition provider
Returns:
false by default

isStructureDirty

public boolean isStructureDirty(boolean refresh)
The implementation should return true if the structure of the back end data is changed. The framework will not call getStructure() is this method returns false.
Parameters:
refresh - flag to indicate if the refresh is requested for the structure.
Returns:
true if the implementation decides that the structure of the data should be generated. The default implementation always returns false.

getParameters

public ParameterDefinition[] getParameters()
Returns the parameters that are defined for the data control metadata.

The implementation should override this method if the definition uses parameters. The default implementatiaon returns null.


getName

public java.lang.String getName()
Gets the name of the data control.

At runtime, the name is set from the metadata information. At design time it calls getDCName() to get the name of this definition.

Specified by:
getName in interface NamedDefinition
Returns:
Name of this Definition.

isSupported

public boolean isSupported(java.lang.String flag)
Indicates if the adapter support things like sorting, transaction etc. Adapter data control definition should overwrite this method to provide the info specific to the data control instance.
Parameters:
flag - one of the values defined in DataControlDefinition.
Returns:
boolean true if supported. The default implementation returns "false" for all flags.

assignDefaultPackage

public boolean assignDefaultPackage()
Data controls which do not already have their own package structure need to use a default package. Bean-based data controls, or others whose names embed their package structure, should override this to return false.
Returns:
true by default.

shouldCompileProjectOnCreate

public boolean shouldCompileProjectOnCreate()
Indicates if the project needs to be compiled when a data control is created from this definition.

Note: If the data control create is invoked from within a UI operation (e.g. you are invoking creation of data control while responding to a property change action of the data control metadata), this method must return false. A data control can be created by calling the method createDataControl on class MetaDef.

Returns:
by default it returns false.

getDefinitionParent

public Definition getDefinitionParent()
Description copied from interface: NamedDefinition
Returns the parent of this metadata definition, which is the Definition that contains this Definition. For example, the parent of an AttributeDefinition could be a StructureDefinition if the attribute is contained in the structure.
Specified by:
getDefinitionParent in interface NamedDefinition
Returns:
The parent Definition

getFullName

public java.lang.String getFullName()
Description copied from interface: NamedDefinition
Returns the full name of this Definition, which includes the name of any parent objects. The full name should reflect the runtime nesting level.
Specified by:
getFullName in interface NamedDefinition
Returns:
Full name of this Definition.

setFullName

public void setFullName(java.lang.String fullName)

setProperty

public final void setProperty(java.lang.String name,
                              java.lang.Object val)
Stores a property value.

getProperty

public final java.lang.Object getProperty(java.lang.String name)
Gets a property value.
Specified by:
getProperty in interface NamedDefinition
Parameters:
name - Name of the property to be retrieved.
Returns:
Value of the property with the given property name.

getProperties

public java.util.Hashtable getProperties()
Gets a hashtable of all properties.
Specified by:
getProperties in interface NamedDefinition
Returns:
properties

setName

public final void setName(java.lang.String name)
Sets the name of the definiiton.

setAdapterContext

public final void setAdapterContext(AdapterContext ctx)
Sets the adapter context.

getAdapterContext

public final AdapterContext getAdapterContext()
Gets the adapter context.

setCompileProjectOnCreate

public void setCompileProjectOnCreate(boolean flag)
Sets the flag to indicate the requirement of compilation when a data control will be created from this definition.

getFactoryClassName

public java.lang.String getFactoryClassName()
Advanced internal placeholder method.

createDuplicateDetailIterator

public boolean createDuplicateDetailIterator()
If the data control needs a distinct iterator to be created for the control binding, this method should return true. The default value will be false to allow for re-use of data control iterators.
Returns:
true if duplicates are required.

getConfigurationFullName

public java.lang.String getConfigurationFullName()

setConfigurationFullName

public void setConfigurationFullName(java.lang.String configFullName)

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 2 (11.1.2.2.0)

E17483-03


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