-  
       
@Deprecated(since="11", forRemoval=true) public interface Diagnostic
Deprecated, for removal: This API element is subject to removal in a future version.Nashorn JavaScript script engine and APIs, and the jjs tool are deprecated with the intent to remove them in a future release.工具诊断接口。 诊断通常会报告源文件中特定位置的问题。 但是,并非所有诊断都与位置或文件相关联。位置是从文件开头起的从零开始的字符偏移量。 负值(
NOPOS除外)不是有效位置。行号和列号从1开始。负值(
NOPOS除外)和0不是有效的行号或列号。行终止符在ECMAScript规范中定义,它是{\ u000A,\ u000B,\ u2028,\ u2029}之一。
- 从以下版本开始:
 - 9
 
 
-  
        
       
-  
             
嵌套类汇总
嵌套类 变量和类型 接口 描述 static classDiagnostic.Kind不推荐使用,要删除:此API元素将在以后的版本中删除。Nashorn JavaScript脚本引擎和API以及jjs工具已弃用,目的是在将来的版本中删除它们。 
-  
             
字段汇总
字段 变量和类型 字段 描述 static longNOPOS不推荐使用,要删除:此API元素将在以后的版本中删除。用于表示没有可用的位置。 
-  
             
方法摘要
所有方法 实例方法 抽象方法 弃用的方法 变量和类型 方法 描述 StringgetCode()不推荐使用,要删除:此API元素将在以后的版本中删除。获取指示诊断类型的诊断代码。longgetColumnNumber()不推荐使用,要删除:此API元素将在以后的版本中删除。获取 getPosition()返回的字符偏移量的列号。StringgetFileName()不推荐使用,要删除:此API元素将在以后的版本中删除。获取源文件名。Diagnostic.KindgetKind()不推荐使用,要删除:此API元素将在以后的版本中删除。获取此诊断的类型,例如,错误或警告。longgetLineNumber()不推荐使用,要删除:此API元素将在以后的版本中删除。获取 getPosition()返回的字符偏移量的行号。StringgetMessage()不推荐使用,要删除:此API元素将在以后的版本中删除。获取此诊断的消息。longgetPosition()不推荐使用,要删除:此API元素将在以后的版本中删除。获取与此诊断关联的源对象的开头的字符偏移量,该偏移量指示问题的位置。 
 -  
             
 
-  
        
       
-  
             
字段详细信息
-  
NOPOS
static final long NOPOS
Deprecated, for removal: This API element is subject to removal in a future version.用于表示没有可用的位置。- 另请参见:
 - 常数字段值
 
 
 -  
 
-  
             
方法详细信息
-  
getKind
Diagnostic.Kind getKind()
Deprecated, for removal: This API element is subject to removal in a future version.获取此诊断的类型,例如,错误或警告。- 结果
 - 这种诊断的那种
 
 
-  
getPosition
long getPosition()
Deprecated, for removal: This API element is subject to removal in a future version.获取与此诊断关联的源对象的开头的字符偏移量,该偏移量指示问题的位置。 此外,必须满足以下条件:getStartPostion() <= getPosition()getPosition() <= getEndPosition()- 结果
 -  
              从源头开始的字符偏移; 
              
NOPOS如果没有合适的位置 
 
-  
getFileName
String getFileName()
Deprecated, for removal: This API element is subject to removal in a future version.获取源文件名。- 结果
 - 文件名,如果不可用则为null
 
 
-  
getLineNumber
long getLineNumber()
Deprecated, for removal: This API element is subject to removal in a future version.获取 getPosition()返回的字符偏移的行号。- 结果
 - 
               行号或 
              
NOPOS当且仅当getPosition()返回NOPOS 
 
-  
getColumnNumber
long getColumnNumber()
Deprecated, for removal: This API element is subject to removal in a future version.获取 getPosition()返回的字符偏移量的列号。- 结果
 - 
               列号或 
              
NOPOS当且仅当getPosition()返回NOPOS 
 
-  
getCode
String getCode()
Deprecated, for removal: This API element is subject to removal in a future version.获取指示诊断类型的诊断代码。 该代码依赖于实现,可能是null。- 结果
 - 诊断代码
 
 
-  
getMessage
String getMessage()
Deprecated, for removal: This API element is subject to removal in a future version.获取此诊断的消息。- 结果
 - 一个消息
 
 
 -  
 
 -