org.apache.ojb.broker.metadata
Class AttributeDescriptorBase

java.lang.Object
  extended by org.apache.ojb.broker.metadata.AttributeDescriptorBase
All Implemented Interfaces:
java.io.Serializable, AttributeContainer
Direct Known Subclasses:
FieldDescriptor, ObjectReferenceDescriptor

public class AttributeDescriptorBase
extends java.lang.Object
implements java.io.Serializable

Is the base class for all other attribute descriptors. It holds basic the mapping information for a specific attribute.

Version:
$Id: AttributeDescriptorBase.java 365232 2005-12-21 22:36:07Z tomdz $
Author:
Thomas Mahler
See Also:
Serialized Form

Constructor Summary
AttributeDescriptorBase(ClassDescriptor descriptor)
          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 getAttributeName()
           
 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()
          Gets the classDescriptor.
 PersistentField getPersistentField()
           
 void setClassDescriptor(ClassDescriptor classDescriptor)
          Sets the classDescriptor.
 void setPersistentField(java.lang.Class c, java.lang.String fieldname)
           
 void setPersistentField(PersistentField pf)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeDescriptorBase

public AttributeDescriptorBase(ClassDescriptor descriptor)
Constructor declaration

Method Detail

setPersistentField

public void setPersistentField(java.lang.Class c,
                               java.lang.String fieldname)
Throws:
MetadataException - if an error occours when setting the PersistenteField

setPersistentField

public void setPersistentField(PersistentField pf)

getPersistentField

public PersistentField getPersistentField()

getAttributeName

public java.lang.String getAttributeName()
Returns:
the name of the Attribute

getClassDescriptor

public ClassDescriptor getClassDescriptor()
Gets the classDescriptor.

Returns:
Returns a ClassDescriptor

setClassDescriptor

public void setClassDescriptor(ClassDescriptor classDescriptor)
Sets the classDescriptor.

Parameters:
classDescriptor - The classDescriptor to set

toString

public java.lang.String toString()

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