Java 8 SourceLocator - 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 SourceLocator class.

This code example shows how to use the following methods:getColumnNumber, getLineNumber, getPublicId, getSystemId
   * @param locator Source locator 
   */ 
  public SAXSourceLocator(javax.xml.transform.SourceLocator locator)
  { 
    m_locator = null;
    this.setColumnNumber(locator.getColumnNumber());
    this.setLineNumber(locator.getLineNumber());
    this.setPublicId(locator.getPublicId());
    this.setSystemId(locator.getSystemId());
  } 
 
   
  /** 
   * Constructor SAXSourceLocator 
   * 
   * 
   * @param spe SAXParseException exception. 
   */ 
  public SAXSourceLocator(SAXParseException spe)
  { 
7
CodeRank
This code example shows how to use the following methods:getColumnNumber, getLineNumber, getPublicId, getSystemId
   * @param locator Source locator 
   */ 
  public SAXSourceLocator(javax.xml.transform.SourceLocator locator)
  { 
    m_locator = null;
    this.setColumnNumber(locator.getColumnNumber());
    this.setLineNumber(locator.getLineNumber());
    this.setPublicId(locator.getPublicId());
    this.setSystemId(locator.getSystemId());
  } 
 
   
  /** 
   * Constructor SAXSourceLocator 
   * 
   * 
   * @param spe SAXParseException exception. 
   */ 
  public SAXSourceLocator(SAXParseException spe)
  { 
7
CodeRank
This code example shows how to use the following methods:getColumnNumber, getLineNumber, getPublicId, getSystemId
    } 
 
    private String getMessage(TransformerException exception) {
        SourceLocator locator = exception.getLocator();
        if (locator != null) {
            String id = (!locator.getPublicId().equals(locator.getPublicId()))
                    ? locator.getPublicId()
                    : (null != locator.getSystemId())
                    ? locator.getSystemId() : "SystemId Unknown";
            return "File " + id
                   + "; Line " + locator.getLineNumber()
                   + "; Column " + locator.getColumnNumber()
                   + "; " + exception.getMessage();
        } 
        return exception.getMessage();
    } 
} 
6
CodeRank
This code example shows how to use the following methods:getColumnNumber, getLineNumber, getSystemId
        } 
    } 
 
    public LocationData(SourceLocator sourceLocator) {
        if (sourceLocator != null) {
            systemID = sourceLocator.getSystemId();
            line = sourceLocator.getLineNumber();
            col = sourceLocator.getColumnNumber();
        } 
    } 
 
    public LocationData(SAXParseException exception) {
        systemID = exception.getSystemId();
        line = exception.getLineNumber();
        col = exception.getColumnNumber();
    } 
 
    public String getSystemID() { return systemID; }
    public int getLine() { return line; }
    public int getCol() { return col; }
6
CodeRank
This code example shows how to use the following methods:getPublicId, getSystemId
   * @param locator SourceLocator holding location information  
   */ 
  public void setLocaterInfo(SourceLocator locator)
  { 
 
    m_publicId = locator.getPublicId();
    m_systemId = locator.getSystemId();
 
    super.setLocaterInfo(locator);
  } 
 
  /** 
   * The owning stylesheet. 
   * (Should this only be put on the template element, to 
   * conserve space?) 
   * @serial 
   */ 
  private Stylesheet m_stylesheet;
 
  /** 
6
CodeRank
This code example shows how to use the following methods:getColumnNumber, getLineNumber, getSystemId
                              (SAXSourceLocator)xctxt.getSAXLocator()));
    } 
    else 
    { 
      SourceLocator slocator = xctxt.getSAXLocator();
      System.out.println(fmsg + "; file " + slocator.getSystemId()
                         + "; line " + slocator.getLineNumber() + "; column "
                         + slocator.getColumnNumber());
    } 
  } 
   
  /** 
   * This will traverse the heararchy, calling the visitor for  
   * each member.  If the called visitor method returns  
   * false, the subtree should not be called. 
   *  
   * @param owner The owner of the visitor, where that path may be  
   *              rewritten if needed. 
   * @param visitor The visitor whose appropriate method will be called. 
   */ 
6
CodeRank
This code example shows how to use the following methods:getColumnNumber, getLineNumber, getPublicId, getSystemId
   * @param locator Source locator 
   */ 
  public SAXSourceLocator(javax.xml.transform.SourceLocator locator)
  { 
    m_locator = null;
    this.setColumnNumber(locator.getColumnNumber());
    this.setLineNumber(locator.getLineNumber());
    this.setPublicId(locator.getPublicId());
    this.setSystemId(locator.getSystemId());
  } 
 
   
  /** 
   * Constructor SAXSourceLocator 
   * 
   * 
   * @param spe SAXParseException exception. 
   */ 
  public SAXSourceLocator(SAXParseException spe)
  { 
6
CodeRank
This code example shows how to use the following methods:getColumnNumber, getLineNumber, getSystemId
                              (SAXSourceLocator)xctxt.getSAXLocator()));
    } 
    else 
    { 
      SourceLocator slocator = xctxt.getSAXLocator();
      System.out.println(fmsg + "; file " + slocator.getSystemId()
                         + "; line " + slocator.getLineNumber() + "; column "
                         + slocator.getColumnNumber());
    } 
  } 
   
  /** 
   * This will traverse the heararchy, calling the visitor for  
   * each member.  If the called visitor method returns  
   * false, the subtree should not be called. 
   *  
   * @param owner The owner of the visitor, where that path may be  
   *              rewritten if needed. 
   * @param visitor The visitor whose appropriate method will be called. 
   */ 
5
CodeRank
This code example shows how to use the following methods:getLineNumber, getPublicId, getSystemId
  private void fillLocationData(Problem problem, SourceLocator locator) {
    if (locator == null)
      return; 
 
    // resource 
    String resource = locator.getPublicId();
    if (resource == null)
      resource = locator.getSystemId();
    problem.setResource(resource);
 
    // line 
    problem.setLine(new Integer(locator.getLineNumber()));
  } 
} 
5
CodeRank
This code example shows how to use the following methods:getPublicId, getSystemId
   * @param locator SourceLocator holding location information  
   */ 
  public void setLocaterInfo(SourceLocator locator)
  { 
 
    m_publicId = locator.getPublicId();
    m_systemId = locator.getSystemId();
 
    super.setLocaterInfo(locator);
  } 
 
  /** 
   * The owning stylesheet. 
   * (Should this only be put on the template element, to 
   * conserve space?) 
   * @serial 
   */ 
  private Stylesheet m_stylesheet;
 
  /** 
5
CodeRank
See Code Examples for Java 8 SourceLocator Methods: