@Override protected String parse(String theValue) { if (XmlDetectionUtil.isStaxPresent()) { // for validation XmlUtil.parse(theValue); } return theValue; }
private static XMLOutputFactory getOrCreateOutputFactory() throws FactoryConfigurationError { if (ourOutputFactory == null) { ourOutputFactory = createOutputFactory(); } return ourOutputFactory; }
private XMLEventReader createStreamReader(Reader theReader) { try { return XmlUtil.createXmlReader(theReader); } catch (FactoryConfigurationError e1) { throw new ConfigurationException("Failed to initialize STaX event factory", e1); } catch (XMLStreamException e1) { throw new DataFormatException(e1); } }
public static XMLStreamWriter createXmlStreamWriter(Writer theWriter) throws FactoryConfigurationError, XMLStreamException { throwUnitTestExceptionIfConfiguredToDoSo(); XMLOutputFactory outputFactory = getOrCreateOutputFactory(); return outputFactory.createXMLStreamWriter(theWriter); }
public static XMLEventReader createXmlReader(Reader reader) throws FactoryConfigurationError, XMLStreamException { throwUnitTestExceptionIfConfiguredToDoSo(); XMLInputFactory inputFactory = getOrCreateInputFactory(); // Now.. create the reader and return it return inputFactory.createXMLEventReader(reader); }
XMLOutputFactory outputFactory = newOutputFactory(); logStaxImplementation(outputFactory.getClass());
XMLInputFactory inputFactory = newInputFactory(); logStaxImplementation(inputFactory.getClass());
private XMLStreamWriter createXmlWriter(Writer theWriter) throws XMLStreamException { XMLStreamWriter eventWriter; eventWriter = XmlUtil.createXmlStreamWriter(theWriter); eventWriter = decorateStreamWriter(eventWriter); return eventWriter; }
public static XMLEventWriter createXmlWriter(Writer theWriter) throws FactoryConfigurationError, XMLStreamException { XMLOutputFactory outputFactory = getOrCreateOutputFactory(); return outputFactory.createXMLEventWriter(theWriter); }
private static XMLEventWriter createXmlFragmentWriter(Writer theWriter) throws FactoryConfigurationError, XMLStreamException { XMLOutputFactory outputFactory = getOrCreateFragmentOutputFactory(); return outputFactory.createXMLEventWriter(theWriter); }
/** * Encode a set of StAX events into a String */ public static String encode(List<XMLEvent> theEvents) { try { StringWriter w = new StringWriter(); XMLEventWriter ew = XmlUtil.createXmlFragmentWriter(w); for (XMLEvent next : theEvents) { if (next.isCharacters()) { ew.add(next); } else { ew.add(next); } } ew.close(); return w.toString(); } catch (XMLStreamException e) { throw new DataFormatException("Problem with the contained XML events", e); } catch (FactoryConfigurationError e) { throw new ConfigurationException(e); } }
public static XMLStreamWriter createXmlStreamWriter(Writer theWriter) throws FactoryConfigurationError, XMLStreamException { throwUnitTestExceptionIfConfiguredToDoSo(); XMLOutputFactory outputFactory = getOrCreateOutputFactory(); return outputFactory.createXMLStreamWriter(theWriter); }
public static XMLEventReader createXmlReader(Reader reader) throws FactoryConfigurationError, XMLStreamException { throwUnitTestExceptionIfConfiguredToDoSo(); XMLInputFactory inputFactory = getOrCreateInputFactory(); // Now.. create the reader and return it return inputFactory.createXMLEventReader(reader); }
XMLOutputFactory outputFactory = newOutputFactory(); logStaxImplementation(outputFactory.getClass());
XMLInputFactory inputFactory = newInputFactory(); logStaxImplementation(inputFactory.getClass());
private XMLStreamWriter createXmlWriter(Writer theWriter) throws XMLStreamException { XMLStreamWriter eventWriter; eventWriter = XmlUtil.createXmlStreamWriter(theWriter); eventWriter = decorateStreamWriter(eventWriter); return eventWriter; }
public static XMLEventWriter createXmlWriter(Writer theWriter) throws FactoryConfigurationError, XMLStreamException { XMLOutputFactory outputFactory = getOrCreateOutputFactory(); return outputFactory.createXMLEventWriter(theWriter); }
private static XMLEventWriter createXmlFragmentWriter(Writer theWriter) throws FactoryConfigurationError, XMLStreamException { XMLOutputFactory outputFactory = getOrCreateFragmentOutputFactory(); return outputFactory.createXMLEventWriter(theWriter); }
/** * Encode a set of StAX events into a String */ public static String encode(List<XMLEvent> theEvents) { try { StringWriter w = new StringWriter(); XMLEventWriter ew = XmlUtil.createXmlFragmentWriter(w); for (XMLEvent next : theEvents) { if (next.isCharacters()) { ew.add(next); } else { ew.add(next); } } ew.close(); return w.toString(); } catch (XMLStreamException e) { throw new DataFormatException("Problem with the contained XML events", e); } catch (FactoryConfigurationError e) { throw new ConfigurationException(e); } }
List<XMLEvent> events = XmlUtil.parse(theDt.getValue()); boolean firstElement = true;