donaldp     2002/10/01 16:38:26

  Added:       info/src/java/org/apache/avalon/framework/info
                        MethodDescriptor.java
  Log:
  Add a descriptor for methods
  
  Revision  Changes    Path
  1.1                  
jakarta-avalon-excalibur/info/src/java/org/apache/avalon/framework/info/MethodDescriptor.java
  
  Index: MethodDescriptor.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.avalon.framework.info;
  
  import java.io.Serializable;
  
  /**
   * A descriptor that describes a Method. It contains
   * information about;
   * <ul>
   *   <li>name: the name of the method</li>
   *   <li>return type: the return type of the method</li>
   *   <li>parameters: the parameters a method takes</li>
   * </ul>
   *
   * <p>Also associated with each method is a set of arbitrary
   * Attributes that can be used to store extra information
   * about method. See {@link ComponentDescriptor} for example
   * of how to declare the container specific Attributes.</p>
   *
   * @author <a href="mailto:peter at apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/10/01 23:38:26 $
   */
  public final class MethodDescriptor
      extends FeatureDescriptor
      implements Serializable
  {
      /**
       * The name of the Method.
       */
      private final String m_name;
  
      /**
       * The return type of the method.
       */
      private final String m_returnType;
  
      /**
       * The parameters associated with the method.
       */
      private final ParameterDescriptor[] m_parameters;
  
      /**
       * Create a descriptor for a method.
       *
       * @param name the name of the method
       * @param returnType the return type of the method
       * @param parameters the parameters of the method
       * @param attributes any attributes associated with method
       */
      public MethodDescriptor( final String name,
                               final String returnType,
                               final ParameterDescriptor[] parameters,
                               final Attribute[] attributes )
      {
          super( attributes );
          if( null == name )
          {
              throw new NullPointerException( "name" );
          }
          if( null == returnType )
          {
              throw new NullPointerException( "returnType" );
          }
          if( null == parameters )
          {
              throw new NullPointerException( "parameters" );
          }
  
          m_name = name;
          m_returnType = returnType;
          m_parameters = parameters;
      }
  
      /**
       * Return the name of the method.
       *
       * @return the name of the method.
       */
      public String getName()
      {
          return m_name;
      }
  
      /**
       * Return the return type of the method.
       *
       * @return the return type of the method.
       */
      public String getReturnType()
      {
          return m_returnType;
      }
  
      /**
       * Return the parameters associated with method.
       *
       * @return the parameters associated with method.
       */
      public ParameterDescriptor[] getParameters()
      {
          return m_parameters;
      }
  }
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to