You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by to...@apache.org on 2005/01/11 21:21:24 UTC

cvs commit: db-ojb/src/java/org/apache/ojb/broker/metadata DescriptorBase.java

tomdz       2005/01/11 12:21:24

  Modified:    src/java/org/apache/ojb/broker/metadata DescriptorBase.java
  Log:
  Added method that returns an array of the names of all attributes
  
  Revision  Changes    Path
  1.11      +16 -0     db-ojb/src/java/org/apache/ojb/broker/metadata/DescriptorBase.java
  
  Index: DescriptorBase.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/metadata/DescriptorBase.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DescriptorBase.java	14 Sep 2004 16:17:41 -0000	1.10
  +++ DescriptorBase.java	11 Jan 2005 20:21:24 -0000	1.11
  @@ -16,7 +16,9 @@
    */
   
   import java.io.Serializable;
  +import java.util.HashSet;
   import java.util.Properties;
  +import java.util.Set;
   
   /**
    * base class for all Descriptors. It is used to implement the AttributeContainer
  @@ -39,6 +41,20 @@
       public Properties getAttributes()
       {
           return attributes;
  +    }
  +
  +    /**
  +     * Returns an array of the names of all atributes of this descriptor.
  +     * 
  +     * @return The list of attribute names (will not be <code>null</code>)
  +     */
  +    public String[] getAttributeNames()
  +    {
  +        Set      keys   = (attributes == null ? new HashSet() : attributes.keySet());
  +        String[] result = new String[keys.size()];
  +
  +        keys.toArray(result);
  +        return result;
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org