Examples of createXMLStreamReader()


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

        super(staxImpl);
    }

    protected void runTest() throws Throwable {
        XMLInputFactory factory = staxImpl.newNormalizedXMLInputFactory();
        XMLStreamReader reader = factory.createXMLStreamReader(
                new StringReader("<?xml version=\"1.0\"?>\r\n<root/>"));
        assertEquals(XMLStreamReader.SPACE, reader.next());
        assertEquals("\n", reader.getText());
    }
}
View Full Code Here

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

        super(staxImpl);
    }

    protected void runTest() throws Throwable {
        XMLInputFactory factory = staxImpl.getDialect().enableCDataReporting(staxImpl.newNormalizedXMLInputFactory());
        XMLStreamReader reader = factory.createXMLStreamReader(new StringReader("<a><![CDATA[test]]></a>"));
        reader.nextTag();
        assertEquals(XMLStreamReader.CDATA, reader.next());
        assertEquals("test", reader.getText());
    }
}
View Full Code Here

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

        super(staxImpl);
    }

    protected void runTest() throws Throwable {
        XMLInputFactory factory = staxImpl.newNormalizedXMLInputFactory();
        XMLStreamReader reader = factory.createXMLStreamReader(new StringReader(
                "<root><child xmlns=\"\"/></root>"));
        int eventType;
        while ((eventType = reader.next()) != XMLStreamReader.END_DOCUMENT) {
            if (eventType == XMLStreamReader.START_ELEMENT) {
                assertNull(reader.getNamespaceURI());
View Full Code Here

Examples of org.apache.cxf.aegis.AegisContext.createXMLStreamReader()

        }

        AegisContext context = getAegisContext(type, genericType);
        AegisType typeToRead = context.getTypeMapping().getType(genericType);
       
        AegisReader<XMLStreamReader> aegisReader = context.createXMLStreamReader();
        XMLStreamReader xmlStreamReader = null;
        try {
            xmlStreamReader = createStreamReader(typeToRead, is);
            return type.cast(aegisReader.read(xmlStreamReader, typeToRead));
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.cxf.aegis.AegisContext.createXMLStreamReader()

   
    public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType m,
        MultivaluedMap<String, String> headers, InputStream is)
        throws IOException {
        AegisContext context = getAegisContext(type, genericType);
        AegisReader<XMLStreamReader> aegisReader = context.createXMLStreamReader();
        XMLStreamReader xmlStreamReader = StaxUtils.createXMLStreamReader(is);
        try {
            return aegisReader.read(xmlStreamReader);
        } catch (Exception e) {
            throw new WebApplicationException(e);
View Full Code Here

Examples of org.apache.tuscany.sca.common.xml.stax.StAXHelper.createXMLStreamReader()

        StringBuffer xml = new StringBuffer();
        xml.append("<").append(bindingType.getLocalPart()).append(" xmlns:b=\"").append(bindingType.getNamespaceURI())
            .append("\"/>");

        StAXHelper staxHelper = StAXHelper.getInstance(registry);
        XMLStreamReader reader = staxHelper.createXMLStreamReader(new StringReader(xml.toString()));
        reader.nextTag();
        Binding binding = (Binding)processor.read(reader, new ProcessorContext(registry));

        return binding;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.contribution.processor.ValidatingXMLInputFactory.createXMLStreamReader()

      ValidatingXMLInputFactory inputFactory = modelFactories.getFactory(ValidatingXMLInputFactory.class);       
      StreamSource source = new StreamSource( new StringReader(bindingXML) );
     
      ProcessorContext context = new ProcessorContext();
    try {
      XMLStreamReader reader = inputFactory.createXMLStreamReader(source);
      reader.next();
      Binding newBinding = (Binding) processor.read(reader, context );
      newBinding.setName(reference.getName());
     
      // Create a URI address for the callback based on the Component_Name/Reference_Name pattern
View Full Code Here

Examples of org.apache.tuscany.sdo.api.XMLStreamHelper.createXMLStreamReader()

                                                        ROOT_ELEMENT.getLocalPart());
    }

    public XMLStreamReader getReader() throws XMLStreamException {
        XMLStreamHelper streamHelper = SDOUtil.createXMLStreamHelper(helperContext);
        return streamHelper.createXMLStreamReader(sourceDocument);
    }

    public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException {
        StreamingOMSerializer serializer = new StreamingOMSerializer();
        serializer.serialize(getReader(), xmlWriter);
View Full Code Here

Examples of org.apache.tuscany.sdo.helper.XMLStreamHelper.createXMLStreamReader()

                                                        ROOT_ELEMENT.getLocalPart());
    }

    public XMLStreamReader getReader() throws XMLStreamException {
        XMLStreamHelper streamHelper = SDOUtil.createXMLStreamHelper(helperContext.getTypeHelper());
        return streamHelper.createXMLStreamReader(sourceDocument);
    }

    public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException {
        StreamingOMSerializer serializer = new StreamingOMSerializer();
        serializer.serialize(getReader(), xmlWriter);
View Full Code Here

Examples of org.codehaus.jettison.badgerfish.BadgerFishXMLInputFactory.createXMLStreamReader()

        return factory.createXMLStreamWriter(os);
    }
   
    public static XMLStreamReader createBadgerFishReader(InputStream is) throws XMLStreamException {
        XMLInputFactory factory = new BadgerFishXMLInputFactory();
        return factory.createXMLStreamReader(is);
    }
    //CHECKSTYLE:OFF   
    public static XMLStreamWriter createStreamWriter(OutputStream os,
                                                     QName qname,
                                                     boolean writeXsiType,
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.