I love the template language

I have looked at a couple and I think it is a really nice balance between
power, flexibility & simplicity.

Here is an example of the template I wrote for the Zeus framework

<XDtTagDef:tagDef namespace="Binding"
handler="com.versata.repository.tool.xdoclet.ZeusBindingTagsHandler"/>
<XDtTagDef:tagDef namespace="Property"
handler="com.versata.repository.tool.xdoclet.ZeusBindingTagsHandler"/>

/*
 * Generated interface for binding <XDtBinding:name/>. Do not edit!
 */

package <XDtBinding:packageName/>;


<XDtBinding:forAllProperties>
<XDtBinding:ifIsNotJavaPrimitive>import
<XDtBinding:fullyQualifiedClassName/>;</XDtBinding:ifIsNotJavaPrimitive>
<XDtProperty:ifIsCollection>import
<XDtProperty:collectionClass/>;</XDtProperty:ifIsCollection>
</XDtBinding:forAllProperties>
<XDtBinding:ifIsJavaSerializable>import
java.io.Serializable;</XDtBinding:ifIsJavaSerializable>

/**
 *
 */

public interface <XDtBinding:className/>
<XDtBinding:ifIsJavaSerializable>extends
java.io.Serializable</XDtBinding:ifIsJavaSerializable>
{

<XDtBinding:forAllProperties>

    /**
     * accessor for <XDtProperty:ifIsCollection>collection
of</XDtProperty:ifIsCollection> <XDtBinding:name/>
<XDtBinding:subTypeDescription/>
     * @return <XDtProperty:ifIsCollection>Collection
of</XDtProperty:ifIsCollection> <XDtBinding:name/>
<XDtBinding:subTypeDescription/>
     */
    <XDtProperty:propertyAccessorMethodDecl/>;

    /**
     * mutator for <XDtProperty:ifIsCollection>collection
of</XDtProperty:ifIsCollection> <XDtBinding:name/>
<XDtBinding:subTypeDescription/>
     * @return <XDtProperty:ifIsCollection>collection
of</XDtProperty:ifIsCollection> <XDtBinding:name/>
<XDtBinding:subTypeDescription/>
     */
    <XDtProperty:propertyMutatorMethodDecl/>;

    <XDtProperty:ifIsCollection>
    /**
     * add another <XDtBinding:name/> to the <XDtBinding:name/>
<XDtBinding:subTypeDescription/> collection
     */
    <XDtProperty:collectionPropertyAddMethodDecl/>;

    /**
     * remove specified <XDtBinding:name/> from the <XDtBinding:name/>
<XDtBinding:subTypeDescription/> collection
     */
    <XDtProperty:collectionPropertyRemoveMethodDecl/>;
    </XDtProperty:ifIsCollection>
</XDtBinding:forAllProperties>


}

Thanks for all the help getting this going

jmp

> -----Original Message-----
> From: Ara Abrahamian [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 29, 2001 3:19 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: support for non-javadoc based template generation
>
>
> Thanks, I will.
> Anyway what's your impression? Is it good for using it as a standalone
> package?
>
> Ara.
>
> > -----Original Message-----
> > From: J. Matthew Pryor [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, November 28, 2001 8:50 AM
> > To: Ara Abrahamian; [EMAIL PROTECTED]
> > Subject: support for non-javadoc based template generation
> >
> > OK I have successfully written and used the xdoclet template engine
> with a
> > non-javadoc source of meta-data (the Zeus binding framework
> specifically)
> >
> > Very cool, thanks for the refactoring Ara.
> >
> > Since my TagHandlers don't have anything to do with javadoc and hence
> > don't
> > inherit from XDocletTagSupport, I had to make a few small changes to
> > TemplateEngine & TagDefTagsHandler. I am confident that these are OK
> to go
> > back into CVS since they are equally applicable to javadoc based
> custom
> > tag
> > handlers
> >
> > Here are the diffs
> >
> > Index: xdoclet/core/src/xdoclet/tags/TagDefTagsHandler.java
> > ===================================================================
> > RCS file:
> >
> /cvsroot/xdoclet/xdoclet/core/src/xdoclet/tags/TagDefTagsHandler.java,v
> > retrieving revision 1.3
> > diff -r1.3 TagDefTagsHandler.java
> > 8a9
> > > import xdoclet.template.TemplateTagHandler;
> > 65c66,70
> > <                       getEngine().setTagHandlerFor( namespace, (
> > XDocletTagSupport ) handler_instance );
> > ---
> > >                       getEngine().setTagHandlerFor( namespace, (
> > >                       /*
> > >                        * jmp mod
> > >                        */
> > >                               TemplateTagHandler ) handler_instance
> );
> > =
> > Index: xdoclet/core/src/xdoclet/template/TemplateEngine.java
> > ===================================================================
> > RCS file:
> >
> /cvsroot/xdoclet/xdoclet/core/src/xdoclet/template/TemplateEngine.java,v
> > retrieving revision 1.8
> > diff -r1.8 TemplateEngine.java
> > 51a52,54
> > >       // jmp mod - need to remember this so we can set it for loaded
> tag
> > handlers
> > >       private transient TemplateContext context = null;
> > >
> > 84a88,90
> > >                       // jmp mod need to keep this so we can set it
> for
> > loaded tag handlers
> > >                       this.context = context;
> > >
> > 255a262,265
> > >
> > >               // jmp addititions - need to set these don't we ?
> > >               tag_handler.setEngine( this );
> > >               tag_handler.setContext( context );
> >
> > Cheers,
> > jmp
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>


_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to