CVS Update: xmlpull-api-v1/addons/java/wrapper/src/org/xmlpull/v1/wrapper/classic

Aleksander Andrzej Slominski <[email protected]> Tue, 1 Jul 2003 14:11:51 -0500 (EST)
Newsgroups gmane.text.xml.xmlpull.devel
Message-ID <[email protected]>
aslom       03/07/01 14:11:51

  Modified:    addons/java/wrapper/src/org/xmlpull/v1/wrapper
                        XmlPullParserWrapper.java
               addons/java/wrapper/src/org/xmlpull/v1/wrapper/classic
                        StaticXmlPullParserWrapper.java
                        StaticXmlSerializerWrapper.java
  Log:
  more XSD read types methods
  
  Revision  Changes    Path
  1.6       +16 -0     xmlpull-api-v1/addons/java/wrapper/src/org/xmlpull/v1/wrapper/XmlPullParserWrapper.java
  
  Index: XmlPullParserWrapper.java
  ===================================================================
  RCS file: /l/extreme/cvspub/xmlpull-api-v1/addons/java/wrapper/src/org/xmlpull/v1/wrapper/XmlPullParserWrapper.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -t -w -r1.5 -r1.6
  --- XmlPullParserWrapper.java	1 Jul 2003 19:02:46 -0000	1.5
  +++ XmlPullParserWrapper.java	1 Jul 2003 19:11:50 -0000	1.6
  @@ -133,11 +133,27 @@
           throws XmlPullParserException, IOException;
   
       // set of methods to read XSD types
  +    /**
  +     * Read string content of elment and try to convert it to double.
  +     * Take special care of INF, Infinity and NaN.
  +     */
       public double readDouble() throws XmlPullParserException, IOException;
       public float readFloat() throws XmlPullParserException, IOException;
       public int readInt() throws XmlPullParserException, IOException;
       public String readString() throws XmlPullParserException, IOException;
   
  +    /**
  +     * Check that parser is on START_TAG with given namespace and name
  +     * and then callreadDouble().
  +     */
  +    public double readDoubleElement(String namespace, String name)
  +        throws XmlPullParserException, IOException;
  +    public float readFloatElement(String namespace, String name)
  +        throws XmlPullParserException, IOException;
  +    public int readIntElement(String namespace, String name)
  +        throws XmlPullParserException, IOException;
  +    public String readStringElemet(String namespace, String name)
  +        throws XmlPullParserException, IOException;
   
   }
   
  
  
  
  1.5       +28 -0     xmlpull-api-v1/addons/java/wrapper/src/org/xmlpull/v1/wrapper/classic/StaticXmlPullParserWrapper.java
  
  Index: StaticXmlPullParserWrapper.java
  ===================================================================
  RCS file: /l/extreme/cvspub/xmlpull-api-v1/addons/java/wrapper/src/org/xmlpull/v1/wrapper/classic/StaticXmlPullParserWrapper.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -t -w -r1.4 -r1.5
  --- StaticXmlPullParserWrapper.java	1 Jul 2003 19:02:46 -0000	1.4
  +++ StaticXmlPullParserWrapper.java	1 Jul 2003 19:11:50 -0000	1.5
  @@ -199,5 +199,33 @@
           return pp.nextText();
       }
   
  +    public double readDoubleElement(String namespace, String name)
  +        throws XmlPullParserException, IOException
  +    {
  +        pp.require(XmlPullParser.START_TAG, namespace, name);
  +        return readDouble();
  +    }
  +
  +    public float readFloatElement(String namespace, String name)
  +        throws XmlPullParserException, IOException
  +    {
  +        pp.require(XmlPullParser.START_TAG, namespace, name);
  +        return readFloat();
  +    }
  +
  +    public int readIntElement(String namespace, String name)
  +        throws XmlPullParserException, IOException
  +    {
  +        pp.require(XmlPullParser.START_TAG, namespace, name);
  +        return readInt();
  +    }
  +
  +    public String readStringElemet(String namespace, String name)
  +        throws XmlPullParserException, IOException
  +    {
  +        pp.require(XmlPullParser.START_TAG, namespace, name);
  +        return readString();
  +    }
  +
   }
   
  
  
  
  1.9       +1 -1      xmlpull-api-v1/addons/java/wrapper/src/org/xmlpull/v1/wrapper/classic/StaticXmlSerializerWrapper.java
  
  Index: StaticXmlSerializerWrapper.java
  ===================================================================
  RCS file: /l/extreme/cvspub/xmlpull-api-v1/addons/java/wrapper/src/org/xmlpull/v1/wrapper/classic/StaticXmlSerializerWrapper.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -b -t -w -r1.8 -r1.9
  --- StaticXmlSerializerWrapper.java	1 Jul 2003 19:02:46 -0000	1.8
  +++ StaticXmlSerializerWrapper.java	1 Jul 2003 19:11:50 -0000	1.9
  @@ -382,7 +382,7 @@
           throws XmlPullParserException, IOException, IllegalArgumentException
       {
           if( s == null ) {
  -            throws new IllegalArgumentException("null string can not be written");
  +            throw new IllegalArgumentException("null string can not be written");
           }
           xs.text(s);
       }
  
  
  


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/2U_rlB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email protected]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/