jdk/src/share/classes/com/sun/rowset/internal/WebRowSetXmlWriter.java
changeset 11129 f9ad1aadf3fa
parent 6697 39929804f9d4
child 11680 8be4a665d07e
equal deleted inserted replaced
11128:ffb869e392cf 11129:f9ad1aadf3fa
    53     /**
    53     /**
    54      * The <code>java.util.Stack</code> object that this <code>WebRowSetXmlWriter</code>
    54      * The <code>java.util.Stack</code> object that this <code>WebRowSetXmlWriter</code>
    55      * object will use for storing the tags to be used for writing the calling
    55      * object will use for storing the tags to be used for writing the calling
    56      * <code>WebRowSet</code> object as an XML document.
    56      * <code>WebRowSet</code> object as an XML document.
    57      */
    57      */
    58     private java.util.Stack stack;
    58     private java.util.Stack<String> stack;
    59 
    59 
    60     private  JdbcRowSetResourceBundle resBundle;
    60     private  JdbcRowSetResourceBundle resBundle;
    61 
    61 
    62     public WebRowSetXmlWriter() {
    62     public WebRowSetXmlWriter() {
    63 
    63 
    92      */
    92      */
    93     public void writeXML(WebRowSet caller, java.io.Writer wrt)
    93     public void writeXML(WebRowSet caller, java.io.Writer wrt)
    94     throws SQLException {
    94     throws SQLException {
    95 
    95 
    96         // create a new stack for tag checking.
    96         // create a new stack for tag checking.
    97         stack = new java.util.Stack();
    97         stack = new java.util.Stack<>();
    98         writer = wrt;
    98         writer = wrt;
    99         writeRowSet(caller);
    99         writeRowSet(caller);
   100     }
   100     }
   101 
   101 
   102     /**
   102     /**
   125      */
   125      */
   126     public void writeXML(WebRowSet caller, java.io.OutputStream oStream)
   126     public void writeXML(WebRowSet caller, java.io.OutputStream oStream)
   127     throws SQLException {
   127     throws SQLException {
   128 
   128 
   129         // create a new stack for tag checking.
   129         // create a new stack for tag checking.
   130         stack = new java.util.Stack();
   130         stack = new java.util.Stack<>();
   131         writer = new OutputStreamWriter(oStream);
   131         writer = new OutputStreamWriter(oStream);
   132         writeRowSet(caller);
   132         writeRowSet(caller);
   133     }
   133     }
   134 
   134 
   135     /**
   135     /**
   203 
   203 
   204             endSection("key-columns");
   204             endSection("key-columns");
   205 
   205 
   206             //Changed to beginSection and endSection for maps for proper indentation
   206             //Changed to beginSection and endSection for maps for proper indentation
   207             beginSection("map");
   207             beginSection("map");
   208             java.util.Map typeMap = caller.getTypeMap();
   208             java.util.Map<?,?> typeMap = caller.getTypeMap();
   209             if (typeMap != null) {
   209             if (typeMap != null) {
   210                 Iterator i = typeMap.keySet().iterator();
   210                 Iterator<?> i = typeMap.keySet().iterator();
   211                 Class c;
   211                 Class<?> c;
   212                 String type;
   212                 String type;
   213                 while (i.hasNext()) {
   213                 while (i.hasNext()) {
   214                     type = (String)i.next();
   214                     type = (String)i.next();
   215                     c = (Class)typeMap.get(type);
   215                     c = (Class)typeMap.get(type);
   216                     propString("type", type);
   216                     propString("type", type);
   530         // add the tag to stack
   530         // add the tag to stack
   531         stack.push(tag);
   531         stack.push(tag);
   532     }
   532     }
   533 
   533 
   534     private String getTag() {
   534     private String getTag() {
   535         return (String)stack.pop();
   535         return stack.pop();
   536     }
   536     }
   537 
   537 
   538     private void writeNull() throws java.io.IOException {
   538     private void writeNull() throws java.io.IOException {
   539         emptyTag("null");
   539         emptyTag("null");
   540     }
   540     }