cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/qdox/java/org/apache/cocoon/components/source/impl QDoxSource.java
Date Fri, 04 Jun 2004 07:30:49 GMT
antonio     2004/06/04 00:30:49

  Modified:    .        gump.xml status.xml
               lib      jars.xml
               src/blocks/qdox/java/org/apache/cocoon/components/source/impl
                        QDoxSource.java
  Added:       src/blocks/bsf/lib asm-util-1.4.2.jar groovy-1.0-beta-5.jar
               src/blocks/qdox/lib qdox-1.4.jar
               tools/lib qdox-1.4.jar
               legal    asm-util-1.4.2.jar.license.txt
                        qdox-1.4.jar.license.txt
                        groovy-1.0-beta5.jar.license.txt
  Removed:     src/blocks/bsf/lib groovy-20040415.114632.jar
               src/blocks/qdox/lib qdox-1.3.jar
               tools/lib qdox-1.3.jar
               legal    qdox-1.3.jar.license.txt
                        groovy-20040415.114632.jar.license.txt
  Log:
  Update Groovy to 1.0-beta5 and qdox to 1.4
  
  Revision  Changes    Path
  1.1                  cocoon-2.1/src/blocks/bsf/lib/asm-util-1.4.2.jar
  
  	<<Binary file>>
  
  
  1.1                  cocoon-2.1/src/blocks/bsf/lib/groovy-1.0-beta-5.jar
  
  	<<Binary file>>
  
  
  1.159     +2 -2      cocoon-2.1/gump.xml
  
  Index: gump.xml
  ===================================================================
  RCS file: /home/cvs//cocoon-2.1/gump.xml,v
  retrieving revision 1.158
  retrieving revision 1.159
  diff -u -r1.158 -r1.159
  --- gump.xml	4 Jun 2004 00:12:30 -0000	1.158
  +++ gump.xml	4 Jun 2004 07:30:49 -0000	1.159
  @@ -1252,7 +1252,7 @@
         definitions from java source files.
       </description>
       <home nested="src/blocks/qdox/lib"/>
  -    <jar name="qdox-1.3.jar"/>
  +    <jar name="qdox-1.4.jar"/>
     </project>
   
     <project name="joost">
  
  
  
  1.348     +4 -1      cocoon-2.1/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs//cocoon-2.1/status.xml,v
  retrieving revision 1.347
  retrieving revision 1.348
  diff -u -r1.347 -r1.348
  --- status.xml	4 Jun 2004 00:12:30 -0000	1.347
  +++ status.xml	4 Jun 2004 07:30:49 -0000	1.348
  @@ -205,6 +205,9 @@
     <changes>
   
    <release version="@version@" date="@date@">
  +   <action dev="AG" type="update">
  +     updated Groovy to 1.0-beta5, qdox to 1.4.
  +   </action>
      <action dev="TC" type="remove">
        Removed the deprecated SWF block and added
        a flash sample in the hello world section.
  
  
  
  1.1                  cocoon-2.1/src/blocks/qdox/lib/qdox-1.4.jar
  
  	<<Binary file>>
  
  
  1.1                  cocoon-2.1/tools/lib/qdox-1.4.jar
  
  	<<Binary file>>
  
  
  1.221     +15 -4     cocoon-2.1/lib/jars.xml
  
  Index: jars.xml
  ===================================================================
  RCS file: /home/cvs//cocoon-2.1/lib/jars.xml,v
  retrieving revision 1.220
  retrieving revision 1.221
  diff -u -r1.220 -r1.221
  --- jars.xml	4 Jun 2004 00:12:30 -0000	1.220
  +++ jars.xml	4 Jun 2004 07:30:49 -0000	1.221
  @@ -398,12 +398,12 @@
         available to the Java developers using a Java-like syntax.
       </description>
       <used-by>BSF Block (Script generator, script action)</used-by>
  -    <lib>bsf/lib/groovy-20040415.114632.jar</lib>
  +    <lib>bsf/lib/groovy-1.0-beta-5.jar</lib>
       <homepage>http://groovy.codehaus.org/</homepage>
     </file>
   
     <file>
  -    <title>ASM </title>
  +    <title>ASM</title>
       <description>
         ASM is a Java bytecode manipulation framework. It can be used to
   	  dynamically generate stub classes or other proxy classes, directly in
  @@ -416,6 +416,17 @@
     </file>
   
     <file>
  +    <title>ASM Util</title>
  +    <description>
  +      Part of ASM (a Java bytecode manipulation framework). Provides some ASM
  +      class visitors that can be useful for programming and debugging purposes.
  +    </description>
  +    <used-by>BSF Block (Script generator, script action)</used-by>
  +    <lib>bsf/lib/asm-util-1.4.2.jar</lib>
  +    <homepage>http://asm.objectweb.org/</homepage>
  +  </file>
  +
  +  <file>
       <title>Device capabilities</title>
       <description>
         Open Source Delivery Context Java Library supporting CC/PP and UAProf.
  @@ -913,7 +924,7 @@
         definitions from source files complete with JavaDoc @tags.
       </description>
       <used-by>QDoxSource (qdox block)</used-by>
  -    <lib>qdox/lib/qdox-1.3.jar</lib>
  +    <lib>qdox/lib/qdox-1.4.jar</lib>
       <homepage>http://qdox.codehaus.org</homepage>
      </file>
   
  
  
  
  1.1                  cocoon-2.1/legal/asm-util-1.4.2.jar.license.txt
  
  Index: asm-util-1.4.2.jar.license.txt
  ===================================================================
  Taken from the build.properties file in asm-1.4.2 src distribution:
  
  ###############################################################################
  #ASM: a very small and fast Java bytecode manipulation framework
  #Copyright (c) 2000,2002,2003 INRIA, France Telecom
  #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. Neither the name of the copyright holders nor the names of its
  #   contributors may be used to endorse or promote products derived from
  #   this software without specific prior written permission.
  #
  #THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  #AND ANY EXPRESS 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 COPYRIGHT OWNER OR 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.
  ###############################################################################
  
  
  1.1                  cocoon-2.1/legal/qdox-1.4.jar.license.txt
  
  Index: qdox-1.4.jar.license.txt
  ===================================================================
  QDox license as found at http://qdox.codehaus.org/license.html, May 6th, 2003
  
  /* ====================================================================
   * The IronSmith Software License, Version 1.1
   *
   * (this license is derived and fully compatible with the Apache Software
   * License - see http://www.apache.org/LICENSE.txt)
   *
   * Copyright (c) 2002 The IronSmith Project. 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 acknowledgment:
   *       "This product includes software developed by the
   *        IronSmith Project (http://www.ironsmith.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "IronSmith" and "The IronSmith Project"
   *    must not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact help@ironsmith.org.
   *
   * 5. Products derived from this software may not be called "IronSmith"
   *    or "QDox", nor may "IronSmith" or "QDox" appear in their
   *    name, without prior written permission of the IronSmith Project.
   *
   * 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.
   * ====================================================================
   */
  
  
  
  1.1                  cocoon-2.1/legal/groovy-1.0-beta5.jar.license.txt
  
  Index: groovy-1.0-beta5.jar.license.txt
  ===================================================================
  
  
  /*
   $Id: groovy-1.0-beta5.jar.license.txt,v 1.1 2004/06/04 07:30:49 antonio Exp $
  
   Copyright 2003 (C) James Strachan and Bob Mcwhirter. All Rights Reserved.
  
   Redistribution and use of this software and associated documentation
   ("Software"), with or without modification, are permitted provided
   that the following conditions are met:
  
   1. Redistributions of source code must retain copyright
      statements and notices.  Redistributions must also contain a
      copy of this document.
  
   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 name "groovy" must not be used to endorse or promote
      products derived from this Software without prior written
      permission of The Codehaus.  For written permission,
      please contact info@codehaus.org.
  
   4. Products derived from this Software may not be called "groovy"
      nor may "groovy" appear in their names without prior written
      permission of The Codehaus. "groovy" is a registered
      trademark of The Codehaus.
  
   5. Due credit should be given to The Codehaus -
      http://groovy.codehaus.org/
  
   THIS SOFTWARE IS PROVIDED BY THE CODEHAUS AND CONTRIBUTORS
   ``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 CODEHAUS 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.
  
   */
  
  
  
  1.11      +15 -60    cocoon-2.1/src/blocks/qdox/java/org/apache/cocoon/components/source/impl/QDoxSource.java
  
  Index: QDoxSource.java
  ===================================================================
  RCS file: /home/cvs//cocoon-2.1/src/blocks/qdox/java/org/apache/cocoon/components/source/impl/QDoxSource.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- QDoxSource.java	30 Apr 2004 22:50:39 -0000	1.10
  +++ QDoxSource.java	4 Jun 2004 07:30:49 -0000	1.11
  @@ -68,7 +68,6 @@
   
       protected final static String ROOT_CLASSNAME = "java.lang.Object";
   
  -    protected final static String EMPTY = "";
       protected final static String PROTOCOL = "qdox:";
       protected final static String NS_URI = "http://apache.org/cocoon/javadoc/1.0";
       protected final static String NS_PREFIX = "jd";
  @@ -167,9 +166,7 @@
           this.javaSource = javaSource;
           this.logger = logger;
           this.manager = manager;
  -
           this.javadocClassName = javadocUri.substring(javadocUri.indexOf(':') + 1);
  -
           try {
               createJavadocXml();
           } catch (SourceException se) {
  @@ -177,7 +174,6 @@
           } catch (IOException ioe) {
               logger.error("Error reading source!", ioe);
           }
  -
           // Initialize regular expression:
           try {
               reLink = new RE(RE_LINK);
  @@ -225,7 +221,7 @@
           JavaSource parent = javadocClass.getParentSource();
           // Add two implicit imports:
           parent.addImport("java.lang.*");
  -        if (parent.getPackage().length() > 0) {
  +        if (parent.getPackage() != null) {
               parent.addImport(parent.getPackage() + ".*");
           } else {
               parent.addImport("*");
  @@ -237,10 +233,7 @@
               if (imports[i].endsWith("*")) {
                   // package import:
                   saxStartElement(handler, IMPORT_ELEMENT, new String[][] {{IMPORT_ATTRIBUTE,
"package"}});
  -                String imp = imports[i];
  -                while (imp.endsWith("*") || imp.endsWith(".")) {
  -                    imp = StringUtils.chop(imp);
  -                }
  +                String imp = StringUtils.substringBeforeLast(imports[i], ".*");
                   saxCharacters(handler, imp);
               } else {
                   saxStartElement(handler, IMPORT_ELEMENT, new String[][] {{IMPORT_ATTRIBUTE,
"class"}});
  @@ -356,32 +349,18 @@
           if (logger.isDebugEnabled()) {
               logger.debug("Getting InputStream for class " + javadocClass.getFullyQualifiedName());
           }
  -
  -        // Serialize the SAX events to the XMLSerializer:
  -
           XMLSerializer serializer = new XMLSerializer();
  -        //ComponentSelector serializerSelector = null;
           ByteArrayInputStream inputStream = null;
   
           try {
  -            //serializerSelector = (ComponentSelector) manager.lookup(Serializer.ROLE +
"Selector");
  -            //logger.debug("serializer selector: " + serializerSelector.toString());
  -            //serializer = (XMLSerializer) serializerSelector.select(XMLSerializer.class);
               ByteArrayOutputStream outputStream = new ByteArrayOutputStream(2048);
               serializer.setOutputStream(outputStream);
               toSAX(serializer);
               inputStream = new ByteArrayInputStream(outputStream.toByteArray());
  -        //} catch (ComponentException ce) {
  -        //    logger.error("Component not found: " + XMLSerializer.ROLE, ce);
  -        //    throw new SourceException("Component lookup of XMLSerializer failed!", ce);
           } catch (SAXException se) {
               logger.error("SAX exception!", se);
               throw new SourceException("Serializing SAX to a ByteArray failed!", se);
  -        //} finally {
  -            //serializerSelector.release(serializer);
  -            //manager.release(serializerSelector);
           }
  -
           return inputStream;
       }
   
  @@ -389,32 +368,21 @@
           if (logger.isDebugEnabled()) {
               logger.debug("Reading Java source " + javaSource.getURI());
           }
  -
           JavaDocBuilder builder = new JavaDocBuilder();
           builder.addSource(new BufferedReader(new InputStreamReader(javaSource.getInputStream())));
   
           javadocClass = builder.getClassByName(javadocClassName);
  -        if (javadocClass == null) {
  +        if (javadocClass.getPackage() == null) {
               // An inner class is specified - let's find it:
  -            int index = javadocUri.lastIndexOf('.');
  -            String containingClassName = javadocUri.substring(javadocUri.indexOf(':') +
1, index);
  -            String innerClassName = javadocUri.substring(index + 1);
  +            int index = javadocClassName.lastIndexOf('.');
  +            String containingClassName = javadocClassName.substring(0, index);
  +            String innerClassName = javadocClassName.substring(index + 1);
               containingJavadocClass = builder.getClassByName(containingClassName);
  -            javadocClass = getJavadocInnerClass(containingJavadocClass, innerClassName);
  +            javadocClass = containingJavadocClass.getInnerClassByName(innerClassName);
           }
       }
   
       /**
  -     * Method resolveMemberNameFromLink.
  -     *
  -     * @param ref
  -     * @return String
  -     */
  -    private String resolveMemberNameFromLink(String ref) {
  -        return StringUtils.substringAfter(ref, "#");
  -    }
  -
  -    /**
        * Method resolveClassNameFromLink.
        *
        * @param ref
  @@ -658,7 +626,7 @@
                   superJavadocClassName = jClass.getSuperClass().getValue();
   
                   // Is the superClass itself an inner class?
  -                if (superJavadocClassName.indexOf('.') == -1 && getJavadocInnerClass(containingJavadocClass,
superJavadocClassName) != null) {
  +                if (superJavadocClassName.indexOf('.') == -1 && containingJavadocClass.getInnerClassByName(superJavadocClassName)
!= null) {
                       superJavadocClassName = containingJavadocClass.getFullyQualifiedName()
+ '.' + superJavadocClassName;
                   }
               }
  @@ -678,7 +646,7 @@
        * @param className
        * @return JavaClass
        */
  -    private JavaClass getJavadocInnerClass(JavaClass jClass, String className) {
  +/*    private JavaClass getJavadocInnerClass(JavaClass jClass, String className) {
           if (jClass != null) {
               JavaClass[] classes = jClass.getInnerClasses();
   
  @@ -689,7 +657,7 @@
               }
           }
           return null;
  -    }
  +    }*/
   
       /**
        * Get the meta class for the specified classname. The result is cached internally.
  @@ -796,15 +764,7 @@
        */
       private void outputComment(ContentHandler handler, String comment) throws SAXException
{
           if (comment != null && comment.length() > 0) {
  -            // When newlines are recognized in QDox, uncomment these lines:
  -            //if (comment.indexOf("<pre>") >= 0) {
  -                //saxStartElement(handler, COMMENT_ELEMENT, new String[][] {{"http://www.w3.org/XML/1998/namespace",
  -                //                "space", "xml:space", "NMTOKEN", "preserve"}});
  -                //saxStartElement(handler, COMMENT_ELEMENT, new String[][] {{"xml:space",
"preserve"}});
  -            //} else {
  -                saxStartElement(handler, COMMENT_ELEMENT);
  -            //}
  -
  +            saxStartElement(handler, COMMENT_ELEMENT);
               while (reLink.match(comment)) {
                   String ref = null;
                   String display = null;
  @@ -815,20 +775,15 @@
                   } else {
                       // {@link xxx}
                       ref = reLink.getParen(6);
  -                    display = EMPTY;
  +                    display = "";
                   }
  -
                   // Output SAX:
                   saxCharacters(handler, comment.substring(0, reLink.getParenStart(0)));
  -
                   outputLink(handler, ref, display);
  -
                   // Cut from doc:
                   comment = comment.substring(reLink.getParenEnd(0));
               }
  -
               saxCharacters(handler, comment);
  -
               saxEndElement(handler, COMMENT_ELEMENT);
           }
       }
  @@ -842,7 +797,7 @@
        */
       private void outputLink(ContentHandler handler, String ref, String display) throws
SAXException {
           String classPart = resolveClassNameFromLink(ref);
  -        String memberPart = resolveMemberNameFromLink(ref);
  +        String memberPart = StringUtils.substringAfter(ref, "#");
           String displayPart = display;
   
           List attrs = new ArrayList();
  @@ -1227,7 +1182,7 @@
           AttributesImpl saxAttrs = new AttributesImpl();
           for (int i=0; i<attrs.length; i++) {
               if (attrs[i].length == 2) {
  -                saxAttrs.addAttribute(EMPTY, attrs[i][0], attrs[i][0], ATTR_TYPE, attrs[i][1]);
  +                saxAttrs.addAttribute("", attrs[i][0], attrs[i][0], ATTR_TYPE, attrs[i][1]);
               } else if (attrs[i].length == 5) {
                   saxAttrs.addAttribute(attrs[i][0], attrs[i][1], attrs[i][2], attrs[i][3],
attrs[i][4]);
               }
  
  
  

Mime
View raw message