Code example for LocatorImpl

Methods: setSystemId

0
 
  /** 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);
  } 
  /** 
   * Constructor. 
   * @param   contentHandler The implemention of the 
   * contentHandler operation (toXMLString, digest, ...) 
   */ 
  public TreeWalker(ContentHandler contentHandler, String systemId)
  { 
      // Set the content handler 
      m_contentHandler = contentHandler;
      if (m_contentHandler instanceof SerializationHandler) {
          m_Serializer = (SerializationHandler) m_contentHandler;
      } 
      else 
          m_Serializer = null;
           
      // Set the system ID, if it is given 
      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             
           } 
      } 
           
      // Set the document locator   
                if (m_contentHandler != null)
                        m_contentHandler.setDocumentLocator(m_locator);
                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 = new DOM2Helper();