org.apache.ojb.broker.metadata
Class DescriptorBase

java.lang.Object
  extended by org.apache.ojb.broker.metadata.DescriptorBase
All Implemented Interfaces:
Serializable, AttributeContainer
Direct Known Subclasses:
ArgumentDescriptor, AttributeDescriptorBase, ClassDescriptor, DescriptorRepository, JdbcConnectionDescriptor, ProcedureDescriptor

 class DescriptorBase
extends Object
implements AttributeContainer, Serializable

base class for all Descriptors. It is used to implement the AttributeContainer interface which provides mechanics for user defined attributes.

Author:
Thomas Mahler

Field Summary
private  Map attributeMap
          holds user defined attributes
(package private) static long serialVersionUID
           
 
Constructor Summary
DescriptorBase()
          Constructor for DescriptorBase.
 
Method Summary
 void addAttribute(String attributeName, String attributeValue)
          Store the specified attribute and it's value.
 String getAttribute(String attributeName)
          Get the value of an attribute
 String getAttribute(String attributeName, String defaultValue)
          Get the value of an attribute
 String[] getAttributeNames()
          Returns an array of the names of all atributes of this descriptor.
 Map getAttributes()
          Returns the attribute map (name, value) of this descriptor.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

attributeMap

private Map attributeMap
holds user defined attributes

Constructor Detail

DescriptorBase

public DescriptorBase()
Constructor for DescriptorBase.

Method Detail

addAttribute

public void addAttribute(String attributeName,
                         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 String getAttribute(String attributeName,
                           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 String getAttribute(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 Map getAttributes()
Returns the attribute map (name, value) of this descriptor. Note that the returned map is not modifiable.

Returns:
The attributes

getAttributeNames

public 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 String toString()
Overrides:
toString in class Object


Copyright © 2007-2011 The Kuali Foundation. All Rights Reserved.