KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > teamkonzept > lib > TKReg


1 /*
2  * $Header: /cvsroot/webman-cms/source/webman/com/teamkonzept/lib/TKReg.java,v 1.5 2000/05/22 15:01:21 careck Exp $
3  *
4  */

5 package com.teamkonzept.lib;
6
7 import com.oroinc.text.regex.*;
8
9 public class TKReg {
10     static PatternCompiler compiler;
11     static TKSubstitutor substitutor;
12     static boolean initialized = false;
13     
14     public static PatternMatcher getMatcher()
15     {
16         return new Perl5Matcher();
17     }
18     
19     public static PatternCompiler getCompiler()
20     {
21         if( !initialized ) init();
22         return compiler;
23     }
24     
25     public static TKSubstitutor getSubstitutor()
26     {
27         if( !initialized ) init();
28         return substitutor;
29     }
30     
31     static void init()
32     {
33         if( !initialized ) {
34             compiler = new Perl5Compiler();
35             substitutor = new TKSubstitutor();
36             initialized = true;
37         }
38     }
39     
40     static {
41         init();
42     }
43 }
44
Popular Tags