Exemplo n.º 1
0
 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;
   }
 }
Exemplo n.º 2
0
 protected static boolean isNamespaceAware(XMLOutputFactory f) throws XMLStreamException {
   return ((Boolean) f.getProperty(XMLStreamProperties.XSP_NAMESPACE_AWARE)).booleanValue();
 }
Exemplo n.º 3
0
 protected static void setRepairing(XMLOutputFactory f, boolean state) {
   f.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.valueOf(state));
 }
Exemplo n.º 4
0
 protected static XMLOutputFactory2 getNewOutputFactory() {
   return (XMLOutputFactory2) XMLOutputFactory.newInstance();
 }