cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r678789 - /cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/util/SaxBuffer.java
Date Tue, 22 Jul 2008 16:14:41 GMT
Author: reinhard
Date: Tue Jul 22 09:14:40 2008
New Revision: 678789

URL: http://svn.apache.org/viewvc?rev=678789&view=rev
Log:
1.4 -> 1.5 conversion

Modified:
    cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/util/SaxBuffer.java

Modified: cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/util/SaxBuffer.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/util/SaxBuffer.java?rev=678789&r1=678788&r2=678789&view=diff
==============================================================================
--- cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/util/SaxBuffer.java
(original)
+++ cocoon/whiteboard/corona/trunk/corona-pipeline/src/main/java/org/apache/cocoon/corona/pipeline/util/SaxBuffer.java
Tue Jul 22 09:14:40 2008
@@ -51,19 +51,19 @@
     /**
      * Stores list of {@link SaxBit} objects.
      */
-    protected List saxbits;
+    protected List<SaxBit> saxbits;
 
     /**
      * Creates empty SaxBuffer
      */
     public SaxBuffer() {
-        this.saxbits = new ArrayList();
+        this.saxbits = new ArrayList<SaxBit>();
     }
 
     /**
      * Creates SaxBuffer based on the provided bits list.
      */
-    public SaxBuffer(List bits) {
+    public SaxBuffer(List<SaxBit> bits) {
         this.saxbits = bits;
     }
 
@@ -71,7 +71,7 @@
      * Creates copy of another SaxBuffer
      */
     public SaxBuffer(SaxBuffer saxBuffer) {
-        this.saxbits = new ArrayList(saxBuffer.saxbits);
+        this.saxbits = new ArrayList<SaxBit>(saxBuffer.saxbits);
     }
 
     //
@@ -168,7 +168,7 @@
     /**
      * @return unmodifiable list of SAX bits
      */
-    public List getBits() {
+    public List<SaxBit> getBits() {
         return Collections.unmodifiableList(this.saxbits);
     }
 
@@ -177,36 +177,18 @@
      * get lexical events as well.
      */
     public void toSAX(ContentHandler contentHandler) throws SAXException {
-        for (Iterator i = this.saxbits.iterator(); i.hasNext();) {
-            SaxBit saxbit = (SaxBit) i.next();
+        for (SaxBit saxbit : this.saxbits) {
             saxbit.send(contentHandler);
         }
     }
 
     /**
-     * @return String value of the buffer
-     */
-    @Override
-    public String toString() {
-        // NOTE: This method is used in i18n XML bundle implementation
-        final StringBuffer value = new StringBuffer();
-        for (Iterator i = this.saxbits.iterator(); i.hasNext();) {
-            final SaxBit saxbit = (SaxBit) i.next();
-            if (saxbit instanceof Characters) {
-                ((Characters) saxbit).toString(value);
-            }
-        }
-
-        return value.toString();
-    }
-
-    /**
      * Dump buffer contents into the provided writer.
      */
     public void dump(Writer writer) throws IOException {
-        Iterator i = this.saxbits.iterator();
+        Iterator<SaxBit> i = this.saxbits.iterator();
         while (i.hasNext()) {
-            final SaxBit saxbit = (SaxBit) i.next();
+            final SaxBit saxbit = i.next();
             saxbit.dump(writer);
         }
         writer.flush();
@@ -226,7 +208,7 @@
     /**
      * Iterates through the bits list
      */
-    protected final Iterator bits() {
+    protected final Iterator<SaxBit> bits() {
         return this.saxbits.iterator();
     }
 
@@ -540,4 +522,4 @@
             writer.write("[IgnorableWhitespace] ch=" + new String(this.ch) + "\n");
         }
     }
-}
+}
\ No newline at end of file



Mime
View raw message