Java 8 Locator2 - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Locator2 class.

This code example shows how to use the following methods:getEncoding
   @Override 
   public void startDocument() throws SAXException 
   { 
      if (locator != null)
      { 
         encoding = locator.getEncoding();
      } 
   } 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getEncoding
    } 
	 
	public void setDocumentLocator(Locator locator) { 
		  if (locator instanceof Locator2) {
		    Locator2 locator2 = (Locator2) locator;
		    properties.setEL("encoding", locator2.getEncoding());
		  }  
		} 
 
	@Override 
	public void startElement(String uri, String name, String qName, Attributes atts) {
		inside = KeyImpl.getInstance(qName);
		lcInside=qName.toLowerCase();
		if(lcInside.equals("image")) 		insideImage=true;
		else if(qName.equals("item")) 	{
			items.addRow(); 
			insideItem=true;
		} 
		else if(lcInside.equals("rss")) 	{
			String version = atts.getValue("version");
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getEncoding, getXMLVersion
	} 
 
	public void setDocumentLocator(Locator locator) {
		if (locator instanceof Locator2) {
			Locator2 locator2 = (Locator2) locator;
			xmlVersion = locator2.getXMLVersion();
			xmlEncoding = locator2.getEncoding();
		} 
	} 
 
	public void comment(char[] ch, int start, int length) throws SAXException {
		if (docTypeDeclState)
			return; 
		if (todoProlog) {
			buildPrologStart(); 
			todoProlog = false;
		} 
		builder.Comment_();
		builder.CommentText(new String(ch, start, length));
		builder._Comment();
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getEncoding
		return hasDC;
	} 
	public void setDocumentLocator(Locator locator) { 
		if (locator instanceof Locator2) {
			Locator2 locator2 = (Locator2) locator;
			root.put("encoding", locator2.getEncoding());
		}  
	} 
 
	@Override 
	public void startElement(String uri, String name, String qName, Attributes atts) {
		deep++;
		 
		 
		if("entry".equals(name))inEntry=true;
		else if("author".equals(name))inAuthor=true;
		 
		if(qName.startsWith("dc:")){
			name="dc_"+name;
			hasDC=true;
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getEncoding
    } 
 
    @Override 
    public void startDocument() throws SAXException {
        if (locator != null) {
            encoding = locator.getEncoding();
        } 
    } 
} 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getEncoding, getXMLVersion
	public void startDocument() 
            throws SAXException { 
		StringBuffer decl = new StringBuffer();
		decl.append("<?xml");
		if (this.locator != null) {
			decl.append(" version='").append(this.locator.getXMLVersion()).append("'");
			decl.append(" encoding='").append(this.locator.getEncoding()).append("'");
		} else { 
			decl.append(" version='1.0'");
		} 
		decl.append("?>");
		this.out.println(decl);
	} 
	 
	public void startElement(String uri, String localName,String qName, Attributes attr) 
			throws SAXException { 
		this.eltLevel++;
		StringBuffer openTagBuf = new StringBuffer();
		 
		openTagBuf.append("<").append(qName);
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getEncoding
  @Override 
  public String getEncoding()
  { 
    if (locator2 != null)
    { 
      return locator2.getEncoding();
    } 
    return null; 
  } 
 
  @Override 
  public String getXMLVersion()
  { 
    if (locator2 != null)
    { 
      return locator2.getXMLVersion();
    } 
    return null; 
  } 
 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getEncoding
   @Override 
   public void startDocument() throws SAXException
   { 
      if (locator != null)
      { 
         encoding = locator.getEncoding();
      } 
   } 
} 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getEncoding
        return -1; 
    } 
 
    public String getEncoding() {
        if (fLocator2 != null) {
            return fLocator2.getEncoding();
        } 
        return null; 
    } 
 
    public String getXMLVersion() {
        if (fLocator2 != null) {
            return fLocator2.getXMLVersion();
        } 
        return null; 
    } 
     
} // SAXLocatorWrapper 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getEncoding
        return -1; 
    } 
 
    public String getEncoding() {
        if (fLocator2 != null) {
            return fLocator2.getEncoding();
        } 
        return null; 
    } 
 
    public String getXMLVersion() {
        if (fLocator2 != null) {
            return fLocator2.getXMLVersion();
        } 
        return null; 
    } 
     
} // SAXLocatorWrapper 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Java 8 Locator2 Methods: