Package org.xml.sax.ext

Examples of org.xml.sax.ext.Locator2


        // Root Element
        if (fElementDepth == 0) {
            String encoding = "UTF-8";
            if (fLocator != null) {
                if (fLocator instanceof Locator2) {
                    Locator2 locator2 = (Locator2) fLocator;
                    fXML11 = "1.1".equals(locator2.getXMLVersion());
                    encoding = locator2.getEncoding();
                    if (encoding == null) {
                        encoding = "UTF-8";
                    }
                }
                fLocator = null;
View Full Code Here


    }

    if (getContentHandler() != null) {
      final Location location = reader.getLocation();

      getContentHandler().setDocumentLocator(new Locator2() {

        public int getColumnNumber() {
          return location != null ? location.getColumnNumber() : -1;
        }
View Full Code Here

        this.typeQName = typeQName;
    }

    public void setDocumentLocator(Locator locator) {
        if ((this.getParentRecord() == null) && locator instanceof Locator2) {
            Locator2 loc = (Locator2)locator;
            this.setEncoding(loc.getEncoding());
            this.setVersion(loc.getXMLVersion());
        }
    }
View Full Code Here

                // SAX specification says the "getEncoding()" method in Locator2 can only
                // be called AFTER startDocument has returned and BEFORE endDocument is called.
               
                if (this.locator != null && this.locator instanceof Locator2) {
                   
                    final Locator2 loc = (Locator2) this.locator;
                   
                    this.xmlVersion = loc.getXMLVersion();
                    this.xmlEncoding = loc.getEncoding();

                    // There seems to be no way of obtaining the "standalone" property
                    // from the XML declaration.
                   
                }
View Full Code Here

        this.typeQName = typeQName;
    }

    public void setDocumentLocator(Locator locator) {
        if ((this.getParentRecord() == null) && locator instanceof Locator2) {
            Locator2 loc = (Locator2)locator;
            this.setEncoding(loc.getEncoding());
            this.setVersion(loc.getXMLVersion());
        }
    }
View Full Code Here

        this.typeQName = typeQName;
    }

    public void setDocumentLocator(Locator locator) {
        if ((this.getParentRecord() == null) && locator instanceof Locator2) {
            Locator2 loc = (Locator2)locator;
            this.setEncoding(loc.getEncoding());
            this.setVersion(loc.getXMLVersion());
        }
    }
View Full Code Here

   
    public void setDocumentLocator(Locator locator) {
      if(xmlReader != null){
        xmlReader.setLocator(locator);
        if (null == rootElementName  && null == rootElementLocalName && parentRecord == null && locator instanceof Locator2){
                Locator2 loc = (Locator2)locator;
                this.setEncoding(loc.getEncoding());
                this.setVersion(loc.getXMLVersion());
            }
      }
    }
View Full Code Here

  public boolean hasDC() {
    return hasDC;
  }
  public void setDocumentLocator(Locator locator) {
    if (locator instanceof Locator2) {
      Locator2 locator2 = (Locator2) locator;
      root.put("encoding", locator2.getEncoding());
    }
  }
View Full Code Here

   
    }
 
  public void setDocumentLocator(Locator locator) {
      if (locator instanceof Locator2) {
        Locator2 locator2 = (Locator2) locator;
        properties.setEL("encoding", locator2.getEncoding());
      }
    }
View Full Code Here

        this.typeQName = typeQName;
    }

    public void setDocumentLocator(Locator locator) {
        if ((this.getParentRecord() == null) && locator instanceof Locator2) {
            Locator2 loc = (Locator2)locator;
            this.setEncoding(loc.getEncoding());
            this.setVersion(loc.getXMLVersion());
        }
    }
View Full Code Here

TOP

Related Classes of org.xml.sax.ext.Locator2

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.