tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From man...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/jasper/compiler BaseJspListener.java DelegatingListener.java DumbParseEventListener.java JspParseEventListener.java ParseEventListener.java Parser.java TagBeginGenerator.java TagEndGenerator.java TagLibraries.java TagLibraryInfoImpl.java
Date Wed, 14 Jun 2000 22:51:58 GMT
mandar      00/06/14 15:51:57

  Modified:    src/share/org/apache/jasper/compiler BaseJspListener.java
                        DelegatingListener.java DumbParseEventListener.java
                        JspParseEventListener.java ParseEventListener.java
                        Parser.java TagBeginGenerator.java
                        TagEndGenerator.java TagLibraries.java
                        TagLibraryInfoImpl.java
  Log:
    Allow custom implementation of TagLibraryInfo.
  
  Revision  Changes    Path
  1.6       +5 -5      jakarta-tomcat/src/share/org/apache/jasper/compiler/BaseJspListener.java
  
  Index: BaseJspListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/BaseJspListener.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- BaseJspListener.java	2000/02/25 19:45:37	1.5
  +++ BaseJspListener.java	2000/06/14 22:51:49	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/BaseJspListener.java,v
1.5 2000/02/25 19:45:37 mandar Exp $
  - * $Revision: 1.5 $
  - * $Date: 2000/02/25 19:45:37 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/BaseJspListener.java,v
