Package javax.xml.stream.events

Examples of javax.xml.stream.events.Characters


    StartElement startNode = eventFactory.createStartElement(EMPTY, EMPTY, name);
    eventWriter.add(tab);
    eventWriter.add(startNode);

    Characters content = eventFactory.createCharacters(value);
    eventWriter.add(content);

    EndElement endNode = eventFactory.createEndElement(EMPTY, EMPTY, name);
    eventWriter.add(endNode);
    eventWriter.add(end);
View Full Code Here


        switch (xmlEvent.getEventType()) {
            case XMLEvent.ATTRIBUTE:  {
                break;
            }
            case XMLEvent.CDATA: {
                Characters characters = xmlEvent.asCharacters();
                if(null == lexicalHandler) {
                    contentHandler.characters(characters.getData().toCharArray(), 0, characters.getData().length());
                } else {
                    lexicalHandler.startCDATA();
                    contentHandler.characters(characters.getData().toCharArray(), 0, characters.getData().length());
                    lexicalHandler.endCDATA();
                }
                break;
            }
            case XMLEvent.CHARACTERS: {
View Full Code Here

                    if (!endA.getName().getLocalPart().equals(endB.getName().getLocalPart())) {
                        message.append("Different elements ").append(endA.getName()).append(", ").append(endB.getName()).append(" at location ").append(eventA.getLocation());
                        return false;
                    }
                } else if (eventType == XMLStreamConstants.CHARACTERS) {
                    Characters endA = eventA.asCharacters();
                    Characters endB = eventB.asCharacters();
                    if (!endA.getData().equals(endB.getData())) {
                        message.append("Different content ").append(endA.getData()).append(", ").append(endB.getData()).append(" at location ").append(eventA.getLocation());
                        return false;
                    }
                }

        }
View Full Code Here

        switch (xmlEvent.getEventType()) {
            case XMLEvent.ATTRIBUTE:  {
                break;
            }
            case XMLEvent.CDATA: {
                Characters characters = xmlEvent.asCharacters();
                if(null == lexicalHandler) {
                    getContentHandler().characters(characters.getData().toCharArray(), 0, characters.getData().length());
                } else {
                    lexicalHandler.startCDATA();
                    getContentHandler().characters(characters.getData().toCharArray(), 0, characters.getData().length());
                    lexicalHandler.endCDATA();
                }
                break;
            }
            case XMLEvent.CHARACTERS: {
                Characters characters = xmlEvent.asCharacters();
                getContentHandler().characters(characters.getData().toCharArray(), 0, characters.getData().length());
                break;
            }
            case XMLEvent.COMMENT: {
                if(null != lexicalHandler) {
                    Comment comment = (Comment)xmlEvent;
View Full Code Here

                            }
                            break;
                        case XMLStreamConstants.CHARACTERS:
                        case XMLStreamConstants.SPACE:
                            if (fStAXValidatorHandler != null) {
                                Characters chars = fCurrentEvent.asCharacters();
                                fStAXValidatorHandler.setIgnoringCharacters(true);
                                sendCharactersToValidator(chars.getData());
                                fStAXValidatorHandler.setIgnoringCharacters(false);
                                fStAXValidatorHandler.characters(chars);
                            }
                            else {
                                sendCharactersToValidator(fCurrentEvent.asCharacters().getData());
                            }
                            break;
                        case XMLStreamConstants.CDATA:
                            if (fStAXValidatorHandler != null) {
                                Characters chars = fCurrentEvent.asCharacters();
                                fStAXValidatorHandler.setIgnoringCharacters(true);
                                fSchemaValidator.startCDATA(null);
                                sendCharactersToValidator(fCurrentEvent.asCharacters().getData());
                                fSchemaValidator.endCDATA(null);
                                fStAXValidatorHandler.setIgnoringCharacters(false);
View Full Code Here

        switch (xmlEvent.getEventType()) {
            case XMLEvent.ATTRIBUTE:  {
                break;
            }
            case XMLEvent.CDATA: {
                Characters characters = xmlEvent.asCharacters();
                if(null == lexicalHandler) {
                    contentHandler.characters(characters.getData().toCharArray(), 0, characters.getData().length());
                } else {
                    lexicalHandler.startCDATA();
                    contentHandler.characters(characters.getData().toCharArray(), 0, characters.getData().length());
                    lexicalHandler.endCDATA();
                }
                break;
            }
            case XMLEvent.CHARACTERS: {
View Full Code Here

    /* (non-Javadoc)
     * @see org.xml.sax.ext.LexicalHandler#endCDATA()
     */
    @Override
    public void endCDATA() throws SAXException {
        final Characters event = eventFactory.createCData(cdata.toString());
        cdata = null;
        try {
            this.consumeEvent(event);
        }
        catch (XMLStreamException ex) {
View Full Code Here

        while (!event.isEndDocument()) {
            switch (event.getEventType()) {
                case XMLStreamConstants.CHARACTERS:
                case XMLStreamConstants.SPACE:
                case XMLStreamConstants.CDATA: {
                    final Characters characters = event.asCharacters();
                    text.append(characters.getData());
                    break;
                }
                case XMLStreamConstants.ENTITY_REFERENCE: {
                    final EntityReference entityReference = (EntityReference)event;
                    final EntityDeclaration declaration = entityReference.getDeclaration();
View Full Code Here

            }
            if (event.isEndElement()) {
                inElement = "";
            }
            if (event.isCharacters()) {
                Characters characters = (Characters) event;
                if (!records.isEmpty()) {
                    AuditRecord record = records.get(records.size() - 1);
                    if (inElement.equals(AUDIT.ACTION.localName)) {
                        record.action = characters.getData();
                    } else if (inElement.equals(AUDIT.COMPONENT_ID.localName)) {
                        record.componentID = characters.getData();
                    } else if (inElement.equals(AUDIT.DATE.localName)) {
                        record.date =
                                DateUtility.convertStringToDate(characters
                                        .getData());
                    } else if (inElement.equals(AUDIT.JUSTIFICATION.localName)) {
                        record.justification = characters.getData();
                    } else if (inElement.equals(AUDIT.RESPONSIBILITY.localName)) {
                        record.responsibility = characters.getData();
                    }
                }
            }
        }
        return records;
View Full Code Here

        while (!event.isEndDocument()) {
            switch (event.getEventType()) {
                case XMLStreamConstants.CHARACTERS:
                case XMLStreamConstants.SPACE:
                case XMLStreamConstants.CDATA: {
                    final Characters characters = event.asCharacters();
                    text.append(characters.getData());
                    break;
                }
                case XMLStreamConstants.ENTITY_REFERENCE: {
                    final EntityReference entityReference = (EntityReference)event;
                    final EntityDeclaration declaration = entityReference.getDeclaration();
View Full Code Here

TOP

Related Classes of javax.xml.stream.events.Characters

Copyright © 2018 www.massapicom. 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.