Skip navigation links

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

E17483-04


oracle.adf.model.adapter.dataformat
Class MethodDef

java.lang.Object
  extended by oracle.adf.model.adapter.dataformat.MethodDef

All Implemented Interfaces:
Definition, NamedDefinition, OperationDefinition

public class MethodDef
extends java.lang.Object
implements OperationDefinition

Defines a method of a data control.

Since:
10.1.3

Field Summary
protected  java.util.Hashtable mProperties
           
static java.lang.String RET_NAME
           
static java.lang.String SHOW_PARAMETERS
           

 

Fields inherited from interface oracle.binding.meta.OperationDefinition
CUSTOM

 

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
MethodDef(java.lang.String name, StructureDefinition parent)
          Creates a method definition.
MethodDef(java.lang.String name, StructureDefinition parent, boolean isConstructor)
          Creates a method definition.
MethodDef(java.lang.String name, StructureDefinition parent, java.lang.String retType)
          Creates a method definition with a simple return type.

 

Method Summary
 void addParameter(ParameterDefinition paramDef)
          Adds a parameter to the method.
 void addParameter(java.lang.String name, java.lang.String type)
          Adds a parameter to the method.
 java.lang.String getBindPath()
          Gets the bind path of the definition if set.
 DataControlDefinition getDataControlDefinition()
          Returns the definition of the DataControl that this method belongs to.
 Definition getDefinitionParent()
          Returns the parent of this method.
 int getDefinitionType()
          Retrieves the type of this definition.
 java.lang.String getFullName()
          Returns the full name of the definition.
 java.lang.String getName()
          Returns the name of this method.
 int getOperationId()
          Retrieves the operation id of the operation.
 DefinitionContainer getOperationParameters()
          Gets the parameters defined for the method.
 OperationReturnDefinition getOperationReturnType()
          Returns the return type of the method.
 java.util.Hashtable getProperties()
          Gets the table of properties.
 java.lang.Object getProperty(java.lang.String propertyName)
          Retrieves the value of a property with the given name.
 boolean isConstructor()
           
 boolean isStatic()
           
 void setBindPath(java.lang.String path)
          Sets the bind path.
 void setProperty(java.lang.String propertyName, java.lang.Object propertyValue)
           
 void setReturnCollectionStructure(StructureDefinition def)
          Sets the collection structure for the return type.
 void setReturnName(java.lang.String name)
          Sets the return name.
 void setReturnType(MethodReturnDef def)
          Sets a return type.
 void setReturnType(java.lang.String type)
          Sets a return type.
 void setReturnType(java.lang.String type, boolean collection)
          Sets a return type.
 void setReturnType(java.lang.String javaType, java.lang.String elementName, java.lang.String elementJavaType)
          Sets a return type of scalar collection type.
 void setReturnType(StructureDefinition def)
          Sets a return type.
 void setReturnType(StructureDefinition def, boolean collection)
          Sets a return type.

 

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

 

Field Detail

RET_NAME

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

SHOW_PARAMETERS

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

mProperties

protected java.util.Hashtable mProperties

Constructor Detail

MethodDef

public MethodDef(java.lang.String name,
                 StructureDefinition parent,
                 boolean isConstructor)
Creates a method definition. The default return type is void.
Parameters:
name - name of the method.
parent - structure definition that contains this method.
isConstructor - boolean flag to indicate whether this operation is a constructor.

MethodDef

public MethodDef(java.lang.String name,
                 StructureDefinition parent)
Creates a method definition. The default return type is void.
Parameters:
name - name of the method.
parent - structure definition that contains this method.

MethodDef

public MethodDef(java.lang.String name,
                 StructureDefinition parent,
                 java.lang.String retType)
Creates a method definition with a simple return type.
Parameters:
name - name of the method.
parent - structure definition that contains this method.
retType - the class name of the simple return type.

Method Detail

setReturnName

public void setReturnName(java.lang.String name)
Sets the return name. Return names are displayed when a method returns a complex structure. The default name is "Return".

addParameter

public void addParameter(ParameterDefinition paramDef)
Adds a parameter to the method.
Parameters:
paramDef - definition of the parameter.

addParameter

public void addParameter(java.lang.String name,
                         java.lang.String type)
Adds a parameter to the method.
Parameters:
name - name of the parameter.
type - simple type name of the parameter.

setReturnType

public void setReturnType(MethodReturnDef def)
Sets a return type.
Parameters:
def - a structure that describes a complex return type.

setReturnType