1.6 2000/06/14 22:51:49 mandar Exp $
  + * $Revision: 1.6 $
  + * $Date: 2000/06/14 22:51:49 $
    *
    * ====================================================================
    * 
  @@ -162,7 +162,7 @@
       }
   
       public void handleTagBegin(Mark start, Mark stop, Hashtable attrs, String prefix, 
  -			       String shortTagName, TagLibraryInfoImpl tli, 
  +			       String shortTagName, TagLibraryInfo tli, 
   			       TagInfo ti)
   	throws JasperException
       {
  @@ -171,7 +171,7 @@
       
       public void handleTagEnd(Mark start, Mark stop, String prefix, 
   			     String shortTagName, Hashtable attrs, 
  -                             TagLibraryInfoImpl tli, TagInfo ti)
  +                             TagLibraryInfo tli, TagInfo ti)
   	throws JasperException
       {
   	throw new JasperException(Constants.getString("jsp.error.not.impl.taglib"));
  
  
  
  1.6       +5 -5      jakarta-tomcat/src/share/org/apache/jasper/compiler/DelegatingListener.java
  
  Index: DelegatingListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/DelegatingListener.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DelegatingListener.java	2000/02/25 19:45:38	1.5
  +++ DelegatingListener.java	2000/06/14 22:51:49	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/DelegatingListener.java,v
1.5 2000/02/25 19:45:38 mandar Exp $
  - * $Revision: 1.5 $
  - * $Date: 2000/02/25 19:45:38 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/DelegatingListener.java,v
1.6 2000/06/14 22:51:49 mandar Exp $
  + * $Revision: 1.6 $
  + * $Date: 2000/06/14 22:51:49 $
    *
    * ====================================================================
    * 
  @@ -186,7 +186,7 @@
       }
   
       public void handleTagBegin(Mark start, Mark stop, Hashtable attrs, String prefix, 
  -			       String shortTagName, TagLibraryInfoImpl tli, 
  +			       String shortTagName, TagLibraryInfo tli, 
   			       TagInfo ti)
   	throws JasperException
       {
  @@ -196,7 +196,7 @@
       
       public void handleTagEnd(Mark start, Mark stop, String prefix, 
   			     String shortTagName, Hashtable attrs, 
  -                             TagLibraryInfoImpl tli, TagInfo ti)
  +                             TagLibraryInfo tli, TagInfo ti)
   	throws JasperException
       {
           doAction(this.tmplStart, this.tmplStop);
  
  
  
  1.4       +5 -5      jakarta-tomcat/src/share/org/apache/jasper/compiler/DumbParseEventListener.java
  
  Index: DumbParseEventListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/DumbParseEventListener.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DumbParseEventListener.java	1999/12/21 16:32:31	1.3
  +++ DumbParseEventListener.java	2000/06/14 22:51:50	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/DumbParseEventListener.java,v
1.3 1999/12/21 16:32:31 rubys Exp $
  - * $Revision: 1.3 $
  - * $Date: 1999/12/21 16:32:31 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/DumbParseEventListener.java,v
1.4 2000/06/14 22:51:50 mandar Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/06/14 22:51:50 $
    *
    * ====================================================================
    * 
  @@ -180,7 +180,7 @@
       }
   
       public void handleTagBegin(Mark start, Hashtable attrs, String prefix, 
  -			       String shortTagName, TagLibraryInfoImpl tli, 
  +			       String shortTagName, TagLibraryInfo tli, 
   			       TagInfo ti)
   	throws JasperException
       {
  @@ -190,7 +190,7 @@
       
       public void handleTagEnd(Mark start, Mark stop, String prefix, 
   			     String shortTagName, Hashtable attrs, 
  -                             TagLibraryInfoImpl tli, TagInfo ti)
  +                             TagLibraryInfo tli, TagInfo ti)
   	throws JasperException
       {
   	System.err.println("\nUser-defined Tag End "+prefix+":"+shortTagName+" --> ");
  
  
  
  1.17      +9 -8      jakarta-tomcat/src/share/org/apache/jasper/compiler/JspParseEventListener.java
  
  Index: JspParseEventListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- JspParseEventListener.java	2000/06/11 21:41:06	1.16
  +++ JspParseEventListener.java	2000/06/14 22:51:50	1.17
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
1.16 2000/06/11 21:41:06 mandar Exp $
  - * $Revision: 1.16 $
  - * $Date: 2000/06/11 21:41:06 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v
1.17 2000/06/14 22:51:50 mandar Exp $
  + * $Revision: 1.17 $
  + * $Date: 2000/06/14 22:51:50 $
    *
    * ====================================================================
    * 
  @@ -683,7 +683,7 @@
               String uri = (String) attrs.get("uri");
               String prefix = (String) attrs.get("prefix");
               try {
  -                TagLibraryInfoImpl tl = new TagLibraryInfoImpl(ctxt, 
  +                TagLibraryInfo tl = new TagLibraryInfoImpl(ctxt, 
                                                                  prefix, 
                                                                  uri);
                   libraries.addTagLibrary(prefix, tl);
  @@ -880,13 +880,13 @@
       }
       
       public void handleTagBegin(Mark start, Mark stop, Hashtable attrs, String prefix, 
  -			       String shortTagName, TagLibraryInfoImpl tli, 
  +			       String shortTagName, TagLibraryInfo tli, 
   			       TagInfo ti)
   	throws JasperException
       {
           Generator gen
               = new GeneratorWrapper(new TagBeginGenerator(start, prefix, shortTagName, attrs,
  -							 tli, ti),
  +							 tli, ti, libraries),
                                      start, stop);
   
   	addGenerator(gen);
  @@ -894,11 +894,12 @@
   
       public void handleTagEnd(Mark start, Mark stop, String prefix, 
   			     String shortTagName, Hashtable attrs, 
  -                             TagLibraryInfoImpl tli, TagInfo ti)
  +                             TagLibraryInfo tli, TagInfo ti)
   	throws JasperException
       {
           Generator gen
  -            = new GeneratorWrapper(new TagEndGenerator(prefix, shortTagName, attrs, tli,
ti),
  +            = new GeneratorWrapper(new TagEndGenerator(prefix, shortTagName, attrs,
  +						       tli, ti, libraries),
                                      start, stop);
   
   	addGenerator(gen);
  
  
  
  1.6       +6 -5      jakarta-tomcat/src/share/org/apache/jasper/compiler/ParseEventListener.java
  
  Index: ParseEventListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/ParseEventListener.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ParseEventListener.java	2000/02/25 19:45:38	1.5
  +++ ParseEventListener.java	2000/06/14 22:51:51	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/ParseEventListener.java,v
1.5 2000/02/25 19:45:38 mandar Exp $
  - * $Revision: 1.5 $
  - * $Date: 2000/02/25 19:45:38 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/ParseEventListener.java,v
1.6 2000/06/14 22:51:51 mandar Exp $
  + * $Revision: 1.6 $
  + * $Date: 2000/06/14 22:51:51 $
    *
    * ====================================================================
    * 
  @@ -107,11 +107,11 @@
        * stop: can be null if the body contained JSP tags... 
        */
       void handleTagBegin(Mark start, Mark stop, Hashtable attrs, String prefix, String shortTagName,
  -			TagLibraryInfoImpl tli, TagInfo ti) 
  +			TagLibraryInfo tli, TagInfo ti) 
   	throws JasperException;
   
       void handleTagEnd(Mark start, Mark stop, String prefix, String shortTagName,
  -		      Hashtable attrs, TagLibraryInfoImpl tli, TagInfo ti)
  +		      Hashtable attrs, TagLibraryInfo tli, TagInfo ti)
   	throws JasperException;
   
       void handleForward(Mark start, Mark stop, Hashtable attrs, Hashtable param)
  @@ -121,3 +121,4 @@
   
       void endPageProcessing() throws JasperException;
   }
  +
  
  
  
  1.23      +1 -1      jakarta-tomcat/src/share/org/apache/jasper/compiler/Parser.java
  
  Index: Parser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/Parser.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- Parser.java	2000/06/11 22:37:08	1.22
  +++ Parser.java	2000/06/14 22:51:51	1.23
  @@ -787,7 +787,7 @@
                   throw new ParseException(start, "Nothing after the :");
   
               
  -            TagLibraryInfoImpl tli = (TagLibraryInfoImpl)
  +            TagLibraryInfo tli = (TagLibraryInfoImpl)
   		libraries.getTagLibInfo(prefix);
               TagInfo ti = tli.getTag(shortTagName);
               
  
  
  
  1.14      +6 -4      jakarta-tomcat/src/share/org/apache/jasper/compiler/TagBeginGenerator.java
  
  Index: TagBeginGenerator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagBeginGenerator.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- TagBeginGenerator.java	2000/06/11 21:41:06	1.13
  +++ TagBeginGenerator.java	2000/06/14 22:51:52	1.14
  @@ -85,17 +85,18 @@
       String prefix;
       String shortTagName;
       Hashtable attrs;
  -    TagLibraryInfoImpl tli;
  +    TagLibraryInfo tli;
       TagInfo ti;
       TagAttributeInfo[] attributes;
       String baseVarName, thVarName;
       TagCache tc;
       TagData tagData;
       Mark start;
  +    TagLibraries libraries;
   
       
       public TagBeginGenerator(Mark start, String prefix, String shortTagName, Hashtable
attrs,
  -			     TagLibraryInfoImpl tli, TagInfo ti) 
  +			     TagLibraryInfo tli, TagInfo ti, TagLibraries libraries) 
           throws JasperException
       {
           this.prefix = prefix;
  @@ -107,11 +108,12 @@
   	this.baseVarName = getTagVarName(prefix, shortTagName);
   	this.thVarName = "_jspx_th_"+baseVarName;
   	this.start = start;
  +	this.libraries = libraries;
       }
   
       public void init(JspCompilationContext ctxt) throws JasperException {
           validate();
  -        tc = tli.getTagCache(shortTagName);
  +        tc = libraries.getTagCache(prefix, shortTagName);
           if (tc == null) {
               tc = new TagCache(shortTagName);
   
  @@ -128,7 +130,7 @@
                                                                 ));
               }
               tc.setTagHandlerClass(clz);
  -            tli.putTagCache(shortTagName, tc);
  +            libraries.putTagCache(prefix, shortTagName, tc);
           }
       }
       
  
  
  
  1.7       +7 -4      jakarta-tomcat/src/share/org/apache/jasper/compiler/TagEndGenerator.java
  
  Index: TagEndGenerator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagEndGenerator.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TagEndGenerator.java	1999/11/16 00:33:12	1.6
  +++ TagEndGenerator.java	2000/06/14 22:51:53	1.7
  @@ -75,19 +75,21 @@
       implements ServiceMethodPhase
   {
       String prefix, shortTagName;
  -    TagLibraryInfoImpl tli;
  +    TagLibraryInfo tli;
       TagInfo ti;
       Hashtable attrs;
  +    TagLibraries libraries;
   
       public TagEndGenerator(String prefix, String shortTagName, 
  -                           Hashtable attrs, TagLibraryInfoImpl tli, 
  -                           TagInfo ti) 
  +                           Hashtable attrs, TagLibraryInfo tli, 
  +                           TagInfo ti, TagLibraries libraries) 
       {
           this.prefix = prefix;
           this.shortTagName = shortTagName;
           this.tli = tli;
           this.ti = ti;
           this.attrs = attrs;
  +	this.libraries = libraries;
       }
       
       public void generate(ServletWriter writer, Class phase) {
  @@ -97,7 +99,8 @@
           
           VariableInfo[] vi = ti.getVariableInfo(new TagData(attrs));
   
  -        Class tagHandlerClass = tli.getTagCache(shortTagName).getTagHandlerClass();
  +        Class tagHandlerClass =
  +	    libraries.getTagCache(prefix, shortTagName).getTagHandlerClass();
           boolean implementsBodyTag = BodyTag.class.isAssignableFrom(tagHandlerClass);
   	
   	writer.popIndent();
  
  
  
  1.7       +31 -0     jakarta-tomcat/src/share/org/apache/jasper/compiler/TagLibraries.java
  
  Index: TagLibraries.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagLibraries.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TagLibraries.java	2000/06/11 22:37:08	1.6
  +++ TagLibraries.java	2000/06/14 22:51:53	1.7
  @@ -77,6 +77,7 @@
       
       public TagLibraries(ClassLoader cl) {
           this.tagLibInfos = new Hashtable();
  +	this.tagCaches = new Hashtable();
           this.cl = cl;
       }
       
  @@ -104,6 +105,36 @@
           return (TagLibraryInfo) tagLibInfos.get(prefix);
       }
   
  +    public TagCache getTagCache(String prefix, String shortTagName) {
  +	return (TagCache) tagCaches.get(new TagID(prefix, shortTagName));
  +    }
  +
  +    public void putTagCache(String prefix, String shortTagName, TagCache tc) {
  +	tagCaches.put(new TagID(prefix, shortTagName), tc);
  +    }
  +
       private Hashtable tagLibInfos;
  +    private Hashtable tagCaches;
       private ClassLoader cl;
  +
  +    private static class TagID {
  +
  +	private String prefix;
  +	private String shortTagName;
  +
  +	public TagID(String prefix, String shortTagName) {
  +	    this.prefix = prefix;
  +	    this.shortTagName = shortTagName;
  +	}
  +
  +	public boolean equals(Object obj) {
  +	    return (prefix.equals(((TagID)obj).prefix)) &&
  +		(shortTagName.equals(((TagID)obj).shortTagName));
  +	}
  +
  +	public int hashCode() {
  +	    return prefix.hashCode() + shortTagName.hashCode();
  +	}
  +    }
   }
  +
  
  
  
  1.21      +4 -12     jakarta-tomcat/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java
  
  Index: TagLibraryInfoImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- TagLibraryInfoImpl.java	2000/06/11 19:08:54	1.20
  +++ TagLibraryInfoImpl.java	2000/06/14 22:51:53	1.21
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
1.20 2000/06/11 19:08:54 mandar Exp $
  - * $Revision: 1.20 $
  - * $Date: 2000/06/11 19:08:54 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/compiler/TagLibraryInfoImpl.java,v
1.21 2000/06/14 22:51:53 mandar Exp $
  + * $Revision: 1.21 $
  + * $Date: 2000/06/14 22:51:53 $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -103,8 +103,7 @@
       Document tld;
   
       Hashtable jarEntries;
  -    Hashtable tagCaches = new Hashtable();
  -    
  +
       JspCompilationContext ctxt;
   
       
  @@ -519,11 +518,4 @@
               out.write(buf, 0, nRead);
       }
   
  -    TagCache getTagCache(String shortTagName) {
  -        return (TagCache) tagCaches.get(shortTagName);
  -    }
  -
  -    void putTagCache(String shortTagName, TagCache tc) {
  -        tagCaches.put(shortTagName, tc);
  -    }
   }
  
  
  

Mime
View raw message