commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark R. Diggory" <mdigg...@latte.harvard.edu>
Subject [Jelly] BCEL Taglibrary Beginnings
Date Sun, 19 Jan 2003 23:06:03 GMT
I started writting the beginnings of a BCEL taglibrary. Although it may 
be a bit different than others may anticipate.

Basically I've built two tags and a supporting "BeanExtender" class to 
support them.

<bcel:extends
    baseClass="java.lang.Object" 	
    packageName="org.foo"
    className="Test">
    <bcel:add-property name="bar" propertyType="int" write="false"/>
    <bcel:add-property name="bam" propertyType="java.lang.String"/>
</bcel:extends>

Basically creates a new Class (org.foo.Test) that has:

package org.foo;

public Test extends java.lang.Object {

   private int bar;
   private String bam;

   public Test(){}

   public int getBar(){
    return bar;
    }

   public String getBam(){
    return bam;
    }

   public void setBam(String bam){
    this.bam = bam;
    }
}

It then "changes" the Security access on the ClassLoader "define" 
method. Allowing the class to be added into the current loader. Once the 
class is available it can then be instantiated by <useBean> or <new>.

I'm sure there are some more "flexible" ways to design the Taglibrary, I 
consider this to be a "first blush" over the idea. I'd be glad to donate 
the code if others are interested in developing it too.

-Mark Diggory


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


Mime
View raw message