org.apache.ojb.broker.metadata
Class ArgumentDescriptor

java.lang.Object
  extended by org.apache.ojb.broker.metadata.ArgumentDescriptor
All Implemented Interfaces:
java.io.Serializable, AttributeContainer, RepositoryElements, XmlCapable

public final class ArgumentDescriptor
extends java.lang.Object
implements XmlCapable, java.io.Serializable

An ArgumentDescriptor contains information that defines a single argument that is passed to a procedure/function.
Note: Be careful when use ArgumentDescriptor variables or caching ArgumentDescriptor instances, because instances could become invalid during runtime (see MetadataManager).

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

Field Summary
 
Fields inherited from interface org.apache.ojb.broker.metadata.RepositoryElements
_NEXT, ACCEPT_LOCKS, ACCESS, ATTRIBUTE, ATTRIBUTE_NAME, ATTRIBUTE_VALUE, AUTO_DELETE, AUTO_INCREMENT, AUTO_RETRIEVE, AUTO_UPDATE, BATCH_MODE, CASCADE_LINK_STR, CASCADE_NONE_STR, CASCADE_OBJECT_STR, CLASS_DESCRIPTOR, CLASS_EXTENT, CLASS_NAME, CLASS_PROXY, CLASS_REF, COLLECTION_CLASS, COLLECTION_DESCRIPTOR, COLUMN_NAME, CON_LOG_ABANDONED, CON_MAX_ACTIVE, CON_MAX_IDLE, CON_MAX_WAIT, CON_MIN_EVICTABLE_IDLE_TIME_MILLIS, CON_NUM_TESTS_PER_EVICTION_RUN, CON_REMOVE_ABANDONED, CON_REMOVE_ABANDONED_TIMEOUT, CON_TEST_ON_BORROW, CON_TEST_ON_RETURN, CON_TEST_WHILE_IDLE, CON_TIME_BETWEEN_EVICTION_RUNS_MILLIS, CON_WHEN_EXHAUSTED_ACTION, CONNECTION_FACTORY, CONNECTION_POOL, CONSTANT_ARGUMENT, DATASOURCE_NAME, DBMS_NAME, DEFAULT_CONNECTION, DELETE_PROCEDURE, DOCUMENTATION, DRIVER_NAME, EAGER_RELEASE, EXTENDS, FACTORY_CLASS, FACTORY_METHOD, FIELD_CONVERSION, FIELD_DESCRIPTOR, FIELD_ID_REF, FIELD_NAME, FIELD_REF, FK_POINTING_TO_ITEMS_CLASS, FK_POINTING_TO_THIS_CLASS, FOREIGN_KEY, ID, IGNORE_AUTOCOMMIT_EXCEPTION, INCLUDE_ALL_FIELDS, INCLUDE_PK_FIELDS_ONLY, INDEX_COLUMN, INDEX_DESCRIPTOR, INDEXED, INDIRECTION_TABLE, INITIALIZATION_METHOD, INSERT_PROCEDURE, INVERSE_FK, ISOLATION_LEVEL, ITEMS_CLASS, JCD_ALIAS, JDBC_CONNECTION_DESCRIPTOR, JDBC_LEVEL, JDBC_TYPE, LENGTH, LOCKING, MAPPING_REPOSITORY, NAME, NULLABLE, OBJECT_CACHE, ORDERBY, OTM_DEPENDENT, PRECISION, PRIMARY_KEY, PROXY_PREFETCHING_LIMIT, PROXY_REFERENCE, QUERY_CUSTOMIZER, REFERENCE_DESCRIPTOR, REFERENCED_CLASS, REFRESH, REPOSITORY_VERSION, RETURN, RETURN_FIELD_REF, ROW_READER, RUNTIME_ARGUMENT, SCALE, SCHEMA_NAME, SEQUENCE_MANAGER, SEQUENCE_MANAGER_CLASS, SEQUENCE_NAME, SORT, TABLE_NAME, TAG_ACCESS, TAG_ACCESS_ANONYMOUS, TAG_ACCESS_READONLY, TAG_ACCESS_READWRITE, TAG_SUPER, UNIQUE, UPDATE_LOCK, UPDATE_PROCEDURE, URL_DBALIAS, URL_PROTOCOL, URL_SUBPROTOCOL, USE_AUTOCOMMIT, USER_NAME, USER_PASSWD, VALIDATION_QUERY, VALUE
 
Constructor Summary
ArgumentDescriptor(ProcedureDescriptor procedureDescriptor)
          Constructor declaration.
 
Method Summary
 void addAttribute(java.lang.String attributeName, java.lang.String attributeValue)
          Store the specified attribute and it's value.
 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.
 FieldDescriptor getFieldRef()
          Retrieve the field descriptor that this argument is related to.
 boolean getIsReturnedByProcedure()
           
 int getJdbcType()
          Retrieve the jdbc type for the field descriptor that is related to this argument.
 ProcedureDescriptor getProcedureDescriptor()
          Retrieve the procedure descriptor that this object is related to.
 java.lang.Object getValue(java.lang.Object objekt)
           
 void saveValue(java.lang.Object objekt, java.lang.Object value)
           
 void setValue()
          Sets up this object to represent a null value.
 void setValue(java.lang.String constantValue)
          Sets up this object to represent an argument that will be set to a constant value.
 void setValue(java.lang.String fieldRefName, boolean returnedByProcedure)
          Sets up this object to represent a value that is derived from a field in the corresponding class-descriptor.
 java.lang.String toString()
          Provide a string representation of this object
 java.lang.String toXML()
          returns the XML marshalled version of this instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArgumentDescriptor

public ArgumentDescriptor(ProcedureDescriptor procedureDescriptor)
Constructor declaration. By default, this object will be configured so that the value returned by fieldSource will be null. To change this, call either version of the setValue method.

See Also:
setValue(), setValue(String), setValue(String,boolean)
Method Detail

setValue

public void setValue()
Sets up this object to represent a null value.


setValue

public void setValue(java.lang.String fieldRefName,
                     boolean returnedByProcedure)
Sets up this object to represent a value that is derived from a field in the corresponding class-descriptor.

If the value of fieldRefName is blank or refers to an invalid field reference, then the value of the corresponding argument will be set to null. In this case, getIsReturnedByProcedure() will be set to false, regardless of the value of the returnedByProcedure argument.

Parameters:
fieldRefName - the name of the field reference that provides the value of this argument.
returnedByProcedure - indicates that the value of the argument is returned by the procedure that is invoked.

setValue

public void setValue(java.lang.String constantValue)
Sets up this object to represent an argument that will be set to a constant value.

Parameters:
constantValue - the constant value.

getIsReturnedByProcedure

public boolean getIsReturnedByProcedure()

getValue

public java.lang.Object getValue(java.lang.Object objekt)

saveValue

public void saveValue(java.lang.Object objekt,
                      java.lang.Object value)

getFieldRef

public final FieldDescriptor getFieldRef()
Retrieve the field descriptor that this argument is related to.

This reference can only be set via the setValue(String,boolean) method.

Returns:
The current value

getJdbcType

public final int getJdbcType()
Retrieve the jdbc type for the field descriptor that is related to this argument.


getProcedureDescriptor

public final ProcedureDescriptor getProcedureDescriptor()
Retrieve the procedure descriptor that this object is related to.

Returns:
The current value

toXML

public java.lang.String toXML()
Description copied from interface: XmlCapable
returns the XML marshalled version of this instance.

Specified by:
toXML in interface XmlCapable
Returns:
the XML String representing this object.

toString

public java.lang.String toString()
Provide a string representation of this object

Returns:
a string representation of this object

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)


(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