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

This code example shows how to use the following methods:setSystemId
 
  /** DomHelper for this TreeWalker          */ 
  final protected DOM2Helper m_dh;
         
  /** Locator object for this TreeWalker          */ 
  final private LocatorImpl m_locator = new LocatorImpl();
 
  /** 
   * Get the ContentHandler used for the tree walk. 
   * 
   * @return the ContentHandler used for the tree walk 
   */ 
  public ContentHandler getContentHandler()
  { 
    return m_contentHandler;
  } 
   
  public TreeWalker(ContentHandler ch) {
      this(ch,null);
  } 

7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getColumnNumber, getLineNumber, getPublicId, getSystemId
        inner.setSystemId(SYS);
        inner.setLineNumber(ROW);
        inner.setColumnNumber(COL);
 
        // Ordinary case 
        LocatorImpl outer = new LocatorImpl(inner);
 
        assertEquals(PUB, outer.getPublicId());
        assertEquals(SYS, outer.getSystemId());
        assertEquals(ROW, outer.getLineNumber());
        assertEquals(COL, outer.getColumnNumber());
 
        // No locator 
        try { 
            outer = new LocatorImpl(null);
            fail("NullPointerException expected");
        } catch (NullPointerException e) {
            // Expected 
        } 
    } 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setColumnNumber, setLineNumber, setPublicId, setSystemId
    public static final int ROW = 1;
 
    public static final int COL = 2;
 
    public void testSAXParseException_String_Locator_Exception() { 
        LocatorImpl l = new LocatorImpl();
        l.setPublicId(PUB);
        l.setSystemId(SYS);
        l.setLineNumber(ROW);
        l.setColumnNumber(COL);
 
        Exception c = new Exception();
 
        // Ordinary case 
        SAXParseException e = new SAXParseException(ERR, l, c);
 
        assertEquals(ERR, e.getMessage());
        assertEquals(c, e.getException());
 
        assertEquals(PUB, e.getPublicId());
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setSystemId
 
  /** DomHelper for this TreeWalker          */ 
  protected DOMHelper m_dh;
         
        /** Locator object for this TreeWalker          */ 
        private LocatorImpl m_locator = new LocatorImpl();
 
  /** 
   * Get the ContentHandler used for the tree walk. 
   * 
   * @return the ContentHandler used for the tree walk 
   */ 
  public ContentHandler getContentHandler()
  { 
    return m_contentHandler;
  } 
 
  /** 
   * Get the ContentHandler used for the tree walk. 
   * 

6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setColumnNumber, setLineNumber, setPublicId, setSystemId
        } 
        _locatorEvent(systemID_, publicID_);
    } 
 
    private void _locatorEvent(String systemID, String publicID) {
        LocatorImpl locator = new LocatorImpl();
        locator.setSystemId(systemID_);
        locator.setPublicId(publicID_);
        locator.setLineNumber(-1);
        locator.setColumnNumber(-1);
        content_.setDocumentLocator(locator);
    } 
 
    private void _handleDoctype(DocumentType doctype) {
        try { 
            if (doctype == null) {
                return; 
            } 
            String systemID = doctype.getSystemId();
            String publicID = doctype.getPublicId();
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getEncoding, getXMLVersion, getColumnNumber, getLineNumber, getPublicId
This code example shows how to use the following methods:setColumnNumber, setLineNumber, setPublicId, setSystemId
        } 
        _locatorEvent(systemID_, publicID_);
    } 
 
    private void _locatorEvent(String systemID, String publicID) {
        LocatorImpl locator = new LocatorImpl();
        locator.setSystemId(systemID_);
        locator.setPublicId(publicID_);
        locator.setLineNumber(-1);
        locator.setColumnNumber(-1);
        content_.setDocumentLocator(locator);
    } 
 
    private void _handleDoctype(DocumentType doctype) {
        try { 
            if (doctype == null) {
                return; 
            } 
            String systemID = doctype.getSystemId();
            String publicID = doctype.getPublicId();
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setColumnNumber, setLineNumber, setPublicId, setSystemId
    static void convertToSAXParseException(XMLParseException e) throws SAXException {
        Exception ex = e.getException();
        if (ex == null) {
            // must be a parser exception; mine it for locator info and throw 
            // a SAXParseException 
            LocatorImpl locatorImpl = new LocatorImpl();
            locatorImpl.setPublicId(e.getPublicId());
            locatorImpl.setSystemId(e.getExpandedSystemId());
            locatorImpl.setLineNumber(e.getLineNumber());
            locatorImpl.setColumnNumber(e.getColumnNumber());
            throw new SAXParseException(e.getMessage(), locatorImpl);
        } 
        if (ex instanceof SAXException) {
            // why did we create an XMLParseException? 
            throw (SAXException) ex;
        } 
        throw new SAXException(ex);
    } 
     
    static void convertToSAXException(XNIException e) throws SAXException {
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setSystemId
 
  /** DomHelper for this TreeWalker          */ 
  final protected DOM2Helper m_dh;
         
  /** Locator object for this TreeWalker          */ 
  final private LocatorImpl m_locator = new LocatorImpl();
 
  /** 
   * Get the ContentHandler used for the tree walk. 
   * 
   * @return the ContentHandler used for the tree walk 
   */ 
  public ContentHandler getContentHandler()
  { 
    return m_contentHandler;
  } 
   
  public TreeWalker(ContentHandler ch) {
      this(ch,null);
  } 

6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
 
    /** 
     * The constructor. 
     */ 
    public DocumentFragment() { 
        super(new LocatorImpl()); 
    } 
 
    /** 
     *  
     * @see nu.validator.saxtree.Node#visit(nu.validator.saxtree.TreeParser) 
     */ 
    @Override void visit(TreeParser treeParser) { 
        // nothing 
    } 
 
    /** 
     *  
     * @see nu.validator.saxtree.Node#getNodeType() 
     */ 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Java 8 LocatorImpl Methods: