Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/acmsl/regexpplugin/jdk14regexp/MalformedPatternExceptionJDKAdapter.java


1   /*
2                   Java Regular Expressions Plugin API
3   
4       Copyright (C) 2002  Jose San Leandro Armendáriz
5                           jsanleandro@yahoo.es
6                           chousz@yahoo.com
7   
8       This library is free software; you can redistribute it and/or
9       modify it under the terms of the GNU Lesser General Public
10      License as published by the Free Software Foundation; either
11      version 2.1 of the License, or (at your option) any later version.
12  
13      This library is distributed in the hope that it will be useful,
14      but WITHOUT ANY WARRANTY; without even the implied warranty of
15      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16      Lesser General Public License for more details.
17  
18      You should have received a copy of the GNU Lesser General Public
19      License along with this library; if not, write to the Free Software
20      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  
22      Thanks to ACM S.L. for distributing this library under the LGPL license.
23      Contact info: jsr000@terra.es
24      Postal Address: c/Playa de Lagoa, 1
25                      Urb. Valdecabañas
26                      Boadilla del monte
27                      28660 Madrid
28                      Spain
29  
30      This library uses some external APIs. So far I haven't released such
31      APIs as projects themselves, but you should be able
32      to download them from the web page where you got this source code.
33   ******************************************************************************
34   *
35   * Filename: $RCSfile: MalformedPatternExceptionJDKAdapter.java,v $
36   *
37   * Author: Jose San Leandro Armendáriz
38   *
39   * Description: Adapts JDK1.4 malformed pattern exceptions to follow
40   *              this API.
41   *
42   * Last modified by: $Author: dev $ at $Date: 2002/09/27 08:58:37 $
43   *
44   * File version: $Revision: 1.4 $
45   *
46   * Project version: $Name:  $
47   *                  ("Name" means no concrete version has been checked out)
48   *
49   * $Id: MalformedPatternExceptionJDKAdapter.java,v 1.4 2002/09/27 08:58:37 dev Exp $
50   *
51   */
52  package org.acmsl.regexpplugin.jdk14regexp;
53  
54  /*
55   * Importing some project-specific classes.
56   */
57  import org.acmsl.regexpplugin.MalformedPatternException;
58  
59  /*
60   * Importing some ACM classes.
61   */
62  import org.acmsl.version.Version;
63  import org.acmsl.version.VersionFactory;
64  
65  /*
66   * Importing some JDK1.4 regexp classes.
67   */
68  import java.util.regex.PatternSyntaxException;
69  
70  /**
71   * Adapts JDK1.4 malformed pattern exceptions to follow this API.
72   * @author <a href="mailto:jsanleandro@yahoo.es"
73             >Jose San Leandro Armendáriz</a>
74   * @version $Revision: 1.4 $
75   */
76  public class MalformedPatternExceptionJDKAdapter
77      extends  MalformedPatternException
78  {
79      /**
80       * Private reference to the actual exception.
81       */
82      private PatternSyntaxException m__Adaptee;
83  
84      /**
85       * Constructs an adapter for given JDK1.4 exception.
86       * @param exception concrete exception instance to adapt.
87       */
88      public MalformedPatternExceptionJDKAdapter(
89          PatternSyntaxException exception)
90      {
91          super(exception.getMessage());
92  
93          setAdaptee(exception);
94      }
95  
96      /**
97       * Sets the adaptee.
98       * @param exception the PatternSyntaxException to adapt.
99       */
100     protected void setAdaptee(PatternSyntaxException exception)
101     {
102         m__Adaptee = exception;
103     }
104 
105     /**
106      * Concrete version object updated everytime it's checked-in in a CVS
107      * repository.
108      */
109     public static final Version VERSION =
110         VersionFactory.createVersion("$Revision: 1.4 $");
111 
112     /**
113      * Retrieves the current version of this object.
114      * @return the version object with such information.
115      */
116     public Version getVersion()
117     {
118         return VERSION;
119     }
120 
121     /**
122      * Retrieves the current version of this class.
123      * @return the object with class version information.
124      */
125     public static Version getClassVersion()
126     {
127         return VERSION;
128     }
129 }