[jsword-svn] common/java/core/org/crosswire/common/xml s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Mon May 16 17:47:03 MST 2005


Update of /cvs/jsword/common/java/core/org/crosswire/common/xml
In directory www.crosswire.org:/tmp/cvs-serv25437/java/core/org/crosswire/common/xml

Modified Files:
	StringSAXEventProvider.java HTMLSerializingContentHandler.java 
	TransformingSAXEventProvider.java 
	TransformingSAXEventProviderConverter.java 
	SAXEventProviderInputSource.java XMLUtil.java 
	SerializingContentHandler.java 
	PrettySerializingContentHandler.java 
	SAXEventProviderXMLReader.java JDOMSAXEventProvider.java 
	SAXEventProvider.java FormatType.java Converter.java 
Log Message:
Added support for CheckStyle plugin.
Added a few more CheckStyle rules.
Fixed a spelling mistake.

Index: SAXEventProviderInputSource.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/xml/SAXEventProviderInputSource.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SAXEventProviderInputSource.java	10 May 2005 02:38:36 -0000	1.3
--- SAXEventProviderInputSource.java	17 May 2005 00:47:01 -0000	1.4
***************
*** 28,32 ****
   * SAXEventProviderXMLReader.
   * 
!  * @see gnu.gpl.Licence for license details.
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]
--- 28,32 ----
   * SAXEventProviderXMLReader.
   * 
!  * @see gnu.gpl.License for license details.
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]

Index: TransformingSAXEventProvider.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/xml/TransformingSAXEventProvider.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TransformingSAXEventProvider.java	10 May 2005 02:38:36 -0000	1.6
--- TransformingSAXEventProvider.java	17 May 2005 00:47:01 -0000	1.7
***************
*** 51,55 ****
   * another SAXEventProvider (supplying input XML).
   *
!  * @see gnu.gpl.Licence for license details.
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]
--- 51,55 ----
   * another SAXEventProvider (supplying input XML).
   *
!  * @see gnu.gpl.License for license details.
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]

Index: SerializingContentHandler.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/xml/SerializingContentHandler.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** SerializingContentHandler.java	10 May 2005 02:38:36 -0000	1.5
--- SerializingContentHandler.java	17 May 2005 00:47:01 -0000	1.6
***************
*** 29,33 ****
   * Class to convert a SAX stream into a simple String.
   *
!  * @see gnu.gpl.Licence for license details.
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]
--- 29,33 ----
   * Class to convert a SAX stream into a simple String.
   *
!  * @see gnu.gpl.License for license details.
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]

Index: SAXEventProvider.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/xml/SAXEventProvider.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SAXEventProvider.java	10 May 2005 02:38:36 -0000	1.3
--- SAXEventProvider.java	17 May 2005 00:47:01 -0000	1.4
***************
*** 28,32 ****
   * A simple way of giving someone a place from which to get SAX events.
   * 
!  * @see gnu.gpl.Licence for license details.
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]
--- 28,32 ----
   * A simple way of giving someone a place from which to get SAX events.
   * 
!  * @see gnu.gpl.License for license details.
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]
***************
*** 39,42 ****
       * @param handler The place to send SAX events.
       */
!     public void provideSAXEvents(ContentHandler handler) throws SAXException;
  }
--- 39,42 ----
       * @param handler The place to send SAX events.
       */
!     void provideSAXEvents(ContentHandler handler) throws SAXException;
  }

Index: JDOMSAXEventProvider.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/xml/JDOMSAXEventProvider.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** JDOMSAXEventProvider.java	10 May 2005 02:38:36 -0000	1.3
--- JDOMSAXEventProvider.java	17 May 2005 00:47:01 -0000	1.4
***************
*** 31,35 ****
   * A SAXEventProvider that provides SAX events from a JDOM Document.
   * 
!  * @see gnu.gpl.Licence for license details.
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]
--- 31,35 ----
   * A SAXEventProvider that provides SAX events from a JDOM Document.
   * 
