Package javax.xml.stream

Examples of javax.xml.stream.XMLInputFactory.createXMLEventReader()


       
        //System.out.println(baos.toString());
       
        ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
        XMLInputFactory ipFactory = XMLInputFactory.newInstance();
        XMLEventReader reader = ipFactory.createXMLEventReader(bais);
       
        Unmarshaller um = context.createUnmarshaller();       
        Object val = um.unmarshal(reader, GreetMe.class);
        assertTrue(val instanceof JAXBElement);
        val = ((JAXBElement<?>)val).getValue();
View Full Code Here


       
        //System.out.println(baos.toString());
       
        ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
        XMLInputFactory ipFactory = XMLInputFactory.newInstance();
        XMLEventReader reader = ipFactory.createXMLEventReader(bais);
       
        Unmarshaller um = context.createUnmarshaller();       
        Object val = um.unmarshal(reader, GreetMe.class);
        assertTrue(val instanceof JAXBElement);
        val = ((JAXBElement)val).getValue();
View Full Code Here

       
        //System.out.println(baos.toString());
       
        ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
        XMLInputFactory ipFactory = XMLInputFactory.newInstance();
        XMLEventReader reader = ipFactory.createXMLEventReader(bais);
       
        Unmarshaller um = context.createUnmarshaller();       
        Object val = um.unmarshal(reader, GreetMe.class);
        assertTrue(val instanceof JAXBElement);
        val = ((JAXBElement)val).getValue();
View Full Code Here

    public static void compare(final String a, final String b) throws Exception {
        final StringBuilder message = new StringBuilder();
        final XMLInputFactory factory = XMLInputFactory.newInstance();
        factory.setProperty(XMLInputFactory.SUPPORT_DTD, false);
        final XMLEventReader rA = factory.createXMLEventReader(new StringReader(a));
        final XMLEventReader rB = factory.createXMLEventReader(new StringReader(b));
        if (!compare(rA, rB, message)) {
            throw new Exception(message.toString());
        }
    }
View Full Code Here

    public static void compare(final String a, final String b) throws Exception {
        final StringBuilder message = new StringBuilder();
        final XMLInputFactory factory = XMLInputFactory.newInstance();
        factory.setProperty(XMLInputFactory.SUPPORT_DTD, false);
        final XMLEventReader rA = factory.createXMLEventReader(new StringReader(a));
        final XMLEventReader rB = factory.createXMLEventReader(new StringReader(b));
        if (!compare(rA, rB, message)) {
            throw new Exception(message.toString());
        }
    }
View Full Code Here

     */
    @Deprecated
    public XMLEventReader createXMLEventReader(InputStream in) throws XMLStreamException {
        XMLInputFactory factory = getInputFactory();
        try {
            return factory.createXMLEventReader(IOHelper.buffered(in));
        } finally {
            returnXMLInputFactory(factory);
        }
    }

View Full Code Here

    @Converter
    public XMLEventReader createXMLEventReader(InputStream in, Exchange exchange) throws XMLStreamException {
        XMLInputFactory factory = getInputFactory();
        try {
            return factory.createXMLEventReader(IOHelper.buffered(in), IOHelper.getCharsetName(exchange));
        } finally {
            returnXMLInputFactory(factory);
        }
    }
View Full Code Here

    @Converter
    public XMLEventReader createXMLEventReader(File file, Exchange exchange) throws XMLStreamException, FileNotFoundException {
        XMLInputFactory factory = getInputFactory();
        try {
            return factory.createXMLEventReader(IOHelper.buffered(new FileInputStream(file)), IOHelper.getCharsetName(exchange));
        } finally {
            returnXMLInputFactory(factory);
        }
    }
View Full Code Here

    @Converter
    public XMLEventReader createXMLEventReader(Reader reader) throws XMLStreamException {
        XMLInputFactory factory = getInputFactory();
        try {
            return factory.createXMLEventReader(IOHelper.buffered(reader));
        } finally {
            returnXMLInputFactory(factory);
        }
    }
View Full Code Here

    @Converter
    public XMLEventReader createXMLEventReader(XMLStreamReader reader) throws XMLStreamException {
        XMLInputFactory factory = getInputFactory();
        try {
            return factory.createXMLEventReader(reader);
        } finally {
            returnXMLInputFactory(factory);
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.