commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel F. Savarese" <...@savarese.org>
Subject Re: [vfs][all][poll]regular expression library or jdk1.4 as minim um requirement
Date Tue, 15 Jun 2004 03:15:11 GMT

In message <F369B5B779D1794FB19653920D62D3BD39E9DE@kossuth.synygy.net>, "Inger,
 Matthew" writes:
>Why not take the road that ANT takes:
>
>1. Create an interface to do your regular expression functions
>2. Implement one for JDK 1.4, and one for Jakarta-Oro (and potentially
>   others like Jakarta-Regexp)
>3. Using reflection instantiate the appropriate implementation class
>   ie (this is typed now, and may not compile without tweeking)

All of this already exists on the jakarta-oro head branch.  I implemented
the J2SE 1.4 wrapper in the past couple of hours because I haven't been
very successful as using that as a lure to get more committers involved in
jakarta-oro.  I don't know to persuade people with an itch to scratch it.
In any case, I'll restate that jakarta-oro is not a regular expression
engine, but a set of generic interfaces to implement engines (along with
some implementations).  Using jakarta-oro, all vfs has to do is something
like this to choose an engine:

PatternMatchingEngineFactory factory = new PatternMatchingEngineFactory();
PatternMatchingEngine engine;
PatternCompiler compiler;
PatternMatcher matcher;
String engineKey;

if(factory.containsKey(PatternMatchingEngineFactory.JAVA_KEY))
  engineKey = PatternMatchingEngineFactory.JAVA_KEY;
else
  engineKey = PatternMatchingEngineFactory.PERL5_KEY;

engine   = factory.get(engineKey);
compiler = engine.createCompiler();
matcher  = engine.createCompiler();

Interested parties can implement a wrapper for jakarta-regexp using
the java wrapper in org.apache.oro.text.java as a guide and I'm sure
the PMC will grant committership in an instant to any commons committer.

daniel



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message