Examples of encodingSet()


Examples of javax.xml.stream.events.StartDocument.encodingSet()

      StartDocument startDocument = (StartDocument) event;
      String xmlVersion = startDocument.getVersion();
      if (StringUtils.hasLength(xmlVersion)) {
        this.xmlVersion = xmlVersion;
      }
      if (startDocument.encodingSet()) {
        this.encoding = startDocument.getCharacterEncodingScheme();
      }
    }

    if (getContentHandler() != null) {
View Full Code Here

Examples of javax.xml.stream.events.StartDocument.encodingSet()

      StartDocument startDocument = (StartDocument) event;
      String xmlVersion = startDocument.getVersion();
      if (StringUtils.hasLength(xmlVersion)) {
        this.xmlVersion = xmlVersion;
      }
      if (startDocument.encodingSet()) {
        this.encoding = startDocument.getCharacterEncodingScheme();
      }
    }
    if (getContentHandler() != null) {
      final Location location = event.getLocation();
View Full Code Here

Examples of javax.xml.stream.events.StartDocument.encodingSet()

                    StartDocument event = (StartDocument) reader.nextEvent();

                    if (doc == null) {
                        // create document
                        if (event.encodingSet()) {
                            String encodingScheme = event
                                    .getCharacterEncodingScheme();
                            doc = factory.createDocument(encodingScheme);
                        } else {
                            doc = factory.createDocument();
View Full Code Here

Examples of javax.xml.stream.events.StartDocument.encodingSet()

/*     */       case 7:
/* 240 */         StartDocument event = (StartDocument)reader.nextEvent();
/*     */
/* 242 */         if (doc == null)
/*     */         {
/* 244 */           if (event.encodingSet()) {
/* 245 */             String encodingScheme = event.getCharacterEncodingScheme();
/*     */
/* 247 */             doc = this.factory.createDocument(encodingScheme);
/*     */           } else {
/* 249 */             doc = this.factory.createDocument();
View Full Code Here

Examples of javax.xml.stream.events.StartDocument.encodingSet()

        return false;
    }
    else if (start.getVersion() != null)
      return false;

    return encodingSet() == start.encodingSet() &&
           isStandalone() == start.isStandalone() &&
           standaloneSet() == start.standaloneSet();
  }
}
View Full Code Here

Examples of javax.xml.stream.events.StartDocument.encodingSet()

  public void testStartEndDocument() throws XMLStreamException {
    XMLStreamReader reader = createXmlStreamReader("<? xml ?>");
    StartDocument startDocument = (StartDocument)eventAllocator.allocate(reader);
    verify(startDocument, XMLStreamConstants.START_DOCUMENT, "<?xml version=\"1.0\"?>");
    Assert.assertEquals("UTF-8", startDocument.getCharacterEncodingScheme());
    Assert.assertFalse(startDocument.encodingSet());
    Assert.assertEquals("1.0", startDocument.getVersion());
    Assert.assertFalse(startDocument.isStandalone());
    Assert.assertFalse(startDocument.standaloneSet());
    reader.next();
    verify((EndDocument)eventAllocator.allocate(reader), XMLStreamConstants.END_DOCUMENT, "");
View Full Code Here

Examples of javax.xml.stream.events.StartDocument.encodingSet()

    Assert.assertEquals("1.1", startDocument.getVersion());
   
    reader = createXmlStreamReader("<? xml encoding=\"UTF-16\"?>");
    startDocument = (StartDocument)eventAllocator.allocate(reader);
    Assert.assertEquals("UTF-16", startDocument.getCharacterEncodingScheme());
    Assert.assertTrue(startDocument.encodingSet());
  }

  @Test
  public void testStartEndElement() throws XMLStreamException {
    XMLStreamReader reader = createXmlStreamReader("<alice/>");
View Full Code Here

Examples of javax.xml.stream.events.StartDocument.encodingSet()

      Namespace namespace = (Namespace) event;
      delegate.writeNamespace(namespace.getPrefix(), namespace.getNamespaceURI());
      break;
    case XMLStreamConstants.START_DOCUMENT:
      StartDocument startDocument = (StartDocument) event;
      if (startDocument.encodingSet()) { // encoding defined?
        delegate.writeStartDocument(startDocument.getCharacterEncodingScheme(), startDocument.getVersion());
      } else {
        delegate.writeStartDocument(startDocument.getVersion());
      }
      break;
View Full Code Here

Examples of javax.xml.stream.events.StartDocument.encodingSet()

        return false;
    }
    else if (start.getVersion() != null)
      return false;

    return encodingSet() == start.encodingSet() &&
           isStandalone() == start.isStandalone() &&
           standaloneSet() == start.standaloneSet();
  }
}
View Full Code Here

Examples of javax.xml.stream.events.StartDocument.encodingSet()

        if (o == null) return false;
        if (!(o instanceof StartDocument)) return false;

        StartDocument other = (StartDocument) o;

        return (encodingSet() == other.encodingSet())
            && (isStandalone() == other.isStandalone())
            && (standaloneSet() == other.standaloneSet())
            && stringsWithNullsEqual(getCharacterEncodingScheme(), other.getCharacterEncodingScheme())
            && stringsWithNullsEqual(getSystemId(), other.getSystemId())
            && stringsWithNullsEqual(getVersion(), other.getVersion())
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.