PageRenderTime 47ms CodeModel.GetById 34ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 0ms

/libformula-1.1.3/source/org/pentaho/reporting/libraries/formula/typing/TypeConversionException.java

#
Java | 51 lines | 24 code | 6 blank | 21 comment | 2 complexity | bc2d29ee67d9edcdf508c338bb83d76b MD5 | raw file
Possible License(s): LGPL-2.1
 1/*
 2 * This program is free software; you can redistribute it and/or modify it under the
 3 * terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software
 4 * Foundation.
 5 *
 6 * You should have received a copy of the GNU Lesser General Public License along with this
 7 * program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
 8 * or from the Free Software Foundation, Inc.,
 9 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU Lesser General Public License for more details.
14 *
15 * Copyright (c) 2006 - 2009 Pentaho Corporation and Contributors.  All rights reserved.
16 */
17
18package org.pentaho.reporting.libraries.formula.typing;
19
20import org.pentaho.reporting.libraries.formula.EvaluationException;
21import org.pentaho.reporting.libraries.formula.LibFormulaErrorValue;
22
23/**
24 * Creation-Date: 10.04.2007, 14:13:40
25 *
26 * @author Thomas Morgner
27 */
28public class TypeConversionException extends EvaluationException
29{
30  private static final long serialVersionUID = -12507914833915502L;
31  private static ThreadLocal localInstance = new ThreadLocal();
32
33  protected TypeConversionException()
34  {
35    super(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
36  }
37
38  public static TypeConversionException getInstance()
39  {
40    final TypeConversionException o = (TypeConversionException) localInstance.get();
41    if (o == null)
42    {
43      final TypeConversionException retval = new TypeConversionException();
44      localInstance.set(retval);
45      return retval;
46    }
47
48    o.fillInStackTrace();
49    return o;
50  }
51}