You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by de...@apache.org on 2006/04/23 13:57:33 UTC

svn commit: r396258 - in /xmlgraphics/batik/branches/svg11: sources/org/apache/batik/parser/FragmentIdentifierParser.java xdocs/index.xml

Author: deweese
Date: Sun Apr 23 04:57:32 2006
New Revision: 396258

URL: http://svn.apache.org/viewcvs?rev=396258&view=rev
Log:
1) Applied patch from 39303 (Thanks Dieter)
2) Added Volity to list of Batik projects.


Modified:
    xmlgraphics/batik/branches/svg11/sources/org/apache/batik/parser/FragmentIdentifierParser.java
    xmlgraphics/batik/branches/svg11/xdocs/index.xml

Modified: xmlgraphics/batik/branches/svg11/sources/org/apache/batik/parser/FragmentIdentifierParser.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/sources/org/apache/batik/parser/FragmentIdentifierParser.java?rev=396258&r1=396257&r2=396258&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/sources/org/apache/batik/parser/FragmentIdentifierParser.java (original)
+++ xmlgraphics/batik/branches/svg11/sources/org/apache/batik/parser/FragmentIdentifierParser.java Sun Apr 23 04:57:32 2006
@@ -1,6 +1,6 @@
 /*
 
-   Copyright 2000-2003  The Apache Software Foundation 
+   Copyright 2000-2003  The Apache Software Foundation
 
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@
  * @version $Id$
  */
 public class FragmentIdentifierParser extends NumberParser {
-    
+
     /**
      * The buffer used for numbers.
      */
@@ -81,7 +81,7 @@
      */
     protected void doParse() throws ParseException, IOException {
         bufferSize = 0;
-                
+
         current = reader.read();
 
         fragmentIdentifierHandler.startFragmentIdentifier();
@@ -142,30 +142,22 @@
                 bufferSize = 0;
                 current = reader.read();
                 if (current != 'i') {
-                    reportError("character.expected",
-                                new Object[] { new Character('i'),
-                                                new Integer(current) });
+                    reportCharacterExpectedError( 'i', current );
                     break ident;
                 }
                 current = reader.read();
                 if (current != 'd') {
-                    reportError("character.expected",
-                                new Object[] { new Character('d'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'd', current );
                     break ident;
                 }
                 current = reader.read();
                 if (current != '(') {
-                    reportError("character.expected",
-                                new Object[] { new Character('('),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( '(', current );
                     break ident;
                 }
                 current = reader.read();
                 if (current != '"' && current != '\'') {
-                    reportError("character.expected",
-                                new Object[] { new Character('\''),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( '\'', current );
                     break ident;
                 }
                 char q = (char)current;
@@ -184,16 +176,12 @@
                 }
                 current = reader.read();
                 if (current != ')') {
-                    reportError("character.expected",
-                                new Object[] { new Character(')'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( ')', current );
                     break ident;
                 }
                 current = reader.read();
                 if (current != ')') {
-                    reportError("character.expected",
-                                new Object[] { new Character(')'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( ')', current );
                 }
                 break ident;
 
@@ -245,9 +233,7 @@
                 parseViewAttributes();
 
                 if (current != ')') {
-                    reportError("character.expected",
-                                new Object[] { new Character(')'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( ')', current );
                 }
                 break ident;
 
@@ -277,16 +263,15 @@
             case -1:
             case ')':
                 if (first) {
-                    reportError("character.unexpected",
-                                new Object[] { new Integer(current) });
+                    reportUnexpectedCharacterError( current );
                     break loop;
                 }
+                // fallthrough
             default:
                 break loop;
             case ';':
                 if (first) {
-                    reportError("character.unexpected",
-                                new Object[] { new Integer(current) });
+                    reportUnexpectedCharacterError( current );
                     break loop;
                 }
                 current = reader.read();
@@ -295,23 +280,17 @@
                 first = false;
                 current = reader.read();
                 if (current != 'i') {
-                    reportError("character.expected",
-                                new Object[] { new Character('i'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'i', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'e') {
-                    reportError("character.expected",
-                                new Object[] { new Character('e'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'e', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'w') {
-                    reportError("character.expected",
-                                new Object[] { new Character('w'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'w', current );
                     break loop;
                 }
                 current = reader.read();
@@ -320,67 +299,51 @@
                 case 'B':
                     current = reader.read();
                     if (current != 'o') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('o'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'o', current );
                         break loop;
                     }
                     current = reader.read();
                     if (current != 'x') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('x'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'x', current );
                         break loop;
                     }
                     current = reader.read();
                     if (current != '(') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('('),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( '(', current );
                         break loop;
                     }
                     current = reader.read();
 
                     float x = parseFloat();
                     if (current != ',') {
-                        reportError("character.expected",
-                                    new Object[] { new Character(','),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( ',', current );
                         break loop;
                     }
                     current = reader.read();
-                    
+
                     float y = parseFloat();
                     if (current != ',') {
-                        reportError("character.expected",
-                                    new Object[] { new Character(','),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( ',', current );
                         break loop;
                     }
                     current = reader.read();
-                    
+
                     float w = parseFloat();
                     if (current != ',') {
-                        reportError("character.expected",
-                                    new Object[] { new Character(','),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( ',', current );
                         break loop;
                     }
                     current = reader.read();
-                    
+
                     float h = parseFloat();
                     if (current != ')') {
-                        reportError("character.expected",
-                                    new Object[] { new Character(')'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( ')', current );
                         break loop;
                     }
                     current = reader.read();
                     fragmentIdentifierHandler.viewBox(x, y, w, h);
                     if (current != ')' && current != ';') {
-                        reportError("character.expected",
-                                    new Object[] { new Character(')'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( ')', current );
                         break loop;
                     }
                     break;
@@ -388,44 +351,32 @@
                 case 'T':
                     current = reader.read();
                     if (current != 'a') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('a'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'a', current );
                         break loop;
                     }
                     current = reader.read();
                     if (current != 'r') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('r'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'r', current );
                         break loop;
                     }
                     current = reader.read();
                     if (current != 'g') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('g'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'g', current );
                         break loop;
                     }
                     current = reader.read();
                     if (current != 'e') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('e'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'e', current );
                         break loop;
                     }
                     current = reader.read();
                     if (current != 't') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('t'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 't', current );
                         break loop;
                     }
                     current = reader.read();
                     if (current != '(') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('('),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( '(', current );
                         break loop;
                     }
                     current = reader.read();
@@ -436,8 +387,7 @@
                         bufferSize = 0;
                         if (current == -1 ||
                             !XMLUtilities.isXMLNameFirstCharacter((char)current)) {
-                            reportError("character.unexpected",
-                                        new Object[] { new Integer(current) });
+                            reportUnexpectedCharacterError( current );
                             break loop;
                         }
                         bufferize();
@@ -457,8 +407,7 @@
                             current = reader.read();
                             break;
                         default:
-                            reportError("character.unexpected",
-                                        new Object[] { new Integer(current) });
+                            reportUnexpectedCharacterError( current );
                             break loop;
                         }
                     }
@@ -467,8 +416,7 @@
                     break;
 
                 default:
-                    reportError("character.unexpected",
-                                new Object[] { new Integer(current) });
+                    reportUnexpectedCharacterError( current );
                     break loop;
                 }
                 break;
@@ -476,135 +424,97 @@
                 first = false;
                 current = reader.read();
                 if (current != 'r') {
-                    reportError("character.expected",
-                                new Object[] { new Character('r'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'r', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'e') {
-                    reportError("character.expected",
-                                new Object[] { new Character('e'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'e', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 's') {
-                    reportError("character.expected",
-                                new Object[] { new Character('s'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 's', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'e') {
-                    reportError("character.expected",
-                                new Object[] { new Character('e'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'e', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'r') {
-                    reportError("character.expected",
-                                new Object[] { new Character('r'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'r', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'v') {
-                    reportError("character.expected",
-                                new Object[] { new Character('v'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'v', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'e') {
-                    reportError("character.expected",
-                                new Object[] { new Character('e'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'e', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'A') {
-                    reportError("character.expected",
-                                new Object[] { new Character('A'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'A', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 's') {
-                    reportError("character.expected",
-                                new Object[] { new Character('s'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 's', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'p') {
-                    reportError("character.expected",
-                                new Object[] { new Character('p'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'p', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'e') {
-                    reportError("character.expected",
-                                new Object[] { new Character('e'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'e', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'c') {
-                    reportError("character.expected",
-                                new Object[] { new Character('c'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'c', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 't') {
-                    reportError("character.expected",
-                                new Object[] { new Character('t'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 't', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'R') {
-                    reportError("character.expected",
-                                new Object[] { new Character('R'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'R', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'a') {
-                    reportError("character.expected",
-                                new Object[] { new Character('a'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'a', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 't') {
-                    reportError("character.expected",
-                                new Object[] { new Character('t'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 't', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'i') {
-                    reportError("character.expected",
-                                new Object[] { new Character('i'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'i', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'o') {
-                    reportError("character.expected",
-                                new Object[] { new Character('o'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'o', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != '(') {
-                    reportError("character.expected",
-                                new Object[] { new Character('('),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( '(', current );
                     break loop;
                 }
                 current = reader.read();
@@ -612,9 +522,7 @@
                 parsePreserveAspectRatio();
 
                 if (current != ')') {
-                    reportError("character.expected",
-                                new Object[] { new Character(')'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( ')', current );
                     break loop;
                 }
                 current = reader.read();
@@ -624,65 +532,47 @@
                 first = false;
                 current = reader.read();
                 if (current != 'r') {
-                    reportError("character.expected",
-                                new Object[] { new Character('r'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'r', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'a') {
-                    reportError("character.expected",
-                                new Object[] { new Character('a'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'a', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'n') {
-                    reportError("character.expected",
-                                new Object[] { new Character('n'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'n', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 's') {
-                    reportError("character.expected",
-                                new Object[] { new Character('s'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 's', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'f') {
-                    reportError("character.expected",
-                                new Object[] { new Character('f'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'f', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'o') {
-                    reportError("character.expected",
-                                new Object[] { new Character('o'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'o', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'r') {
-                    reportError("character.expected",
-                                new Object[] { new Character('r'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'r', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'm') {
-                    reportError("character.expected",
-                                new Object[] { new Character('m'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'm', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != '(') {
-                    reportError("character.expected",
-                                new Object[] { new Character('('),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( '(', current );
                     break loop;
                 }
 
@@ -713,9 +603,7 @@
                                 parseSkew();
                                 break;
                             default:
-                                reportError("character.unexpected",
-                                            new Object[] {
-                                                new Integer(current) });
+                                reportUnexpectedCharacterError( current );
                                 skipTransform();
                             }
                             break;
@@ -735,72 +623,52 @@
                 first = false;
                 current = reader.read();
                 if (current != 'o') {
-                    reportError("character.expected",
-                                new Object[] { new Character('o'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'o', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'o') {
-                    reportError("character.expected",
-                                new Object[] { new Character('o'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'o', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'm') {
-                    reportError("character.expected",
-                                new Object[] { new Character('m'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'm', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'A') {
-                    reportError("character.expected",
-                                new Object[] { new Character('A'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'A', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'n') {
-                    reportError("character.expected",
-                                new Object[] { new Character('n'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'n', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'd') {
-                    reportError("character.expected",
-                                new Object[] { new Character('d'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'd', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'P') {
-                    reportError("character.expected",
-                                new Object[] { new Character('P'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'P', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'a') {
-                    reportError("character.expected",
-                                new Object[] { new Character('a'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'a', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != 'n') {
-                    reportError("character.expected",
-                                new Object[] { new Character('n'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'n', current );
                     break loop;
                 }
                 current = reader.read();
                 if (current != '(') {
-                    reportError("character.expected",
-                                new Object[] { new Character('('),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( '(', current );
                     break loop;
                 }
                 current = reader.read();
@@ -809,44 +677,32 @@
                 case 'm':
                     current = reader.read();
                     if (current != 'a') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('a'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'a', current );
                         break loop;
                     }
                     current = reader.read();
                     if (current != 'g') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('g'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'g', current );
                         break loop;
                     }
                     current = reader.read();
                     if (current != 'n') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('n'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'n', current );
                         break loop;
                     }
                     current = reader.read();
                     if (current != 'i') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('i'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'i', current );
                         break loop;
                     }
                     current = reader.read();
                     if (current != 'f') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('f'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'f', current );
                         break loop;
                     }
                     current = reader.read();
                     if (current != 'y') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('y'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'y', current );
                         break loop;
                     }
                     current = reader.read();
@@ -856,44 +712,32 @@
                 case 'd':
                     current = reader.read();
                     if (current != 'i') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('i'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'i', current );
                         break loop;
                     }
                     current = reader.read();
                     if (current != 's') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('s'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 's', current );
                         break loop;
                     }
                     current = reader.read();
                     if (current != 'a') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('a'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'a', current );
                         break loop;
                     }
                     current = reader.read();
                     if (current != 'b') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('b'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'b', current );
                         break loop;
                     }
                     current = reader.read();
                     if (current != 'l') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('l'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'l', current );
                         break loop;
                     }
                     current = reader.read();
                     if (current != 'e') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('e'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'e', current );
                         break loop;
                     }
                     current = reader.read();
@@ -901,15 +745,12 @@
                     break;
 
                 default:
-                    reportError("character.unexpected",
-                                new Object[] { new Integer(current) });
+                    reportUnexpectedCharacterError( current );
                     break loop;
                 }
 
                 if (current != ')') {
-                    reportError("character.expected",
-                                new Object[] { new Character(')'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( ')', current );
                     break loop;
                 }
                 current = reader.read();
@@ -940,13 +781,12 @@
 
     /**
      * Adds the current character to the buffer.
+     * If necessary, the buffer grows.
      */
     protected void bufferize() {
         if (bufferSize >= buffer.length) {
             char[] t = new char[buffer.length * 2];
-            for (int i = 0; i < bufferSize; i++) {
-                t[i] = buffer[i];
-            }
+            System.arraycopy( buffer, 0, t, 0, bufferSize );
             buffer = t;
         }
         buffer[bufferSize++] = (char)current;
@@ -978,50 +818,38 @@
 
         // Parse 'atrix wsp? ( wsp?'
         if (current != 'a') {
-            reportError("character.expected",
-                        new Object[] { new Character('a'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 'a', current );
             skipTransform();
             return;
         }
         current = reader.read();
         if (current != 't') {
-            reportError("character.expected",
-                        new Object[] { new Character('t'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 't', current );
             skipTransform();
             return;
         }
         current = reader.read();
         if (current != 'r') {
-            reportError("character.expected",
-                        new Object[] { new Character('r'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 'r', current );
             skipTransform();
             return;
         }
         current = reader.read();
         if (current != 'i') {
-            reportError("character.expected",
-                        new Object[] { new Character('i'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 'i', current );
             skipTransform();
             return;
         }
         current = reader.read();
         if (current != 'x') {
-            reportError("character.expected",
-                        new Object[] { new Character('x'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 'x', current );
             skipTransform();
             return;
         }
         current = reader.read();
         skipSpaces();
         if (current != '(') {
-            reportError("character.expected",
-                        new Object[] { new Character('('),
-                                       new Integer(current) });
+            reportCharacterExpectedError( '(', current );
             skipTransform();
             return;
         }
@@ -1039,12 +867,10 @@
         float e = parseFloat();
         skipCommaSpaces();
         float f = parseFloat();
-        
+
         skipSpaces();
         if (current != ')') {
-            reportError("character.expected",
-                        new Object[] { new Character(')'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( ')', current );
             skipTransform();
             return;
         }
@@ -1060,41 +886,31 @@
 
         // Parse 'otate wsp? ( wsp?'
         if (current != 'o') {
-            reportError("character.expected",
-                        new Object[] { new Character('o'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 'o', current );
             skipTransform();
             return;
         }
         current = reader.read();
         if (current != 't') {
-            reportError("character.expected",
-                        new Object[] { new Character('t'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 't', current );
             skipTransform();
             return;
         }
         current = reader.read();
         if (current != 'a') {
-            reportError("character.expected",
-                        new Object[] { new Character('a'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 'a', current );
             skipTransform();
             return;
         }
         current = reader.read();
         if (current != 't') {
-            reportError("character.expected",
-                        new Object[] { new Character('t'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 't', current );
             skipTransform();
             return;
         }
         current = reader.read();
         if (current != 'e') {
-            reportError("character.expected",
-                        new Object[] { new Character('e'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 'e', current );
             skipTransform();
             return;
         }
@@ -1102,9 +918,7 @@
         skipSpaces();
 
         if (current != '(') {
-            reportError("character.expected",
-                        new Object[] { new Character('('),
-                                       new Integer(current) });
+            reportCharacterExpectedError( '(', current );
             skipTransform();
             return;
         }
@@ -1122,16 +936,14 @@
             current = reader.read();
             skipSpaces();
         }
-        
+
         float cx = parseFloat();
         skipCommaSpaces();
         float cy = parseFloat();
 
         skipSpaces();
         if (current != ')') {
-            reportError("character.expected",
-                        new Object[] { new Character(')'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( ')', current );
             skipTransform();
             return;
         }
@@ -1148,74 +960,56 @@
 
         // Parse 'ranslate wsp? ( wsp?'
         if (current != 'r') {
-            reportError("character.expected",
-                        new Object[] { new Character('r'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 'r', current );
             skipTransform();
             return;
         }
         current = reader.read();
         if (current != 'a') {
-            reportError("character.expected",
-                        new Object[] { new Character('a'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 'a', current );
             skipTransform();
             return;
         }
         current = reader.read();
         if (current != 'n') {
-            reportError("character.expected",
-                        new Object[] { new Character('n'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 'n', current );
             skipTransform();
             return;
         }
         current = reader.read();
         if (current != 's') {
-            reportError("character.expected",
-                        new Object[] { new Character('s'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 's', current );
             skipTransform();
             return;
         }
         current = reader.read();
         if (current != 'l') {
-            reportError("character.expected",
-                        new Object[] { new Character('l'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 'l', current );
             skipTransform();
             return;
         }
         current = reader.read();
         if (current != 'a') {
-            reportError("character.expected",
-                        new Object[] { new Character('a'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 'a', current );
             skipTransform();
             return;
         }
         current = reader.read();
         if (current != 't') {
-            reportError("character.expected",
-                        new Object[] { new Character('t'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 't', current );
             skipTransform();
             return;
         }
         current = reader.read();
         if (current != 'e') {
-            reportError("character.expected",
-                        new Object[] { new Character('e'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 'e', current );
             skipTransform();
             return;
         }
         current = reader.read();
         skipSpaces();
         if (current != '(') {
-            reportError("character.expected",
-                        new Object[] { new Character('('),
-                                       new Integer(current) });
+            reportCharacterExpectedError( '(', current );
             skipTransform();
             return;
         }
@@ -1238,9 +1032,7 @@
 
         skipSpaces();
         if (current != ')') {
-            reportError("character.expected",
-                        new Object[] { new Character(')'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( ')', current );
             skipTransform();
             return;
         }
@@ -1256,34 +1048,26 @@
 
         // Parse 'ale wsp? ( wsp?'
         if (current != 'a') {
-            reportError("character.expected",
-                        new Object[] { new Character('a'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 'a', current );
             skipTransform();
             return;
         }
         current = reader.read();
         if (current != 'l') {
-            reportError("character.expected",
-                        new Object[] { new Character('l'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 'l', current );
             skipTransform();
             return;
         }
         current = reader.read();
         if (current != 'e') {
-            reportError("character.expected",
-                        new Object[] { new Character('e'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 'e', current );
             skipTransform();
             return;
         }
         current = reader.read();
         skipSpaces();
         if (current != '(') {
-            reportError("character.expected",
-                        new Object[] { new Character('('),
-                                       new Integer(current) });
+            reportCharacterExpectedError( '(', current );
             skipTransform();
             return;
         }
@@ -1306,9 +1090,7 @@
 
         skipSpaces();
         if (current != ')') {
-            reportError("character.expected",
-                        new Object[] { new Character(')'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( ')', current );
             skipTransform();
             return;
         }
@@ -1324,17 +1106,13 @@
 
         // Parse 'ew[XY] wsp? ( wsp?'
         if (current != 'e') {
-            reportError("character.expected",
-                        new Object[] { new Character('e'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 'e', current );
             skipTransform();
             return;
         }
         current = reader.read();
         if (current != 'w') {
-            reportError("character.expected",
-                        new Object[] { new Character('w'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 'w', current );
             skipTransform();
             return;
         }
@@ -1344,21 +1122,18 @@
         switch (current) {
         case 'X':
             skewX = true;
+            // fall-through
         case 'Y':
             break;
         default:
-            reportError("character.expected",
-                        new Object[] { new Character('X'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( 'X', current );
             skipTransform();
             return;
         }
         current = reader.read();
         skipSpaces();
         if (current != '(') {
-            reportError("character.expected",
-                        new Object[] { new Character('('),
-                                       new Integer(current) });
+            reportCharacterExpectedError( '(', current );
             skipTransform();
             return;
         }
@@ -1369,9 +1144,7 @@
 
         skipSpaces();
         if (current != ')') {
-            reportError("character.expected",
-                        new Object[] { new Character(')'),
-                                       new Integer(current) });
+            reportCharacterExpectedError( ')', current );
             skipTransform();
             return;
         }
@@ -1411,25 +1184,19 @@
         case 'n':
             current = reader.read();
             if (current != 'o') {
-                reportError("character.expected",
-                            new Object[] { new Character('o'),
-                                           new Integer(current) });
+                reportCharacterExpectedError( 'o', current );
                 skipIdentifier();
                 break align;
             }
             current = reader.read();
             if (current != 'n') {
-                reportError("character.expected",
-                            new Object[] { new Character('n'),
-                                           new Integer(current) });
+                reportCharacterExpectedError( 'n', current );
                 skipIdentifier();
                 break align;
             }
             current = reader.read();
             if (current != 'e') {
-                reportError("character.expected",
-                            new Object[] { new Character('e'),
-                                           new Integer(current) });
+                reportCharacterExpectedError( 'e', current );
                 skipIdentifier();
                 break align;
             }
@@ -1437,13 +1204,11 @@
             skipSpaces();
             fragmentIdentifierHandler.none();
             break;
-                
+
         case 'x':
             current = reader.read();
             if (current != 'M') {
-                reportError("character.expected",
-                            new Object[] { new Character('M'),
-                                           new Integer(current) });
+                reportCharacterExpectedError( 'M', current );
                 skipIdentifier();
                 break;
             }
@@ -1452,25 +1217,19 @@
             case 'a':
                 current = reader.read();
                 if (current != 'x') {
-                    reportError("character.expected",
-                                new Object[] { new Character('x'),
-                                                 new Integer(current) });
+                    reportCharacterExpectedError( 'x', current );
                     skipIdentifier();
                     break align;
                 }
                 current = reader.read();
                 if (current != 'Y') {
-                    reportError("character.expected",
-                                new Object[] { new Character('Y'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'Y', current );
                     skipIdentifier();
                     break align;
                 }
                 current = reader.read();
                 if (current != 'M') {
-                    reportError("character.expected",
-                                new Object[] { new Character('M'),
-                                               new Integer(current) });
+                    reportCharacterExpectedError( 'M', current );
                     skipIdentifier();
                     break align;
                 }
@@ -1479,9 +1238,7 @@
                 case 'a':
                     current = reader.read();
                     if (current != 'x') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('x'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'x', current );
                         skipIdentifier();
                         break align;
                     }
@@ -1500,8 +1257,7 @@
                         current = reader.read();
                         break;
                     default:
-                        reportError("character.unexpected",
-                                    new Object[] { new Integer(current) });
+                        reportUnexpectedCharacterError( current );
                         skipIdentifier();
                         break align;
                     }
@@ -1513,17 +1269,13 @@
                 case 'd':
                     current = reader.read();
                     if (current != 'Y') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('Y'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'Y', current );
                         skipIdentifier();
                         break align;
                     }
                     current = reader.read();
                     if (current != 'M') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('M'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'M', current );
                         skipIdentifier();
                         break align;
                     }
@@ -1532,10 +1284,7 @@
                     case 'a':
                         current = reader.read();
                         if (current != 'x') {
-                            reportError
-                                ("character.expected",
-                                 new Object[] { new Character('x'),
-                                                    new Integer(current) });
+                            reportCharacterExpectedError( 'x', current );
                             skipIdentifier();
                             break align;
                         }
@@ -1554,8 +1303,7 @@
                             current = reader.read();
                             break;
                         default:
-                            reportError("character.unexpected",
-                                        new Object[] { new Integer(current) });
+                            reportUnexpectedCharacterError( current );
                             skipIdentifier();
                             break align;
                         }
@@ -1564,17 +1312,13 @@
                 case 'n':
                     current = reader.read();
                     if (current != 'Y') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('Y'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'Y', current );
                         skipIdentifier();
                         break align;
                     }
                     current = reader.read();
                     if (current != 'M') {
-                        reportError("character.expected",
-                                    new Object[] { new Character('M'),
-                                                   new Integer(current) });
+                        reportCharacterExpectedError( 'M', current );
                         skipIdentifier();
                         break align;
                     }
@@ -1583,10 +1327,7 @@
                     case 'a':
                         current = reader.read();
                         if (current != 'x') {
-                            reportError
-                                ("character.expected",
-                                 new Object[] { new Character('x'),
-                                                new Integer(current) });
+                            reportCharacterExpectedError( 'x', current );
                             skipIdentifier();
                             break align;
                         }
@@ -1605,31 +1346,26 @@
                             current = reader.read();
                             break;
                         default:
-                            reportError
-                                ("character.unexpected",
-                                 new Object[] { new Integer(current) });
+                            reportUnexpectedCharacterError( current );
                             skipIdentifier();
                             break align;
                         }
                     }
                     break;
                 default:
-                    reportError("character.unexpected",
-                                new Object[] { new Integer(current) });
+                    reportUnexpectedCharacterError( current );
                     skipIdentifier();
                     break align;
                 }
                 break;
             default:
-                reportError("character.unexpected",
-                            new Object[] { new Integer(current) });
+                reportUnexpectedCharacterError( current );
                 skipIdentifier();
             }
             break;
         default:
             if (current != -1) {
-                reportError("character.unexpected",
-                            new Object[] { new Integer(current) });
+                reportUnexpectedCharacterError( current );
                 skipIdentifier();
             }
         }
@@ -1640,25 +1376,19 @@
         case 'm':
             current = reader.read();
             if (current != 'e') {
-                reportError("character.expected",
-                            new Object[] { new Character('e'),
-                                           new Integer(current) });
+                reportCharacterExpectedError( 'e', current );
                 skipIdentifier();
                 break;
             }
             current = reader.read();
             if (current != 'e') {
-                reportError("character.expected",
-                            new Object[] { new Character('e'),
-                                            new Integer(current) });
+                reportCharacterExpectedError( 'e', current );
                 skipIdentifier();
                 break;
             }
             current = reader.read();
             if (current != 't') {
-                reportError("character.expected",
-                            new Object[] { new Character('t'),
-                                           new Integer(current) });
+                reportCharacterExpectedError( 't', current );
                 skipIdentifier();
                 break;
             }
@@ -1668,33 +1398,25 @@
         case 's':
             current = reader.read();
             if (current != 'l') {
-                reportError("character.expected",
-                            new Object[] { new Character('l'),
-                                           new Integer(current) });
+                reportCharacterExpectedError( 'l', current );
                 skipIdentifier();
                 break;
             }
             current = reader.read();
             if (current != 'i') {
-                reportError("character.expected",
-                            new Object[] { new Character('i'),
-                                           new Integer(current) });
+                reportCharacterExpectedError( 'i', current );
                 skipIdentifier();
                 break;
             }
             current = reader.read();
             if (current != 'c') {
-                reportError("character.expected",
-                            new Object[] { new Character('c'),
-                                           new Integer(current) });
+                reportCharacterExpectedError( 'c', current );
                 skipIdentifier();
                 break;
             }
             current = reader.read();
             if (current != 'e') {
-                reportError("character.expected",
-                            new Object[] { new Character('e'),
-                                           new Integer(current) });
+                reportCharacterExpectedError( 'e', current );
                 skipIdentifier();
                 break;
             }
@@ -1719,4 +1441,29 @@
           }
       }
     }
+
+    /**
+     * convenience method to simplify error-reporting.
+     * We just wrap the data into a call to {@link #reportError}.
+     *
+     * @param exp the expected character
+     * @param actual character from input
+     */
+    private void reportCharacterExpectedError( char exp, int actual ){
+        reportError("character.expected",
+                new Object[] { new Character( exp ),
+                               new Integer( actual ) });
+    }
+
+    /**
+     * convenience method to simplify error-reporting.
+     * We just wrap the data into a call to {@link #reportError}.
+     *
+     * @param actual the actual current character
+     */
+    private void reportUnexpectedCharacterError( int actual ){
+        reportError("character.unexpected",
+                new Object[] { new Integer( actual ) });
+    }
+
 }

Modified: xmlgraphics/batik/branches/svg11/xdocs/index.xml
URL: http://svn.apache.org/viewcvs/xmlgraphics/batik/branches/svg11/xdocs/index.xml?rev=396258&r1=396257&r2=396258&view=diff
==============================================================================
--- xmlgraphics/batik/branches/svg11/xdocs/index.xml (original)
+++ xmlgraphics/batik/branches/svg11/xdocs/index.xml Sun Apr 23 04:57:32 2006
@@ -205,6 +205,7 @@
         <li><link href="http://www.kiyut.com/">Sketsa</link> is a vector drawing application based on SVG. With Sketsa, you can create vector graphics that can be scaled and printed at any resolution, without losing detail or clarity.</li>
         <li><link href="http://www.isacat.net/2002/svolgo/index.htm">Svolgo</link>,a Graph Visualisation/Transformation Framework for the Semantic Web Cross-model transformation, node and arc diagrams, representation in SVG. This project uses Batik's SVG DOM implementation.</li>
         <li><link href="http://www.togethersoft.com/products/controlcenter/whats_new.jsp">Together Control Center 5.5</link> uses Batik to export UML diagrams in SVG.</li>
+        <li><link href="http://volity.net/">Volity</link> is an open platform for Internet-based multiplayer casual gaming. Its official client, <link href="http://volity.org/projects/gamut/">Gamut</link>, uses Batik, allowing developers to create game UI files that use ECMAScript-driven SVG.</li>
         <li><link href="http://bitflux.ch/developer/misc/70/">XML_svg2image, </link> is a PHP class which translates svg files to png or jpeg using Batik</li>
         <li><link href="http://xweb.sf.net">XWeb</link>, a tool to create websites automatically out of XML input. Uses the Batik SVG Rasterizer.</li>
         </ul>