Code example for LocatorImpl

Methods: setSystemId

0
 
  /** 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. 
   * 
   * @return the ContentHandler used for the tree walk 
   */ 
  public void setContentHandler(ContentHandler ch)
  { 
    m_contentHandler = ch;
  } 
         
        /** 
   * Constructor. 
   * @param   contentHandler The implemention of the 
   * @param   systemId System identifier for the document. 
   * contentHandler operation (toXMLString, digest, ...) 
   */ 
  public TreeWalker(ContentHandler contentHandler, DOMHelper dh, String systemId)
  { 
    this.m_contentHandler = contentHandler;
    m_contentHandler.setDocumentLocator(m_locator);
    if (systemId != null)
        m_locator.setSystemId(systemId);
    else { 
        try { 
          // Bug see Bugzilla  26741 
          m_locator.setSystemId(System.getProperty("user.dir") + File.separator + "dummy.xsl");
         } 
         catch (SecurityException se) {// user.dir not accessible from applet             
         } 
    } 
    m_dh = dh;