View Javadoc
1   /*
2    * $Header: /cvsroot/sinon/sinon/src/java/eteg/sinon/exception/EvaluationException.java,v 1.2 2005/06/21 14:25:08 thiagohp Exp $
3    * $Revision: 1.2 $
4    * $Date: 2005/06/21 14:25:08 $
5    * $Author: thiagohp $
6    *
7    * =============================================================================
8    *
9    * Copyright 2004-2005 Eteg Internet Ltda. (http://www.eteg.com.br)
10   *
11   * Licensed under the Apache License, Version 2.0 (the "License");
12   * you may not use this file except in compliance with the License.
13   * You may obtain a copy of the License at
14   *
15   *     http://www.apache.org/licenses/LICENSE-2.0
16   *
17   * Unless required by applicable law or agreed to in writing, software
18   * distributed under the License is distributed on an "AS IS" BASIS,
19   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20   * See the License for the specific language governing permissions and
21   * limitations under the License.
22   */
23  package eteg.sinon.exception;
24  
25  import eteg.sinon.executor.CollectorExecutor;
26  
27  /***
28   * Exceção levantada quando uma expressão (incluindo-se valores de propriedades)
29   * não é avaliada com sucesso.
30   *
31   * @author <a href="mailto:thiagohp at users.sourceforge.net">Thiago H. de Paula Figueiredo</a>
32   * @author Last modified by $Author: thiagohp $
33   * @version $Revision: 1.2 $
34   * @since 0.0
35   */
36  public class EvaluationException extends SinonException {
37  
38      /***
39       * Expressão cuja avaliação não foi realizada com sucesso.
40       */
41      private String expression;
42  
43      /***
44       * Construtor a exceção levantada pelo
45       * Velocity, o {@link CollectorExecutor} sendo executado e a expressão
46       * cuja avaliação não foi realizada com sucesso.
47       *
48       * @param cause o <code>Throwable</code> que causou o erro.
49       * @param executor o {@link CollectorExecutor}
50       * sendo executado no momento do erro.
51       * @param expression uma <code>String</code> cuja avaliação não foi
52       * realizada com sucesso.
53       */
54      public EvaluationException(Throwable cause,
55                                 CollectorExecutor executor,
56                                 String expression) {
57  
58          super("Problemas na avaliação da expressão " + expression,
59                  cause, executor);
60  
61          this.expression = expression;
62  
63      }
64  
65      /***
66       * Retorna a expressão cuja avaliação não foi realizada com sucesso.
67       *
68       * @return uma <code>String</code> contendo a expressão cuja avaliação não
69       * foi realizada com sucesso.
70       */
71      public String getExpression() {
72          return expression;
73      }
74  
75  }