kinman      2002/11/22 17:36:49

  Modified:    jasper2/src/share/org/apache/jasper/compiler Generator.java
                        Node.java
  Added:       jasper2/src/share/org/apache/jasper/compiler
                        TagPluginManager.java
               jasper2/src/share/org/apache/jasper/compiler/tagplugin
                        TagPlugin.java TagPluginContext.java
                        TagPluginFactory.java
  Log:
  - Define interfaces for tag plugins.
  - Modify Generator to prepare attributes that may be access from plugins.
  
  Revision  Changes    Path
  1.130     +83 -67    
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.129
  retrieving revision 1.130
  diff -u -r1.129 -r1.130
  --- Generator.java    22 Nov 2002 23:47:15 -0000      1.129
  +++ Generator.java    23 Nov 2002 01:36:49 -0000      1.130
  @@ -1558,6 +1558,8 @@
                   generateLocalVariables( out, n );
               }
   
  +         prepareCustomAttributes(n, handlerInfo);
  +
            if (n.implementsSimpleTag()) {
                generateCustomDoTag(n, handlerInfo, tagHandlerVar);
            } else {
  @@ -1879,6 +1881,69 @@
            }
        }
   
  +     /**
  +      * Preprocess the attributes for the custom tag, except fragment
  +      * attributes.
  +      */
  +     private void prepareCustomAttributes(Node.CustomTag n,
  +                                          TagHandlerInfo handlerInfo)
  +                    throws JasperException {
  +
  +            Node.JspAttribute[] attrs = n.getJspAttributes();
  +            for (int i=0; i<attrs.length; i++) {
  +                String attrValue = attrs[i].getValue();
  +                if (attrValue == null) {
  +                    if (attrs[i].isNamedAttribute() ) {
  +                        if (!n.checkIfAttributeIsJspFragment(
  +                             attrs[i].getName())) {
  +                            attrValue = generateNamedAttributeValue(
  +                                attrs[i].getNamedAttributeNode() );
  +                        }
  +                    }
  +                    else {
  +                        continue;
  +                    }
  +                }
  +                String attrName = attrs[i].getName();
  +
  +                Method m = null;
  +                Class[] c = null;
  +                if (attrs[i].isDynamic()) {
  +                    c = OBJECT_CLASS;
  +                } else {
  +                    m = handlerInfo.getSetterMethod(attrName);
  +                    if (m == null) {
  +                        err.jspError(n, "jsp.error.unable.to_find_method",
  +                                     attrName);
  +                    }
  +                    c = m.getParameterTypes();
  +                    // XXX assert(c.length > 0)
  +                }
  +
  +                if (attrs[i].isExpression()) {
  +                    // Do nothing
  +                } else if (attrs[i].isNamedAttribute()) {
  +                    if (!n.checkIfAttributeIsJspFragment(attrs[i].getName())
  +                            && !attrs[i].isDynamic()) {
  +                        attrValue = convertString(
  +                                c[0], attrValue, attrName,
  +                                handlerInfo.getPropertyEditorClass(attrName),
  +                                false);
  +                    }
  +                } else if (attrs[i].isELInterpreterInput()) {
  +                    // run attrValue through the expression interpreter
  +                    attrValue = JspUtil.interpreterCall(this.isTagFile,
  +                        attrValue, c[0], n.getPrefix(), "_jspx_fnmap" );
  +                } else {
  +                    attrValue = convertString(
  +                                c[0], attrValue, attrName,
  +                                handlerInfo.getPropertyEditorClass(attrName),
  +                                true);
  +                }
  +             attrs[i].setProcessedValue(attrValue);
  +         }
  +     }
  +
        private void generateCustomStart(Node.CustomTag n,
                                         TagHandlerInfo handlerInfo,
                                         String tagHandlerVar,
  @@ -2384,70 +2449,20 @@
                out.println(");");
            }
   
  -         Node.JspAttribute[] attrs = n.getJspAttributes();
  -         for (int i=0; i<attrs.length; i++) {
  -             String attrValue = attrs[i].getValue();
  -             if (attrValue == null) {
  -                    if( attrs[i].isNamedAttribute() ) {
  -                        if( n.checkIfAttributeIsJspFragment( 
  -                            attrs[i].getName() ) ) 
  -                        {
  -                            // XXX - no need to generate temporary variable 
  -                            // here
  -                            attrValue = generateNamedAttributeJspFragment( 
  +            Node.JspAttribute[] attrs = n.getJspAttributes();
  +            for (int i=0; i<attrs.length; i++) {
  +                String attrValue = attrs[i].getProcessedValue();
  +             if (attrValue == null && attrs[i].isNamedAttribute() &&
  +                     n.checkIfAttributeIsJspFragment(attrs[i].getName())) {
  +                 // XXX - no need to generate temporary variable here
  +                 attrValue = generateNamedAttributeJspFragment(
                                   attrs[i].getNamedAttributeNode(),
  -                                tagHandlerVar );
  -                        }
  -                        else {
  -                            attrValue = generateNamedAttributeValue( 
  -                                attrs[i].getNamedAttributeNode() );
  -                        }
  -                    } 
  -                    else {
  -                        continue;
  -                    }
  -             }
  -             String attrName = attrs[i].getName();
  -
  -             Method m = null;
  -             Class[] c = null;
  -             if (attrs[i].isDynamic()) {
  -                 c = OBJECT_CLASS;
  -             } else {
  -                 m = handlerInfo.getSetterMethod(attrName);
  -                 if (m == null) {
  -                     err.jspError(n, "jsp.error.unable.to_find_method",
  -                                  attrName);
  -                 }
  -                 c = m.getParameterTypes();
  -                 // XXX assert(c.length > 0)
  -             }
  -
  -             if (attrs[i].isExpression()) {
  -                 // Do nothing
  -             } else if (attrs[i].isNamedAttribute()) {
  -                 if (!n.checkIfAttributeIsJspFragment(attrs[i].getName())
  -                         && !attrs[i].isDynamic()) {
  -                     attrValue = convertString(
  -                                c[0], attrValue, attrName,
  -                             handlerInfo.getPropertyEditorClass(attrName),
  -                             false);
  -                 }
  -             } else if (attrs[i].isELInterpreterInput()) {
  -                    // run attrValue through the expression interpreter
  -                    attrValue = JspUtil.interpreterCall(this.isTagFile,
  -                        attrValue, c[0], n.getPrefix(), "_jspx_fnmap" );
  -                } else {
  -                 attrValue = convertString(
  -                                c[0], attrValue, attrName,
  -                             handlerInfo.getPropertyEditorClass(attrName),
  -                             true);
  -             }
  -             
  -             if (attrs[i].isDynamic()) {
  -                 out.printin(tagHandlerVar);
  -                 out.print(".");
  -                 out.print("setDynamicAttribute(");
  +                                tagHandlerVar);
  +                }
  +                if (attrs[i].isDynamic()) {
  +                    out.printin(tagHandlerVar);
  +                    out.print(".");
  +                    out.print("setDynamicAttribute(");
                       String uri = attrs[i].getURI();
                       if( "".equals( uri ) || (uri == null) ) {
                           out.print( "null" );
  @@ -2455,6 +2470,7 @@
                       else {
                           out.print("\"" + attrs[i].getURI() + "\"");
                       }
  +
                    out.print(", \"");
                    out.print(attrs[i].getLocalName());
                    out.print("\", ");
  @@ -2463,7 +2479,7 @@
                } else {
                    out.printin(tagHandlerVar);
                    out.print(".");
  -                 out.print(m.getName());
  +                 
out.print(handlerInfo.getSetterMethod(attrs[i].getName()).getName());
                    out.print("(");
                    out.print(attrValue);
                    out.println(");");
  
  
  
  1.40      +18 -3     
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java
  
  Index: Node.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Node.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- Node.java 8 Nov 2002 19:55:47 -0000       1.39
  +++ Node.java 23 Nov 2002 01:36:49 -0000      1.40
  @@ -1395,6 +1395,13 @@
        private String uri;
        private String localName;
        private String value;
  +     /**
  +      * Value of the attribute after being proccessed, so that it
  +      * represents a Java expression, and not arbitary statements.
  +      * Currently only for CustomTag 's.
  +      * TODO: Maybe it's a good idea that it should contain NO EL.
  +      */
  +     private String processedValue;
        private boolean expression;
           private boolean el;
        private boolean dynamic;
  @@ -1512,6 +1519,14 @@
         */
        public boolean isDynamic() {
            return dynamic;
  +     }
  +
  +     public String getProcessedValue() {
  +         return processedValue;
  +     }
  +
  +     public void setProcessedValue(String pv) {
  +         processedValue = pv;
        }
       }
   
  
  
  
  1.1                  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagPluginManager.java
  
  Index: TagPluginManager.java
  ===================================================================
  /*
   * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagPluginManager.java,v
 1.1 2002/11/23 01:36:49 kinman Exp $
   * $Revision: 1.1 $
   * $Date: 2002/11/23 01:36:49 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package org.apache.jasper.compiler;
  
  import java.util.*;
  import java.io.*;
  import org.apache.jasper.JasperException;
  import org.apache.jasper.xmlparser.ParserUtils;
  import org.apache.jasper.xmlparser.TreeNode;
  import org.apache.jasper.JspCompilationContext;
  import org.apache.jasper.compiler.tagplugin.TagPlugin;
  import org.apache.jasper.compiler.tagplugin.TagPluginFactory;
  import org.apache.jasper.compiler.tagplugin.TagPluginContext;
  
  /**
   * Manages tag plugin optimizations.
   * @author Kin-man Chung
   */
  
  public class TagPluginManager {
  
      static private final String plugInsXml = "tagPlugins.xml";
      private boolean initialized = false;
      private Hashtable tagPlugins = null;
      private JspCompilationContext ctxt;
  
  
      TagPluginManager(JspCompilationContext ctxt) {
        this.ctxt = ctxt;
        init();
      }
  
      private void init() {
        if (initialized)
            return;
  
        InputStream is = ctxt.getResourceAsStream(plugInsXml);
        if (is == null)
            return;
  
        TreeNode root = null;
        try {
            root = (new ParserUtils()).parseXMLDocument(plugInsXml, is);
        } catch (JasperException ex) {
        }
        if (root == null)
            return;
  
        TreeNode tagPluginsNode = root.findChild("tag-plugins");
        if (tagPluginsNode == null) {
            // Error
            return;
        }
  
        Iterator pluginList = tagPluginsNode.findChildren("tag-plugin");
        while (pluginList.hasNext()) {
            TreeNode pluginNode = (TreeNode) pluginList.next();
              TreeNode tagClassNode = pluginNode.findChild("tag-class");
            if (tagClassNode == null) {
                // Error
                return;
            }
            String tagClass = tagClassNode.getBody().trim();
            TreeNode pluginClassNode = pluginNode.findChild("plugin-class");
            if (pluginClassNode == null) {
                // Error
                return;
            }
  
            String pluginClassStr = pluginClassNode.getBody();
            TagPlugin tagPlugin = null;
            try {
                Class pluginClass = Class.forName(pluginClassStr);
                tagPlugin = (TagPlugin) pluginClass.newInstance();
            } catch (ClassNotFoundException e) {
            } catch (InstantiationException e) {
            } catch (IllegalAccessException e) {
            }
            if (tagPlugin == null) {
                return;
            }
            tagPlugins.put(tagClass, tagPlugin);
        }
      }
  
      public TagPlugin getPlugInClass(Node.CustomTag n, ServletWriter out) {
  
        if (tagPlugins == null) {
            return null;
        }
  
        TagPluginFactory tagPluginFactory = (TagPluginFactory)
                tagPlugins.get(n.getTagHandlerClass().getName());
        if (tagPluginFactory == null) {
            return null;
        }
  
        TagPluginContext tagPluginContext = new TagPluginContextImpl(n, out);
        return tagPluginFactory.createTagPlugin(n.getName(), tagPluginContext);
      }
  
      static class TagPluginContextImpl implements TagPluginContext {
        Node.CustomTag node;
        ServletWriter out;
  
        TagPluginContextImpl(Node.CustomTag n, ServletWriter out) {
            this.node = n;
            this.out = out;
        }
  
        public ServletWriter getServletWriter() {
            return out;
        }
  
        public boolean isScriptless() {
            return node.getChildInfo().isScriptless();
        }
  
        public String getAttributeValue(String attribute) {
            Node.JspAttribute[] attrs = node.getJspAttributes();
            for (int i=0; i < attrs.length; i++) {
                if (attrs[i].getName().equals(attribute)) {
                    return attrs[i].getProcessedValue();
                }
            }
            return null;
        }
      }
  }
  
  
  
  1.1                  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/tagplugin/TagPlugin.java
  
  Index: TagPlugin.java
  ===================================================================
  /*
   * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/tagplugin/TagPlugin.java,v
 1.1 2002/11/23 01:36:49 kinman Exp $
   * $Revision: 1.1 $
   * $Date: 2002/11/23 01:36:49 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package org.apache.jasper.compiler.tagplugin;
  
  /**
   * This interface is to be implemented by the plugin author, to supply
   * an alternate implementation of the tag handlers.  Used to specify
   * the Java codes that need to be generated when a tag is referenced.
   */
  
  public interface TagPlugin {
  
      /**
       * Invoked to generate Java codes at the start of a custom tag.
       */
      void atSTag();
  
      /**
       * Invoked to generate Java codes at the end of a custom tag.
       */
      void atETag();
  }
  
  
  
  
  1.1                  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/tagplugin/TagPluginContext.java
  
  Index: TagPluginContext.java
  ===================================================================
  /*
   * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/tagplugin/TagPluginContext.java,v
 1.1 2002/11/23 01:36:49 kinman Exp $
   * $Revision: 1.1 $
   * $Date: 2002/11/23 01:36:49 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package org.apache.jasper.compiler.tagplugin;
  
  import org.apache.jasper.compiler.ServletWriter;
  
  /**
   * This interface allows the plugin author to query about the properties
   * of the current tag, and to use Jasper resources, such as ServletWriter.
   */
  
  public interface TagPluginContext {
      /**
        * @return true if the body of the tag is scriptless.
        */
      boolean isScriptless();
  
      /**
       * Get the evaluated value of the given attribute for the current tag
       * @return null if the attribute is not specified, or a java expression
       *              that when evaluateed, represent the attribute value
       */
      String getAttributeValue(String attribute);
  
      /**
       * Used for outputting Java fragments to the output stream.
       */
      ServletWriter getServletWriter();
  }
  
  
  
  
  1.1                  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/tagplugin/TagPluginFactory.java
  
  Index: TagPluginFactory.java
  ===================================================================
  /*
   * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/tagplugin/TagPluginFactory.java,v
 1.1 2002/11/23 01:36:49 kinman Exp $
   * $Revision: 1.1 $
   * $Date: 2002/11/23 01:36:49 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package org.apache.jasper.compiler.tagplugin;
  
  /**
   * This interface is to be implemented by the plugin, to supply
   * an alternate implementation of the tag handlers.  Used for create
   * an instance of a TagPlugin.
   */
  
  public interface TagPluginFactory {
  
      /**
       * Invoked at the beginning of a custom tag.  Used to create a
       * TagPlugin object for the tag.
       * @param tagName The name of the current tag
       * @param tpContext A TagPlugContext created by Jasper containing context
       *                  informantion about the tag under compilation
       * @return a TagPlugin for the current tag, or a false if the plugin
       *         cannot be found or created and that Jasper should generate
       *         Tag API's as usual.
       */
  
      TagPlugin createTagPlugin(String tagName, TagPluginContext tpContext);
  }
  
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to