namespaces.add(declaredNs); declareAdditionalNamespace(declaredNs); return new XmlParser.ElementHandler(); return super.getChildHandler(namespace, localName, attrs);
curHandler = curHandler.getChildHandler( namespace, qName, localName, attrs, elementNamespaces); } catch (ParseException e) { curHandler.processAttribute( attrNamespace, attrQName, attrLocalName, attrValue);
curHandler.processEndElement(); } catch (ParseException e) { throw new SAXException(e);
curHandler = curHandler.getChildHandler( namespace, qName, localName, attrs, elementNamespaces); } catch (ParseException e) { curHandler.processAttribute( attrNamespace, attrQName, attrLocalName, attrValue);
curHandler = curHandler.getChildHandler( namespace, qName, localName, attrs, elementNamespaces); } catch (ParseException e) { curHandler.processAttribute( attrNamespace, attrQName, attrLocalName, attrValue);
return new GroupSubAttrHandler(localName, attrs); return new XmlParser.ElementHandler() { private int width = -1; private int height = -1;
List<XmlNamespace> namespaces) throws ParseException, IOException { return getChildHandler(namespace, localName, attrs);
return new GroupSubAttrHandler(localName, attrs); return new XmlParser.ElementHandler() { private int width = -1; private int height = -1;
curHandler.processEndElement(); } catch (ParseException e) { throw new SAXException(e);
List<XmlNamespace> namespaces) throws ParseException, IOException { return getChildHandler(namespace, localName, attrs);
List<XmlNamespace> namespaces) throws ParseException, IOException { return getChildHandler(namespace, localName, attrs);
curHandler.processEndElement(); } catch (ParseException e) { throw new SAXException(e);
namespaces.add(declaredNs); declareAdditionalNamespace(declaredNs); return new XmlParser.ElementHandler(); return super.getChildHandler(namespace, localName, attrs);
namespaces.add(declaredNs); declareAdditionalNamespace(declaredNs); return new XmlParser.ElementHandler(); return super.getChildHandler(namespace, localName, attrs);
/** * Utility method to return the value of an xsd:boolean attribute. * * @param attrs * Elements attributes to test against. * * @param attrName * Attribute name. * * @return the Boolean value if the attribute is present, or * {@code null} otherwise. * * @throws ParseException if attribute value is not valid xsd:boolean. */ public Boolean getBooleanAttribute(Attributes attrs, String attrName) throws ParseException { Boolean result = null; String value = attrs.getValue("", attrName); try { result = parseBooleanValue(value); } catch (ParseException ex) { ParseException pe = new ParseException( CoreErrorDomain.ERR.invalidAttributeValue); pe.setInternalReason("Invalid value for " + attrName + " attribute: " + value); throw pe; } return result; }
/** * Utility method to return the value of an xsd:boolean attribute. * * @param attrs * Elements attributes to test against. * * @param attrName * Attribute name. * * @return the Boolean value if the attribute is present, or * {@code null} otherwise. * * @throws ParseException if attribute value is not valid xsd:boolean. */ public Boolean getBooleanAttribute(Attributes attrs, String attrName) throws ParseException { Boolean result = null; String value = attrs.getValue("", attrName); try { result = parseBooleanValue(value); } catch (ParseException ex) { ParseException pe = new ParseException( CoreErrorDomain.ERR.invalidAttributeValue); pe.setInternalReason("Invalid value for " + attrName + " attribute: " + value); throw pe; } return result; }
/** * Called to process an attribute. Designed to be overridden by derived * classes. * * @param namespace * Attribute namespace URI. * * @param qualifiedName * Attribute's qualified name. * * @param localName * Attribute's local name. * * @param attrValue * Attribute value. * * @throws ParseException * Invalid attribute. */ public void processAttribute(String namespace, String qualifiedName, String localName, String attrValue) throws ParseException { processAttribute(namespace, localName, attrValue); }
/** * Called to process an attribute. Designed to be overridden by derived * classes. * * @param namespace * Attribute namespace URI. * * @param qualifiedName * Attribute's qualified name. * * @param localName * Attribute's local name. * * @param attrValue * Attribute value. * * @throws ParseException * Invalid attribute. */ public void processAttribute(String namespace, String qualifiedName, String localName, String attrValue) throws ParseException { processAttribute(namespace, localName, attrValue); }
@Override public ElementHandler getChildHandler(String namespace, String localName, Attributes attrs) throws ParseException, IOException { if (Namespaces.g.equals(namespace)) { if ("error".equals(localName)) { if (currentException == null) { currentException = initialException; } else { try { // Create an exception of the same type as this one // and make it a sibling. currentException = initialException.getClass() .getConstructor(String.class).newInstance( initialException.getMessage()); initialException.addSibling(currentException); } catch (InstantiationException ie) { throw new IllegalStateException(ie); } catch (NoSuchMethodException nsme) { throw new IllegalStateException(nsme); } catch (IllegalAccessException iae) { throw new IllegalStateException(iae); } catch (InvocationTargetException ite) { throw new IllegalStateException(ite); } } return new ErrorHandler(); } } return super.getChildHandler(namespace, localName, attrs); }
/** * Utility method to return the value of an xsd:boolean attribute. * * @param attrs * Elements attributes to test against. * * @param attrName * Attribute name. * * @return the Boolean value if the attribute is present, or * {@code null} otherwise. * * @throws ParseException if attribute value is not valid xsd:boolean. */ public Boolean getBooleanAttribute(Attributes attrs, String attrName) throws ParseException { Boolean result = null; String value = attrs.getValue("", attrName); try { result = parseBooleanValue(value); } catch (ParseException ex) { ParseException pe = new ParseException( CoreErrorDomain.ERR.invalidAttributeValue); pe.setInternalReason("Invalid value for " + attrName + " attribute: " + value); throw pe; } return result; }