ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/api/metadata ModelException.java Modeller.java
Date Sat, 20 Apr 2002 23:10:48 GMT
donaldp     02/04/20 16:10:48

  Modified:    api/src/java/org/apache/myrmidon/api/metadata Modeller.java
  Added:       api/src/java/org/apache/myrmidon/api/metadata
                        ModelException.java
  Log:
  Add in a ModelException and make
  Modeller throw a ModelException.
  This is a drop in replacement for
  ConfiugrationException.
  
  Revision  Changes    Path
  1.2       +4 -2      jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/api/metadata/Modeller.java
  
  Index: Modeller.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/api/metadata/Modeller.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Modeller.java	21 Mar 2002 10:22:48 -0000	1.1
  +++ Modeller.java	20 Apr 2002 23:10:48 -0000	1.2
  @@ -14,7 +14,7 @@
    * the element to configure itself.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.1 $ $Date: 2002/03/21 10:22:48 $
  + * @version $Revision: 1.2 $ $Date: 2002/04/20 23:10:48 $
    * @see ModelElement
    */
   public interface Modeller
  @@ -24,6 +24,8 @@
        * model.
        *
        * @param element the ModelElement representing object
  +     * @throws ModelException if there is an error interpreting model
        */
  -    void model( ModelElement element );
  +    void model( ModelElement element )
  +        throws ModelException;
   }
  
  
  
  1.1                  jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/api/metadata/ModelException.java
  
  Index: ModelException.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.myrmidon.api.metadata;
  
  /**
   * A ModelException is thrown when there is a problem
   * mapping a ModelElement onto an object,
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/04/20 23:10:48 $
   */
  public class ModelException
      extends Exception
  {
      /**
       * The Throwable that caused this exception to be thrown.
       */
      private final Throwable m_throwable;
  
      /**
       * Basic constructor for exception that does not specify a message
       */
      public ModelException()
      {
          this( "", null );
      }
  
      /**
       * Basic constructor with a message
       *
       * @param message the message
       */
      public ModelException( final String message )
      {
          this( message, null );
      }
  
      /**
       * Constructor that builds cascade so that other exception information can be retained.
       *
       * @param message the message
       * @param throwable the throwable
       */
      public ModelException( final String message, final Throwable throwable )
      {
          super( message );
          m_throwable = throwable;
      }
  
      /**
       * Retrieve root cause of the exception.
       *
       * @return the root cause
       */
      public final Throwable getCause()
      {
          return m_throwable;
      }
  }
  
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message