protected static boolean setNamespaceAware(XMLOutputFactory f, boolean state) throws XMLStreamException { /* Let's not assert, but see if it sticks. Some implementations * might choose to silently ignore setting, at least for 'false'? */ try { f.setProperty(XMLStreamProperties.XSP_NAMESPACE_AWARE, state ? Boolean.TRUE : Boolean.FALSE); return (isNamespaceAware(f) == state); } catch (IllegalArgumentException e) { /* Let's assume, then, that the property (or specific value for it) * is NOT supported... */ return false; } }
protected static boolean isNamespaceAware(XMLOutputFactory f) throws XMLStreamException { return ((Boolean) f.getProperty(XMLStreamProperties.XSP_NAMESPACE_AWARE)).booleanValue(); }
protected static void setRepairing(XMLOutputFactory f, boolean state) { f.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.valueOf(state)); }
protected static XMLOutputFactory2 getNewOutputFactory() { return (XMLOutputFactory2) XMLOutputFactory.newInstance(); }