org.apache.ojb.broker.metadata
Class ProcedureDescriptor

java.lang.Object
  extended by org.apache.ojb.broker.metadata.ProcedureDescriptor
All Implemented Interfaces:
java.io.Serializable, AttributeContainer
Direct Known Subclasses:
DeleteProcedureDescriptor, InsertProcedureDescriptor, UpdateProcedureDescriptor

public abstract class ProcedureDescriptor
extends java.lang.Object
implements java.io.Serializable

A ProcedureDescriptor contains information that is common for all types of procedures/functions that are used to handle the persistence operations.
Note: Be careful when use ProcedureDescriptor variables or caching ProcedureDescriptor instances, because instances could become invalid during runtime (see MetadataManager).

Version:
$Id: ProcedureDescriptor.java 365232 2005-12-21 22:36:07Z tomdz $
Author:
Ron Gallagher
See Also:
Serialized Form

Constructor Summary
ProcedureDescriptor(ClassDescriptor classDescriptor, java.lang.String name)
          Constructor declaration
 
Method Summary
 void addAttribute(java.lang.String attributeName, java.lang.String attributeValue)
          Store the specified attribute and it's value.
 int getArgumentCount()
          Retrieves the number of arguments that are passed to the procedure that this descriptor represents.
 java.util.Collection getArguments()
          Get the argument descriptors for this procedure.
 java.lang.String getAttribute(java.lang.String attributeName)
          Get the value of an attribute
 java.lang.String getAttribute(java.lang.String attributeName, java.lang.String defaultValue)
          Get the value of an attribute
 java.lang.String[] getAttributeNames()
          Returns an array of the names of all atributes of this descriptor.
 java.util.Map getAttributes()
          Returns the attribute map (name, value) of this descriptor.
 ClassDescriptor getClassDescriptor()
          Retrieve the class descriptor that this object is related to.
 java.lang.String getName()
          Retrieve the the name of the procedure/function to invoke.
 FieldDescriptor getReturnValueFieldRef()
          Retrieve the field descriptor that will receive the return value from the procedure/function...
 java.lang.String getReturnValueFieldRefName()
          Retrieve the name of the field descriptor that will receive the return value from the procedure/function...
 boolean hasReturnValue()
          Is there a return value for this procedure?
 boolean hasReturnValues()
          Does this procedure return any values to the 'caller'?
 void setReturnValueFieldRef(FieldDescriptor fieldDescriptor)
          Change the the field descriptor that will receive the return value from the procedure/function...
 void setReturnValueFieldRef(java.lang.String fieldName)
          Change the field descriptor that will receive the return value from the procedure/function..
 java.lang.String toString()
           
abstract  java.lang.String toXML()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProcedureDescriptor

public ProcedureDescriptor(ClassDescriptor classDescriptor,
                           java.lang.String name)
Constructor declaration

Method Detail

getName

public final java.lang.String getName()
Retrieve the the name of the procedure/function to invoke.

Returns:
The current value

setReturnValueFieldRef

public final void setReturnValueFieldRef(java.lang.String fieldName)
Change the field descriptor that will receive the return value from the procedure/function..

Parameters:
fieldName - the name of the field that will receive the return value from the procedure/function.

setReturnValueFieldRef

public final void setReturnValueFieldRef(FieldDescriptor fieldDescriptor)
Change the the field descriptor that will receive the return value from the procedure/function...

Parameters:
fieldDescriptor - the field descriptor that will receive the return value from the procedure/function.

getReturnValueFieldRef

public final FieldDescriptor getReturnValueFieldRef()
Retrieve the field descriptor that will receive the return value from the procedure/function...

Returns:
The current value

hasReturnValue

public final boolean hasReturnValue()
Is there a return value for this procedure?

Returns:
true if there is a return value for this procedure.

hasReturnValues

public final boolean hasReturnValues()
Does this procedure return any values to the 'caller'?

Returns:
true if the procedure returns at least 1 value that is returned to the caller.

getReturnValueFieldRefName

public final java.lang.String getReturnValueFieldRefName()
Retrieve the name of the field descriptor that will receive the return value from the procedure/function...

Returns:
The current value

getClassDescriptor

public final ClassDescriptor getClassDescriptor()
Retrieve the class descriptor that this object is related to.

Returns:
The current value

toXML

public abstract java.lang.String toXML()

getArguments

public final java.util.Collection getArguments()
Get the argument descriptors for this procedure.


getArgumentCount

public final int getArgumentCount()
Retrieves the number of arguments that are passed to the procedure that this descriptor represents.

Note: The value returned by this method does not reflect the presence of any return value for the procedure


addAttribute

public void addAttribute(java.lang.String attributeName,
                         java.lang.String attributeValue)
Description copied from interface: AttributeContainer
Store the specified attribute and it's value.

Specified by:
addAttribute in interface AttributeContainer
Parameters:
attributeName - the name of the attribute to retrieve
attributeValue - the attribute's value
See Also:
AttributeContainer.addAttribute(String, String)

getAttribute

public java.lang.String getAttribute(java.lang.String attributeName,
                                     java.lang.String defaultValue)
Description copied from interface: AttributeContainer
Get the value of an attribute

Specified by:
getAttribute in interface AttributeContainer
Parameters:
attributeName - the attribute to retrieve
defaultValue - the value to return if the attribute is not present
Returns:
the attribute value
See Also:
AttributeContainer.getAttribute(String, String)

getAttribute

public java.lang.String getAttribute(java.lang.String attributeName)
Description copied from interface: AttributeContainer
Get the value of an attribute

Specified by:
getAttribute in interface AttributeContainer
Parameters:
attributeName - the attribute to retrieve
Returns:
the attribute value
See Also:
AttributeContainer.getAttribute(String)

getAttributes

public java.util.Map getAttributes()
Returns the attribute map (name, value) of this descriptor. Note that the returned map is not modifiable.

Returns:
The attributes

getAttributeNames

public java.lang.String[] getAttributeNames()
Returns an array of the names of all atributes of this descriptor.

Returns:
The list of attribute names (will not be null)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30