jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eduardo Pelegri--Llopart <Eduardo.Pelegrillop...@eng.sun.com>
Subject Re: Another taglib idea/offer: generic filters
Date Sun, 13 Aug 2000 15:16:55 GMT
This is quite similar in spirit to the XML filtering tag library that
Craig and I had talked about.  We had suggested going for subclassing of
the tag handler, that would make it easier to create new tag handlers
that do some specific task.  Using a class name in the tag is another
alternative.  I guess each has advantages, a subclass encapsulates
better, but requires a bit more expertise.  Maybe it is a good idea for
tag hanlders that are intended to be customized to support both
approaches?

BTW, Craig, are you or Justyna working on the XML filtering tag
library?  If not, maybe Shawn could, he seems to be itching for things
to do :-)

	- eduard/o

Shawn Bayern wrote:
> 
> Any interest in providing "content filters" that work much like
> traditional Unix programs that read from stdin and write to stdout?  In
> concept, they would work like the XSL "apply" tag, except that they'd deal
> with unstructured rather than structured content.
> 
> I'm thinking that the best way to implement this would be to define a thin
> interface, "Filter," that contains a single method declaration:
> 
>         String filterString(String in);
> 
> Classes that implement filter could then be referred to by (at least) two
> tags,
> 
>     <filter:body filter="org.blah.FilterOne">
>         Filter inline body content found here.
>     </filter:body>
> 
> and
> 
>     <filter:uri uri="http://blah.org/base" filter="org.blah.FilterOne" />
> 
> which would filter, respectively, inline body content or the data stored
> at a URI (much the way the "utility" taglib's "include" tag does).  In the
> above examples, org.blah.FilterOne is just a class that implements Filter.
> (Alternatively, you could pass an instance in, instead of just the name,
> but this seems cleaner and more in line with existing taglib directives.)
> 
> Thoughts?  I'll have it ready in a day or so if people think it's useful.
> 
> Shawn

Mime
View raw message