Examples of EndElement


Examples of javax.xml.stream.events.EndElement

    endElements.add(eventFactory.createEndElement(startElement.getName(), startElement.getNamespaces()));
  }

  private void writeNamespace(Namespace namespace) throws XMLStreamException {
    int last = endElements.size() - 1;
    EndElement oldEndElement = endElements.get(last);
    Iterator oldNamespaces = oldEndElement.getNamespaces();
    List<Namespace> newNamespaces = new ArrayList<Namespace>();
    while (oldNamespaces.hasNext()) {
      Namespace oldNamespace = (Namespace) oldNamespaces.next();
      newNamespaces.add(oldNamespace);
    }
    newNamespaces.add(namespace);
    EndElement newEndElement = eventFactory.createEndElement(oldEndElement.getName(), newNamespaces.iterator());
    eventWriter.add(namespace);
    endElements.set(last, newEndElement);
  }
View Full Code Here

Examples of javax.xml.stream.events.EndElement

    writeEndElement();
  }

  public void writeEndElement() throws XMLStreamException {
    int last = endElements.size() - 1;
    EndElement lastEndElement = endElements.get(last);
    eventWriter.add(lastEndElement);
    endElements.remove(last);
  }
View Full Code Here

Examples of javax.xml.stream.events.EndElement

    endElements.add(eventFactory.createEndElement(startElement.getName(), null));
  }

  private void writeNamespace(Namespace namespace) throws XMLStreamException {
    int last = endElements.size() - 1;
    EndElement oldEndElement = endElements.get(last);
    Iterator oldNamespaces = oldEndElement.getNamespaces();
    List<Namespace> newNamespaces = new ArrayList<Namespace>();
    while (oldNamespaces.hasNext()) {
      Namespace oldNamespace = (Namespace) oldNamespaces.next();
      newNamespaces.add(oldNamespace);
    }
    newNamespaces.add(namespace);
    EndElement newEndElement = eventFactory.createEndElement(oldEndElement.getName(), newNamespaces.iterator());
    eventWriter.add(namespace);
    endElements.set(last, newEndElement);
  }
View Full Code Here

Examples of javax.xml.stream.events.EndElement

                default:
                    throw new CorbaBindingException("Unsupported complex type");
                }
            }           
           
            EndElement endEl = factory.createEndElement(objName, null);
            writer.add(endEl);
        } catch (XMLStreamException ex) {
            LOG.log(Level.SEVERE, "STAX exception while writing to STAX event writer: " + ex.toString());
            LOG.log(Level.SEVERE, "Object being written: " + obj);
            throw new CorbaBindingException("writeObjectToStax STAX exception", ex);
View Full Code Here

Examples of javax.xml.stream.events.EndElement

        eventWriter.add(sElement);
        // Create Content
        Characters characters = eventFactory.createCharacters(value);
        eventWriter.add(characters);
        // Create End node
        EndElement eElement = eventFactory.createEndElement("", "", name);
        eventWriter.add(eElement);
        eventWriter.add(end);
    }
View Full Code Here

Examples of javax.xml.stream.events.EndElement

                    if (!startA.getName().getLocalPart().equals(startB.getName().getLocalPart())) {
                        message.append("Different elements ").append(startA.getName()).append(", ").append(startB.getName()).append(" at location ").append(eventA.getLocation());
                        return false;
                    }
                } else if (eventType == XMLStreamConstants.END_ELEMENT) {
                    EndElement endA = eventA.asEndElement();
                    EndElement endB = eventB.asEndElement();
                    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

Examples of javax.xml.stream.events.EndElement

                    }
                    continue;
                }
            }//isStartElement
            if (event.isEndElement()) {
                EndElement endElement = event.asEndElement();
                if (endElement.getName().getLocalPart().equalsIgnoreCase(CONFIG_BUNDLE)) {
                    configBeans.add(configValue);
                }
            }
        }//eventReader
        return configBeans;
View Full Code Here

Examples of javax.xml.stream.events.EndElement

                    addNamespaceDeclarations();
                    fNamespaceContext.pushContext();
                    fSchemaDOMParser.startElement(fElementQName, fAttributes, null);
                    break;
                case XMLStreamConstants.END_ELEMENT:
                    EndElement end = currentEvent.asEndElement();
                    fillQName(fElementQName, end.getName());
                    fillDeclaredPrefixes(end);
                    fLocationWrapper.setLocation(end.getLocation());
                    fSchemaDOMParser.endElement(fElementQName, null);
                    fNamespaceContext.popContext();
                    --fDepth;
                    if (fDepth <= 0) {
                        break loop;
View Full Code Here

Examples of javax.xml.stream.events.EndElement

                            fNamespaceContext.setNamespaceContext(start.getNamespaceContext());
                            fStAXLocationWrapper.setLocation(start.getLocation());
                            fSchemaValidator.startElement(fElementQName, fAttributes, null);
                            break;
                        case XMLStreamConstants.END_ELEMENT:
                            EndElement end = fCurrentEvent.asEndElement();
                            fillQName(fElementQName, end.getName());
                            fillDeclaredPrefixes(end);
                            fStAXLocationWrapper.setLocation(end.getLocation());
                            fSchemaValidator.endElement(fElementQName, null);
                            if (--fDepth <= 0) {
                                break loop;
                            }
                            break;
View Full Code Here

Examples of javax.xml.stream.events.EndElement

                    addNamespaceDeclarations();
                    fNamespaceContext.pushContext();
                    fSchemaDOMParser.startElement(fElementQName, fAttributes, null);
                    break;
                case XMLStreamConstants.END_ELEMENT:
                    EndElement end = currentEvent.asEndElement();
                    fillQName(fElementQName, end.getName());
                    fillDeclaredPrefixes(end);
                    fLocationWrapper.setLocation(end.getLocation());
                    fSchemaDOMParser.endElement(fElementQName, null);
                    fNamespaceContext.popContext();
                    --fDepth;
                    if (fDepth <= 0) {
                        break loop;
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.