CVS Update: xmlpull-api-v1/src/java/api/org/xmlpull/v1

Aleksander Andrzej Slominski <[email protected]>
Newsgroups gmane.text.xml.xmlpull.devel
Message-ID <[email protected]>
aslom       02/08/14 08:44:47

  Modified:    src/java/api/org/xmlpull/v1 XmlPullParserFactory.java
                        XmlSerializer.java
  Log:
  added chaining support in XmlSerializer for:
    startTag, endTag, attribute and text
  
  Revision  Changes    Path
  1.17      +9 -3      xmlpull-api-v1/src/java/api/org/xmlpull/v1/XmlPullParserFactory.java
  
  Index: XmlPullParserFactory.java
  ===================================================================
  RCS file: /l/extreme/cvspub/xmlpull-api-v1/src/java/api/org/xmlpull/v1/XmlPullParserFactory.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -b -t -w -r1.16 -r1.17
  --- XmlPullParserFactory.java	2002/07/18 19:36:31	1.16
  +++ XmlPullParserFactory.java	2002/08/14 13:44:47	1.17
  @@ -211,10 +211,14 @@
   
       public XmlSerializer newSerializer() throws XmlPullParserException {
   
  -        if (serializerClasses == null) throw new XmlPullParserException
  +        if (serializerClasses == null) {
  +            throw new XmlPullParserException
                   ("Factory initialization incomplete - has not tried "+classNamesLocation);
  -        if(serializerClasses.size() == 0) throw new XmlPullParserException
  +        }
  +        if(serializerClasses.size() == 0) {
  +            throw new XmlPullParserException
                   ("No valid serializer classes found in "+classNamesLocation);
  +        }
   
           StringBuffer issues = new StringBuffer ();
   
  @@ -333,7 +337,9 @@
               pos = cut + 1;
           }
   
  -        if (factory == null) factory = new XmlPullParserFactory ();
  +        if (factory == null) {
  +            factory = new XmlPullParserFactory ();
  +        }
           factory.parserClasses = parserClasses;
           factory.serializerClasses = serializerClasses;
           factory.classNamesLocation = classNamesLocation;
  
  
  
  1.4       +5 -5      xmlpull-api-v1/src/java/api/org/xmlpull/v1/XmlSerializer.java
  
  Index: XmlSerializer.java
  ===================================================================
  RCS file: /l/extreme/cvspub/xmlpull-api-v1/src/java/api/org/xmlpull/v1/XmlSerializer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -t -w -r1.3 -r1.4
  --- XmlSerializer.java	2002/07/18 18:54:36	1.3
  +++ XmlSerializer.java	2002/08/14 13:44:47	1.4
  @@ -127,7 +127,7 @@
        * If namespace is empty string no namespace prefix is printed but just name.
        */
   
  -    public void startTag (String namespace, String name) throws IOException;
  +    public XmlSerializer startTag (String namespace, String name) throws IOException;
   
       /**
        * Writes an attribute. calls to attribute must follow a call to
  @@ -136,7 +136,7 @@
        * If namespace is nul no namespace prefix is printed but just name.
        */
   
  -    public void attribute (String namespace, String name,
  +    public XmlSerializer attribute (String namespace, String name,
                              String value) throws IOException;
   
       /**
  @@ -155,12 +155,12 @@
        *  very difficult to find...
        * If namespace is nul no namespace prefix is printed but just name.
        */
  -    public void endTag (String namespace, String name) throws IOException;
  +    public XmlSerializer endTag (String namespace, String name) throws IOException;
   
       /** Writes text, where special XML chars are escaped automatically */
  -    public void text (String text) throws IOException;
  +    public XmlSerializer text (String text) throws IOException;
   
  -    public void text (char [] buf, int start, int len) throws IOException;
  +    public XmlSerializer text (char [] buf, int start, int len) throws IOException;
   
       /**
        * write  CDSECT, ENTITY_REF, IGNORABLE_WHITESPACE,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.