Package javax.xml.stream

Examples of javax.xml.stream.XMLEventReader.nextEvent()


                this.getClass().getClassLoader().getResourceAsStream(
                        "ie/baltimore/merlin-examples/merlin-xmlenc-five/plaintext-base64.xml")
        );

        while (xmlSecEventReader.hasNext()) {
            XMLSecEvent xmlSecEvent = (XMLSecEvent) xmlSecEventReader.nextEvent();
            canonicalizerTransformer.transform(xmlSecEvent);
        }

        canonicalizerTransformer.doFinal();
View Full Code Here


                this.getClass().getClassLoader().getResourceAsStream(
                        "ie/baltimore/merlin-examples/merlin-xmlenc-five/plaintext-base64.xml")
        );

        while (xmlSecEventReader.hasNext()) {
            XMLSecEvent xmlSecEvent = (XMLSecEvent) xmlSecEventReader.nextEvent();
            canonicalizerTransformer.transform(xmlSecEvent);
        }

        canonicalizerTransformer.doFinal();
View Full Code Here

            // ensure UTF-8 encoding
            Exchange exchange = new DefaultExchange(context);
            exchange.setProperty(Exchange.CHARSET_NAME, UTF_8.name());
            writer = context.getTypeConverter().mandatoryConvertTo(XMLEventWriter.class, exchange, output);
            while (reader.hasNext()) {
                writer.add(reader.nextEvent());
            }
        } finally {
            if (reader != null) {
                reader.close();
            }
View Full Code Here

            InputStream in = getClass().getResourceAsStream( DROOLS_ASSETEDITOR_CONFIG );
            XMLEventReader eventReader = inputFactory.createXMLEventReader( in );
            AssetEditorConfiguration configuration = null;

            while ( eventReader.hasNext() ) {
                XMLEvent event = eventReader.nextEvent();

                if ( event.isStartElement() ) {
                    final AssetEditorConfigElement element = AssetEditorConfigElement.forName( event.asStartElement().getName().getLocalPart() );
                    switch ( element ) {
                        case ASSET_EDITOR : {
View Full Code Here

                        case ASSET_EDITOR : {
                            configuration = new AssetEditorConfiguration();
                            break;
                        }
                        case FORMAT : {
                            event = eventReader.nextEvent();
                            if ( event.isCharacters() ) {
                                configuration.setFormat( event.asCharacters().getData() );
                            } else if ( event.isEndElement() ) {
                                configuration.setFormat( "" );
                            }
View Full Code Here

                                configuration.setFormat( "" );
                            }
                            break;
                        }
                        case TITLE : {
                            event = eventReader.nextEvent();
                            if ( event.isCharacters() ) {
                                configuration.setTitle( event.asCharacters().getData() );
                            } else if ( event.isEndElement() ) {
                                configuration.setTitle( "" );
                            }
View Full Code Here

                            }

                            break;
                        }
                        case ICON : {
                            event = eventReader.nextEvent();
                            if ( event.isCharacters() ) {
                                configuration.setIcon( event.asCharacters().getData() );
                            } else if ( event.isEndElement() ) {
                                configuration.setIcon( "" );
                            }
View Full Code Here

                                configuration.setIcon( "" );
                            }
                            break;
                        }
                        case CLASS : {
                            event = eventReader.nextEvent();
                            if ( event.isCharacters() ) {
                                configuration.setEditorClass( event.asCharacters().getData() );
                            } else if ( event.isEndElement() ) {
                                configuration.setEditorClass( "" );
                            }
View Full Code Here

    private List<XMLEvent> getEvents(String xml) throws XMLStreamException {
        XMLEventReader eventReader = inputFactory.createXMLEventReader(new StringReader(xml));
        List<XMLEvent> events = new LinkedList<XMLEvent>();
        while (eventReader.hasNext()) {
            XMLEvent event = eventReader.nextEvent();
            if (!(event.isStartDocument() || event.isEndDocument())) {
                events.add(event);
            }

        }
View Full Code Here

      XMLInputFactory factory = XMLInputFactory.newInstance();
      XMLEventReader reader = factory.createXMLEventReader(new FileInputStream(bindingsStorePath), "UTF-8");

      while (reader.hasNext())
      {
         XMLEvent event = reader.nextEvent();
         switch (event.getEventType())
         {
            case XMLStreamConstants.START_ELEMENT :
               StartElement startElement = event.asStartElement();
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.