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