@Test public void testDeserializeData_list_multiple() throws SerializationException, URISyntaxException { NormalizedNode<?, ?> serializedData = bindingSerializer.deserialize(schemaContext, new StringReader(loadResourceAsString("sample-list-multiple.xml"))); Assert.assertNotNull(serializedData.toString()); }
@Override public NormalizedNode<?, ?> deserialize(final SchemaNode schemaNode, final Reader inputData) throws SerializationException { final XMLStreamReader reader; try { reader = XML_IN_FACTORY.createXMLStreamReader(inputData); } catch (XMLStreamException e) { throw new IllegalArgumentException(e); } final NormalizedNodeResult result = new NormalizedNodeResult(); try (NormalizedNodeStreamWriter streamWriter = ImmutableNormalizedNodeStreamWriter.from(result); XmlParserStream xmlParser = XmlParserStream.create(streamWriter, this.schemaContext, schemaNode)) { xmlParser.parse(reader); } catch (XMLStreamException | URISyntaxException | IOException | SAXException e) { throw new SerializationException(e); } finally { closeQuietly(reader); } return result.getResult(); }
XmlNodeConverter implements NodeConverter { @Override public NormalizedNode<?, ?> deserialize(final SchemaNode schemaNode, final Reader inputData) throws SerializationException { final XMLStreamReader reader; try { reader = XML_IN_FACTORY.createXMLStreamReader(inputData); } catch (XMLStreamException e) { throw new IllegalArgumentException(e); } final NormalizedNodeResult result = new NormalizedNodeResult(); try (NormalizedNodeStreamWriter streamWriter = ImmutableNormalizedNodeStreamWriter.from(result); XmlParserStream xmlParser = XmlParserStream.create(streamWriter, this.schemaContext, schemaNode)) { xmlParser.parse(reader); } catch (XMLStreamException | URISyntaxException | IOException | SAXException e) { throw new SerializationException(e); } finally { closeQuietly(reader); } return result.getResult(); } }
XmlNodeConverter implements NodeConverter { @Override public NormalizedNode<?, ?> deserialize(final SchemaNode schemaNode, final Reader inputData) throws SerializationException { final XMLStreamReader reader; try { reader = XML_IN_FACTORY.createXMLStreamReader(inputData); } catch (XMLStreamException e) { throw new IllegalArgumentException(e); } final NormalizedNodeResult result = new NormalizedNodeResult(); try (NormalizedNodeStreamWriter streamWriter = ImmutableNormalizedNodeStreamWriter.from(result); XmlParserStream xmlParser = XmlParserStream.create(streamWriter, this.schemaContext, schemaNode)) { xmlParser.parse(reader); } catch (XMLStreamException | URISyntaxException | IOException | SAXException e) { throw new SerializationException(e); } finally { closeQuietly(reader); } return result.getResult(); } XmlNodeConverter(final SchemaContext schemaContext); }
XmlNodeConverter implements NodeConverter { @Override public NormalizedNode<?, ?> deserialize(final SchemaNode schemaNode, final Reader inputData) throws SerializationException { final XMLStreamReader reader; try { reader = XML_IN_FACTORY.createXMLStreamReader(inputData); } catch (XMLStreamException e) { throw new IllegalArgumentException(e); } final NormalizedNodeResult result = new NormalizedNodeResult(); try (NormalizedNodeStreamWriter streamWriter = ImmutableNormalizedNodeStreamWriter.from(result); XmlParserStream xmlParser = XmlParserStream.create(streamWriter, this.schemaContext, schemaNode)) { xmlParser.parse(reader); } catch (XMLStreamException | URISyntaxException | IOException | SAXException e) { throw new SerializationException(e); } finally { closeQuietly(reader); } return result.getResult(); } XmlNodeConverter(final SchemaContext schemaContext); @Override Writer serializeData(final SchemaNode schemaNode, final NormalizedNode<?, ?> normalizedNode); @Override Writer serializeRpc(final SchemaNode schemaNode, final NormalizedNode<?, ?> normalizedNode); @Override NormalizedNode<?, ?> deserialize(final SchemaNode schemaNode, final Reader inputData); static void closeQuietly(final XMLStreamReader xmlStreamReader); }
XmlNodeConverter implements NodeConverter { @Override public NormalizedNode<?, ?> deserialize(final SchemaNode schemaNode, final Reader inputData) throws SerializationException { final XMLStreamReader reader; try { reader = XML_IN_FACTORY.createXMLStreamReader(inputData); } catch (XMLStreamException e) { throw new IllegalArgumentException(e); } final NormalizedNodeResult result = new NormalizedNodeResult(); try (NormalizedNodeStreamWriter streamWriter = ImmutableNormalizedNodeStreamWriter.from(result); XmlParserStream xmlParser = XmlParserStream.create(streamWriter, this.schemaContext, schemaNode)) { xmlParser.parse(reader); } catch (XMLStreamException | URISyntaxException | IOException | SAXException e) { throw new SerializationException(e); } finally { closeQuietly(reader); } return result.getResult(); } XmlNodeConverter(final SchemaContext schemaContext); @Override Writer serializeData(final SchemaNode schemaNode, final NormalizedNode<?, ?> normalizedNode); @Override Writer serializeRpc(final SchemaNode schemaNode, final NormalizedNode<?, ?> normalizedNode); @Override NormalizedNode<?, ?> deserialize(final SchemaNode schemaNode, final Reader inputData); static void closeQuietly(final XMLStreamReader xmlStreamReader);  }