< prev index next >

src/java.desktop/share/classes/com/sun/beans/decoder/DocumentHandler.java

Print this page




 263         this.handler = null;
 264     }
 265 
 266     /**
 267      * Parses opening tag of XML element
 268      * using corresponding element handler.
 269      *
 270      * @param uri         the namespace URI, or the empty string
 271      *                    if the element has no namespace URI or
 272      *                    if namespace processing is not being performed
 273      * @param localName   the local name (without prefix), or the empty string
 274      *                    if namespace processing is not being performed
 275      * @param qName       the qualified name (with prefix), or the empty string
 276      *                    if qualified names are not available
 277      * @param attributes  the attributes attached to the element
 278      */
 279     @Override
 280     public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
 281         ElementHandler parent = this.handler;
 282         try {
 283             this.handler = getElementHandler(qName).newInstance();


 284             this.handler.setOwner(this);
 285             this.handler.setParent(parent);
 286         }
 287         catch (Exception exception) {
 288             throw new SAXException(exception);
 289         }
 290         for (int i = 0; i < attributes.getLength(); i++)
 291             try {
 292                 String name = attributes.getQName(i);
 293                 String value = attributes.getValue(i);
 294                 this.handler.addAttribute(name, value);
 295             }
 296             catch (RuntimeException exception) {
 297                 handleException(exception);
 298             }
 299 
 300         this.handler.startElement();
 301     }
 302 
 303     /**




 263         this.handler = null;
 264     }
 265 
 266     /**
 267      * Parses opening tag of XML element
 268      * using corresponding element handler.
 269      *
 270      * @param uri         the namespace URI, or the empty string
 271      *                    if the element has no namespace URI or
 272      *                    if namespace processing is not being performed
 273      * @param localName   the local name (without prefix), or the empty string
 274      *                    if namespace processing is not being performed
 275      * @param qName       the qualified name (with prefix), or the empty string
 276      *                    if qualified names are not available
 277      * @param attributes  the attributes attached to the element
 278      */
 279     @Override
 280     public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
 281         ElementHandler parent = this.handler;
 282         try {
 283             @SuppressWarnings("deprecation")
 284             ElementHandler tmp = getElementHandler(qName).newInstance();
 285             this.handler = tmp;
 286             this.handler.setOwner(this);
 287             this.handler.setParent(parent);
 288         }
 289         catch (Exception exception) {
 290             throw new SAXException(exception);
 291         }
 292         for (int i = 0; i < attributes.getLength(); i++)
 293             try {
 294                 String name = attributes.getQName(i);
 295                 String value = attributes.getValue(i);
 296                 this.handler.addAttribute(name, value);
 297             }
 298             catch (RuntimeException exception) {
 299                 handleException(exception);
 300             }
 301 
 302         this.handler.startElement();
 303     }
 304 
 305     /**


< prev index next >