!  * @see gnu.gpl.License for license details.
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]

Index: FormatType.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/xml/FormatType.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** FormatType.java	10 May 2005 02:38:36 -0000	1.4
--- FormatType.java	17 May 2005 00:47:01 -0000	1.5
***************
*** 28,32 ****
   * The PrettySerializingContentHandler uses a FormatType to control its output.
   * 
!  * @see gnu.gpl.Licence for license details.
   *      The copyright to this program is held by it's authors.
   * @author DM Smith [dmsmith555 at gmail dot com]
--- 28,32 ----
   * The PrettySerializingContentHandler uses a FormatType to control its output.
   * 
!  * @see gnu.gpl.License for license details.
   *      The copyright to this program is held by it's authors.
   * @author DM Smith [dmsmith555 at gmail dot com]
***************
*** 139,143 ****
       * @see java.lang.Object#equals(java.lang.Object)
       */
!     public final boolean equals(Object o)
      {
          return super.equals(o);
--- 139,143 ----
       * @see java.lang.Object#equals(java.lang.Object)
       */
!     public boolean equals(Object o)
      {
          return super.equals(o);
***************
*** 148,152 ****
       * @see java.lang.Object#hashCode()
       */
!     public final int hashCode()
      {
          return super.hashCode();
--- 148,152 ----
       * @see java.lang.Object#hashCode()
       */
!     public int hashCode()
      {
          return super.hashCode();

Index: PrettySerializingContentHandler.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/xml/PrettySerializingContentHandler.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** PrettySerializingContentHandler.java	10 May 2005 02:38:36 -0000	1.7
--- PrettySerializingContentHandler.java	17 May 2005 00:47:01 -0000	1.8
***************
*** 34,38 ****
   * to a <code>Writer</code>.
   *
!  * @see gnu.gpl.Licence for license details.
   *      The copyright to this program is held by it's authors.
   * @author DM Smith [dmsmith555 at gmail dot com]
--- 34,38 ----
   * to a <code>Writer</code>.
   *
!  * @see gnu.gpl.License for license details.
   *      The copyright to this program is held by it's authors.
   * @author DM Smith [dmsmith555 at gmail dot com]
***************
*** 162,166 ****
  //            if (localname.equalsIgnoreCase("br")) //$NON-NLS-1$
  //            {
!                 write(getTagEnd());
  //            }
  //            else
--- 162,166 ----
  //            if (localname.equalsIgnoreCase("br")) //$NON-NLS-1$
  //            {
!             write(getTagEnd());
  //            }
  //            else
***************
*** 171,189 ****
  //        else
  //        {
!             if (formatting.isClassic())
!             {
!                 emitWhitespace(depth);
!             }
  
!             write(getEndTagStart());
  
!             write(decorateTagName(localname));
  
!             if (formatting.isAnalytic())
!             {
!                 emitWhitespace(depth);
!             }
  
!             write(getTagEnd());
  //        }
          pendingEndTag = false;
--- 171,189 ----
  //        else
  //        {
!         if (formatting.isClassic())
!         {
!             emitWhitespace(depth);
!         }
  
!         write(getEndTagStart());
  
!         write(decorateTagName(localname));
  
!         if (formatting.isAnalytic())
!         {
!             emitWhitespace(depth);
!         }
  
!         write(getTagEnd());
  //        }
          pendingEndTag = false;
***************
*** 364,368 ****
          '\t', '\t', '\t', '\t', '\t',
          '\t', '\t', '\t', '\t', '\t',
!         '\t', '\t', '\t', '\t', '\t'
      };
  
--- 364,368 ----
          '\t', '\t', '\t', '\t', '\t',
          '\t', '\t', '\t', '\t', '\t',
!         '\t', '\t', '\t', '\t', '\t',
      };
  

Index: XMLUtil.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/xml/XMLUtil.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** XMLUtil.java	10 May 2005 02:38:36 -0000	1.12
--- XMLUtil.java	17 May 2005 00:47:01 -0000	1.13
***************
*** 38,46 ****
   * Utilities for working with SAX XML parsing.
   *
!  * @see gnu.gpl.Licence for license details.
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]
   */
! public class XMLUtil
  {
      /**
--- 38,46 ----
   * Utilities for working with SAX XML parsing.
   *
!  * @see gnu.gpl.License for license details.
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]
   */
! public final class XMLUtil
  {
      /**
***************
*** 95,140 ****
       * Normalizes the given string
       */
!      public static String escape(String s)
!      {
!          if (s == null)
!          {
!              return s;
!          }
!          int len = s.length();
!          StringBuffer str = new StringBuffer(len);
  
!          for (int i = 0; i < len; i++)
!          {
!              char ch = s.charAt(i); //$NON-NLS-1$
!              switch (ch)
!              {
!              case '<':
!                  str.append("&lt;"); //$NON-NLS-1$
!                  break;
  
!              case '>':
!                  str.append("&gt;"); //$NON-NLS-1$
!                  break;
  
!              case '&':
!                  str.append("&amp;"); //$NON-NLS-1$
!                  break;
  
!              case '"':
!                  str.append("&quot;"); //$NON-NLS-1$
!                  break;
  
!              default:
!                  str.append(ch);
!              }
!          }
  
!          return str.toString();
!      }
  
  
      /**
!      * A parse has failed so we can try to kill the broken entities and then have
!      * another go.
       */
      public static String cleanAllEntities(String broken)
--- 95,140 ----
       * Normalizes the given string
       */
!     public static String escape(String s)
!     {
!         if (s == null)
!         {
!             return s;
!         }
!         int len = s.length();
!         StringBuffer str = new StringBuffer(len);
  
!         for (int i = 0; i < len; i++)
!         {
!             char ch = s.charAt(i); //$NON-NLS-1$
!             switch (ch)
!             {
!             case '<':
!                 str.append("&lt;"); //$NON-NLS-1$
!                 break;
  
!             case '>':
!                 str.append("&gt;"); //$NON-NLS-1$
!                 break;
  
!             case '&':
!                 str.append("&amp;"); //$NON-NLS-1$
!                 break;
  
!             case '"':
!                 str.append("&quot;"); //$NON-NLS-1$
!                 break;
  
!             default:
!                 str.append(ch);
!             }
!         }
  
!         return str.toString();
!     }
  
  
      /**
!      * A parse has failed so we can try to kill the broken entities and then
!      * have another go.
       */
      public static String cleanAllEntities(String broken)
***************
*** 148,152 ****
          int cleanfrom = 0;
  
!         allEntities:
          while (true)
          {
--- 148,152 ----
          int cleanfrom = 0;
  
!     allEntities:
          while (true)
          {
***************
*** 161,165 ****
              // Check for chars that should not be in an entity name
              int i = amp + 1;
!             singleEntity:
              while (true)
              {
--- 161,165 ----
              // Check for chars that should not be in an entity name
              int i = amp + 1;
!         singleEntity:
              while (true)
              {
***************
*** 214,219 ****
       * it if there are no obvious replacements.
       */
!     private static String guessEntity(String broken)
      {
          // strip any beginning & or ending ;
          if (broken.endsWith(";")) //$NON-NLS-1$
--- 214,220 ----
       * it if there are no obvious replacements.
       */
!     private static String guessEntity(String brokenEntity)
      {
+         String broken = brokenEntity;
          // strip any beginning & or ending ;
          if (broken.endsWith(";")) //$NON-NLS-1$
***************
*** 296,300 ****
          String working = broken;
  
!         allTags:
          while (true)
          {
--- 297,301 ----
          String working = broken;
  
!     allTags:
          while (true)
          {
***************
*** 311,315 ****
              int startattr = -1;
  
!             singletag:
              while (true)
              {
--- 312,316 ----
              int startattr = -1;
  
!         singletag:
              while (true)
              {

Index: HTMLSerializingContentHandler.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/xml/HTMLSerializingContentHandler.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** HTMLSerializingContentHandler.java	10 May 2005 02:38:36 -0000	1.5
--- HTMLSerializingContentHandler.java	17 May 2005 00:47:01 -0000	1.6
***************
*** 28,32 ****
   * serialization of a SAX stream to a <code>Writer</code>.
   *
!  * @see gnu.gpl.Licence for license details.
   *      The copyright to this program is held by it's authors.
   * @author DM Smith [ dmsmith555 at gmail dot com]
--- 28,32 ----
   * serialization of a SAX stream to a <code>Writer</code>.
   *
!  * @see gnu.gpl.License for license details.
   *      The copyright to this program is held by it's authors.
   * @author DM Smith [ dmsmith555 at gmail dot com]

Index: SAXEventProviderXMLReader.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/xml/SAXEventProviderXMLReader.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** SAXEventProviderXMLReader.java	10 May 2005 02:38:36 -0000	1.5
--- SAXEventProviderXMLReader.java	17 May 2005 00:47:01 -0000	1.6
***************
*** 33,37 ****
   * A helper to aid people working with a SAXEventProvider.
   *
!  * @see gnu.gpl.Licence for license details.
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]
--- 33,37 ----
   * A helper to aid people working with a SAXEventProvider.
   *
!  * @see gnu.gpl.License for license details.
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]

Index: StringSAXEventProvider.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/xml/StringSAXEventProvider.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** StringSAXEventProvider.java	10 May 2005 02:38:36 -0000	1.5
--- StringSAXEventProvider.java	17 May 2005 00:47:01 -0000	1.6
***************
*** 37,41 ****
   * A SAXEventProvider that provides SAX events from a String.
   * 
!  * @see gnu.gpl.Licence for license details.
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]
--- 37,41 ----
   * A SAXEventProvider that provides SAX events from a String.
   * 
!  * @see gnu.gpl.License for license details.
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]

Index: Converter.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/xml/Converter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Converter.java	10 May 2005 02:38:36 -0000	1.3
--- Converter.java	17 May 2005 00:47:01 -0000	1.4
***************
*** 28,32 ****
   * This can be a wrapper around an XSL transform or anything else.
   * 
!  * @see gnu.gpl.Licence for license details.
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]
--- 28,32 ----
   * This can be a wrapper around an XSL transform or anything else.
   * 
!  * @see gnu.gpl.License for license details.
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]
***************
*** 40,43 ****
       * @throws TransformerException If the transformation can't be completed
       */
!     public SAXEventProvider convert(SAXEventProvider provider) throws TransformerException;
  }
--- 40,43 ----
       * @throws TransformerException If the transformation can't be completed
       */
!     SAXEventProvider convert(SAXEventProvider provider) throws TransformerException;
  }

Index: TransformingSAXEventProviderConverter.java
===================================================================
RCS file: /cvs/jsword/common/java/core/org/crosswire/common/xml/TransformingSAXEventProviderConverter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TransformingSAXEventProviderConverter.java	10 May 2005 02:38:36 -0000	1.3
--- TransformingSAXEventProviderConverter.java	17 May 2005 00:47:01 -0000	1.4
***************
*** 28,32 ****
   * transform one SAXEventProvider into another SAXEventProvider using XSL.
   * 
!  * @see gnu.gpl.Licence for license details.
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]
--- 28,32 ----
   * transform one SAXEventProvider into another SAXEventProvider using XSL.
   * 
!  * @see gnu.gpl.License for license details.
   *      The copyright to this program is held by it's authors.
   * @author Joe Walker [joe at eireneh dot com]



More information about the jsword-svn mailing list