felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r568652 - /felix/trunk/scr/src/main/java/org/apache/felix/scr/parser/KXml2SAXParser.java
Date Wed, 22 Aug 2007 15:19:27 GMT
Author: fmeschbe
Date: Wed Aug 22 08:19:27 2007
New Revision: 568652

URL: http://svn.apache.org/viewvc?rev=568652&view=rev
Log:
Remove "this." prefixing and apply Felix Coding Standards

Modified:
    felix/trunk/scr/src/main/java/org/apache/felix/scr/parser/KXml2SAXParser.java

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/parser/KXml2SAXParser.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/parser/KXml2SAXParser.java?rev=568652&r1=568651&r2=568652&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/parser/KXml2SAXParser.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/parser/KXml2SAXParser.java Wed Aug
22 08:19:27 2007
@@ -18,6 +18,7 @@
  */
 package org.apache.felix.scr.parser;
 
+
 import java.io.Reader;
 import java.util.Properties;
 
@@ -25,57 +26,70 @@
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 
+
 /**
  * The KXml2SAXParser extends the XmlParser from kxml. This is a very
  * simple parser that does not take into account the DTD
  *
  */
-public class KXml2SAXParser extends KXmlParser {
+public class KXml2SAXParser extends KXmlParser
+{
+
+    /**
+    * The constructor for a parser, it receives a java.io.Reader.
+    *
+    * @param   reader  The reader
+    * @throws XmlPullParserException
+    */
+    public KXml2SAXParser( Reader reader ) throws XmlPullParserException
+    {
+        super();
+        setInput( reader );
+        setFeature( FEATURE_PROCESS_NAMESPACES, true );
+    }
+
 
     /**
-	* The constructor for a parser, it receives a java.io.Reader.
-	*
-	* @param   reader  The reader
-	* @throws XmlPullParserException
-	*/
-	public KXml2SAXParser(Reader reader) throws XmlPullParserException {
-		super();
-	    this.setInput(reader);
-	    this.setFeature(FEATURE_PROCESS_NAMESPACES, true);
-	}
-
-	/**
-	* Parser from the reader provided in the constructor, and call
-	* the startElement and endElement in a KxmlHandler
-	*
-	* @param   reader  The reader
-	* @exception   Exception thrown by the superclass
-	*/
-	public void parseXML(KXml2SAXHandler handler) throws Exception {
-
-		while (this.next() != XmlPullParser.END_DOCUMENT) {
-			handler.setLineNumber(this.getLineNumber());
-			handler.setColumnNumber(this.getColumnNumber());
-			if (this.getEventType() == XmlPullParser.START_TAG) {
-				Properties props = new Properties();
-				for (int i = 0; i < this.getAttributeCount(); i++) {
-					props.put(this.getAttributeName(i), this.getAttributeValue(i));
-				}
-				handler.startElement(
-					this.getNamespace(),
-					this.getName(),
-					props);
-			} else if (this.getEventType() == XmlPullParser.END_TAG) {
-				handler.endElement(this.getNamespace(), this.getName());
-			} else if (this.getEventType() == XmlPullParser.TEXT) {
-				String text = this.getText();
-				handler.characters(text);
-			} else if (this.getEventType() == XmlPullParser.PROCESSING_INSTRUCTION) {
-				// TODO extract the target from the evt.getText()
-				handler.processingInstruction(null,this.getText());
-			} else {
-				// do nothing
-			}
-		}
-	}
+    * Parser from the reader provided in the constructor, and call
+    * the startElement and endElement in a KxmlHandler
+    *
+    * @param   reader  The reader
+    * @exception   Exception thrown by the superclass
+    */
+    public void parseXML( KXml2SAXHandler handler ) throws Exception
+    {
+
+        while ( next() != XmlPullParser.END_DOCUMENT )
+        {
+            handler.setLineNumber( getLineNumber() );
+            handler.setColumnNumber( getColumnNumber() );
+            if ( getEventType() == XmlPullParser.START_TAG )
+            {
+                Properties props = new Properties();
+                for ( int i = 0; i < getAttributeCount(); i++ )
+                {
+                    props.put( getAttributeName( i ), getAttributeValue( i ) );
+                }
+                handler.startElement( getNamespace(), getName(), props );
+            }
+            else if ( getEventType() == XmlPullParser.END_TAG )
+            {
+                handler.endElement( getNamespace(), getName() );
+            }
+            else if ( getEventType() == XmlPullParser.TEXT )
+            {
+                String text = getText();
+                handler.characters( text );
+            }
+            else if ( getEventType() == XmlPullParser.PROCESSING_INSTRUCTION )
+            {
+                // TODO extract the target from the evt.getText()
+                handler.processingInstruction( null, getText() );
+            }
+            else
+            {
+                // do nothing
+            }
+        }
+    }
 }



Mime
View raw message