- java.lang.Object
 -  
      
- org.xml.sax.helpers.LocatorImpl
 
 
-  
       
- 实现的所有接口
 -  
         
Locator 
- 已知直接子类:
 -  
         
Locator2Impl 
public class LocatorImpl extends Object implements Locator
提供Locator的可选便捷实现。This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY. See http://www.saxproject.org for further information.
该类主要供应用程序编写者使用,他们可以在文档解析期间的任何时候使用它来创建定位器的持久快照:
Locator locator; Locator startloc; public void setLocator (Locator locator) { // note the locator this.locator = locator; } public void startDocument () { // save the location of the start of the document // for future use. Locator startloc = new LocatorImpl(locator); }通常,解析器编写器不会使用此类,因为仅在请求时提供位置信息更有效,而不是不断更新Locator对象。
- 从以下版本开始:
 - 1.4,SAX 1.0
 - 另请参见:
 -  
         
Locator 
 
-  
        
       
-  
             
构造方法摘要
构造方法 构造器 描述 LocatorImpl()零参数构造函数。LocatorImpl(Locator locator)复制构造函数。 
-  
             
方法摘要
所有方法 实例方法 具体的方法 变量和类型 方法 描述 intgetColumnNumber()返回保存的列号(从1开始)。intgetLineNumber()返回保存的行号(从1开始)。StringgetPublicId()返回已保存的公共标识符。StringgetSystemId()返回保存的系统标识符。voidsetColumnNumber(int columnNumber)设置此定位器的列号(从1开始)。voidsetLineNumber(int lineNumber)设置此定位器的行号(从1开始)。voidsetPublicId(String publicId)设置此定位器的公共标识符。voidsetSystemId(String systemId)设置此定位器的系统标识符。 
 -  
             
 
-  
        
       
-  
             
构造方法详细信息
-  
LocatorImpl
public LocatorImpl()
零参数构造函数。这通常不会有用,因为此类的主要目的是创建现有定位器的快照。
 
-  
LocatorImpl
public LocatorImpl(Locator locator)
复制构造函数。创建定位器当前状态的持久副本。 当原始定位器发生更改时,此副本仍将保留原始值(并且可以在DocumentHandler方法的范围之外使用)。
- 参数
 -  
              
locator- 要复制的定位器。 
 
 -  
 
-  
             
方法详细信息
-  
getPublicId
public String getPublicId()
返回已保存的公共标识符。- Specified by:
 -  
              
getPublicId在界面Locator - 结果
 - 公共标识符作为字符串,如果没有,则为null。
 - 另请参见:
 -  
              
Locator.getPublicId(),setPublicId(java.lang.String) 
 
-  
getSystemId
public String getSystemId()
返回保存的系统标识符。- Specified by:
 -  
              
getSystemId接口Locator - 结果
 - 系统标识符为字符串,如果没有,则为null。
 - 另请参见:
 -  
              
Locator.getSystemId(),setSystemId(java.lang.String) 
 
-  
getLineNumber
public int getLineNumber()
返回保存的行号(从1开始)。- Specified by:
 -  
              
getLineNumber在界面Locator - 结果
 - 行号为整数,如果没有,则为-1。
 - 另请参见:
 -  
              
Locator.getLineNumber(),setLineNumber(int) 
 
-  
getColumnNumber
public int getColumnNumber()
返回保存的列号(从1开始)。- Specified by:
 -  
              
getColumnNumber在界面Locator - 结果
 - 列号为整数,如果没有,则为-1。
 - 另请参见:
 -  
              
Locator.getColumnNumber(),setColumnNumber(int) 
 
-  
setPublicId
public void setPublicId(String publicId)
设置此定位器的公共标识符。- 参数
 -  
              
publicId- 新的公共标识符,如果没有,则为null。 - 另请参见:
 -  
              
getPublicId() 
 
-  
setSystemId
public void setSystemId(String systemId)
设置此定位器的系统标识符。- 参数
 -  
              
systemId- 新系统标识符,如果没有,则为null。 - 另请参见:
 -  
              
getSystemId() 
 
-  
setLineNumber
public void setLineNumber(int lineNumber)
设置此定位器的行号(从1开始)。- 参数
 -  
              
lineNumber- 行号,如果没有,则为-1。 - 另请参见:
 -  
              
getLineNumber() 
 
-  
setColumnNumber
public void setColumnNumber(int columnNumber)
设置此定位器的列号(从1开始)。- 参数
 -  
              
columnNumber- 列号,如果没有,则为-1。 - 另请参见:
 -  
              
getColumnNumber() 
 
 -  
 
 -