public void setReturnType(StructureDefinition def)
Sets a return type.
Parameters:
def - a structure that describes a complex return type.

setReturnType

public void setReturnType(java.lang.String type)
Sets a return type.
Parameters:
type - a simple java type.

setReturnType

public void setReturnType(StructureDefinition def,
                          boolean collection)
Sets a return type.
Parameters:
def - a structure that describes a complex return type.
collection - true if the return type is a collection.

setReturnType

public void setReturnType(java.lang.String type,
                          boolean collection)
Sets a return type.
Parameters:
type - a simple java type.
collection - true if the return type is a collection.

setReturnType

public void setReturnType(java.lang.String javaType,
                          java.lang.String elementName,
                          java.lang.String elementJavaType)
Sets a return type of scalar collection type.
Parameters:
javaType - java type of the parameter.
elementName - the name of element in the collection.
elementJavaType - java type of each collection element.

setReturnCollectionStructure

public void setReturnCollectionStructure(StructureDefinition def)
Sets the collection structure for the return type. Collection structures usually contain methods applicable for the collection.

setBindPath

public void setBindPath(java.lang.String path)
Sets the bind path.

getBindPath

public java.lang.String getBindPath()
Gets the bind path of the definition if set.

getName

public java.lang.String getName()
Returns the name of this method.
Specified by:
getName in interface NamedDefinition
Returns:
method name.

getDefinitionParent

public Definition getDefinitionParent()
Returns the parent of this method. Definition parent is the parent in the definition hierarchy. This method can be a child of an accessor or a data control definition and that definition becomes the definition parent of this attribute.
Specified by:
getDefinitionParent in interface NamedDefinition
Returns:
a data control definition or an accessor definition that contains this method in the hierarchy of definition. If there is no parent defined, i.e. this method is created under a structure definition that is not attached to any accessor or data control definition yet, it returns the structure definition that contains it.

getFullName

public java.lang.String getFullName()
Returns the full name of the definition.
Specified by:
getFullName in interface NamedDefinition
Returns:
If the bind path is defined it returns the bind path. If bind path is not defined and the parent is defined then it returns <parent_path>.<this_name>. Otherwise it returns the name of the definition.

getProperty

public java.lang.Object getProperty(java.lang.String propertyName)
Description copied from interface: NamedDefinition
Retrieves the value of a property with the given name. Properties can be used for UI hints such as display width and height.
Specified by:
getProperty in interface NamedDefinition
Parameters:
propertyName - Name of the property to be retrieved.
Returns:
Value of the property with the given property name.

getProperties

public java.util.Hashtable getProperties()
Description copied from interface: NamedDefinition
Gets the table of properties. This returns a hashtable to ensure any modification done by caller would be synchronized. Note that this API has not been added to the JSR yet.
Specified by:
getProperties in interface NamedDefinition
Returns:
a hashtable of properties.

setProperty

public void setProperty(java.lang.String propertyName,
                        java.lang.Object propertyValue)

getDefinitionType

public int getDefinitionType()
Description copied from interface: Definition
Retrieves the type of this definition. It can be one of the TYPE_* constants defined in this class. This is useful to find out the actual type of the Definition without doing an instanceof operations.
Specified by:
getDefinitionType in interface Definition
Returns:
The type of definition that this Definition implementation class implements.

getOperationReturnType

public OperationReturnDefinition getOperationReturnType()
Returns the return type of the method.
Specified by:
getOperationReturnType in interface OperationDefinition
Returns:
a OperationReturnDefinition for the return type.

getDataControlDefinition

public DataControlDefinition getDataControlDefinition()
Returns the definition of the DataControl that this method belongs to.
Specified by:
getDataControlDefinition in interface OperationDefinition
Returns:
a DataControlDefinition of the DataControl that this method belongs to.

getOperationId

public int getOperationId()
Description copied from interface: OperationDefinition
Retrieves the operation id of the operation.
Specified by:
getOperationId in interface OperationDefinition
Returns:
CUSTOM as the operation id since this class is used for custom methods.

getOperationParameters

public DefinitionContainer getOperationParameters()
Gets the parameters defined for the method.
Specified by:
getOperationParameters in interface OperationDefinition
Returns:
a DefinitionContainer containing the parameter definitions.
See Also:
ParameterDefinition, EmptyDefinitionContainer

isStatic

public boolean isStatic()
Specified by:
isStatic in interface OperationDefinition
Returns:
true if this operation definition represents a static method.

isConstructor

public boolean isConstructor()
Returns:
true if this operation definition represents a constructor method.

Skip navigation links

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

E17483-04


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