org.codehaus.metaclass.model
Class Attribute

java.lang.Object
  extended byorg.codehaus.metaclass.model.Attribute
All Implemented Interfaces:
java.io.Serializable

public final class Attribute
extends java.lang.Object
implements java.io.Serializable

Attributes are the mechanism via which metadata is represented. Each Attribute is made up of

Version:
$Revision: 1.12 $ $Date: 2003/12/08 23:30:10 $
Author:
Peter Donald, Doug Hagan
See Also:
Serialized Form

Field Summary
static Attribute[] EMPTY_SET
          The constant for Empty Set of attributes.
 
Constructor Summary
Attribute(java.lang.String name)
          Create a Attribute with specified name.
Attribute(java.lang.String name, java.util.Properties parameters)
          Create a Attribute with specified name and parameters.
Attribute(java.lang.String name, java.lang.String value)
          Create a Attribute with specified name and value.
 
Method Summary
 java.lang.String getName()
          Return the name of the Attribute.
 java.lang.String getParameter(java.lang.String key)
          Return the parameter for specified key.
 java.lang.String getParameter(java.lang.String key, java.lang.String defaultValue)
          Return the parameter for specified key, or defaultValue if unspecified.
 int getParameterCount()
          Return the number of parameters in attribute.
 java.lang.String[] getParameterNames()
          Returns an array of parameter names available under this Attribute.
 java.lang.String getValue()
          Return the value of the Attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_SET

public static final Attribute[] EMPTY_SET
The constant for Empty Set of attributes.

Constructor Detail

Attribute

public Attribute(java.lang.String name)
Create a Attribute with specified name.

Parameters:
name - the Attribute name

Attribute

public Attribute(java.lang.String name,
                 java.util.Properties parameters)
Create a Attribute with specified name and parameters.

Parameters:
name - the Attribute name
parameters - the Attribute parameters

Attribute

public Attribute(java.lang.String name,
                 java.lang.String value)
Create a Attribute with specified name and value.

Parameters:
name - the Attribute name
value - the Attribute value
Method Detail

getName

public java.lang.String getName()
Return the name of the Attribute.

Returns:
the name of the Attribute.

getValue

public java.lang.String getValue()
Return the value of the Attribute.

Returns:
the value of the Attribute.

getParameterCount

public int getParameterCount()
Return the number of parameters in attribute.

Returns:
the number of parameters in attribute.

getParameter

public java.lang.String getParameter(java.lang.String key)
Return the parameter for specified key.

Parameters:
key - the parameters key
Returns:
the parameter for specified key.

getParameter

public java.lang.String getParameter(java.lang.String key,
                                     java.lang.String defaultValue)
Return the parameter for specified key, or defaultValue if unspecified.

Parameters:
key - the parameters key
defaultValue - the default value if parameter unspecified
Returns:
the parameter for specified key, or defaultValue if unspecified.

getParameterNames

public java.lang.String[] getParameterNames()
Returns an array of parameter names available under this Attribute.

Returns:
an array of parameter names available under this Attribute.


Copyright © 2003-2004 Codehaus. All Rights Reserved.