JavaTM 2 Platform
Standard Ed. 6

javax.tools
枚举 StandardLocation

java.lang.Object
  继承者 java.lang.Enum<StandardLocation>
      继承者 javax.tools.StandardLocation
所有已实现的接口:
Serializable, Comparable<StandardLocation>, JavaFileManager.Location

public enum StandardLocation
extends Enum<StandardLocation>
implements JavaFileManager.Location

文件对象的标准位置。

从以下版本开始:
1.6

枚举常量摘要
ANNOTATION_PROCESSOR_PATH
          搜索注释处理器的位置。
CLASS_OUTPUT
          新的类文件的位置。
CLASS_PATH
          搜索用户类文件的位置。
PLATFORM_CLASS_PATH
          搜索平台类的位置。
SOURCE_OUTPUT
          新的源文件的位置。
SOURCE_PATH
          搜索现有源文件的位置。
 
方法摘要
 String getName()
          获取此位置的名称。
 boolean isOutputLocation()
          确定此位置是否为输出位置。
static JavaFileManager.Location locationFor(String name)
          使用给定名称获取位置对象。
static StandardLocation valueOf(String name)
          返回带有指定名称的该类型的枚举常量。
static StandardLocation[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
从类 java.lang.Enum 继承的方法
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
从类 java.lang.Object 继承的方法
getClass, notify, notifyAll, wait, wait, wait
 

枚举常量详细信息

CLASS_OUTPUT

public static final StandardLocation CLASS_OUTPUT
新的类文件的位置。


SOURCE_OUTPUT

public static final StandardLocation SOURCE_OUTPUT
新的源文件的位置。


CLASS_PATH

public static final StandardLocation CLASS_PATH
搜索用户类文件的位置。


SOURCE_PATH

public static final StandardLocation SOURCE_PATH
搜索现有源文件的位置。


ANNOTATION_PROCESSOR_PATH

public static final StandardLocation ANNOTATION_PROCESSOR_PATH
搜索注释处理器的位置。


PLATFORM_CLASS_PATH

public static final StandardLocation PLATFORM_CLASS_PATH
搜索平台类的位置。有时调用引导类路径。

方法详细信息

values

public static final StandardLocation[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for(StandardLocation c : StandardLocation.values())
        System.out.println(c);

返回:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static StandardLocation valueOf(String name)
返回带有指定名称的该类型的枚举常量。 字符串必须与用于声明该类型的枚举常量的 标识符完全匹配。(不允许有多余 的空格。)

参数:
指定要返回的枚举常量的名称。 -
返回:
返回带有指定名称的枚举常量
抛出:
如果该枚举类型没有带有指定名称的常量, - 则抛出 IllegalArgumentException

locationFor

public static JavaFileManager.Location locationFor(String name)
使用给定名称获取位置对象。必须保留以下属性:当且仅当 x.equals(y)locationFor(x) == locationFor(y)。当且仅当名称以 &quot;_OUTPUT&quot; 结束时,返回的位置将是一个输出位置。

参数:
name - 名称
返回:
位置

getName

public String getName()
从接口 JavaFileManager.Location 复制的描述
获取此位置的名称。

指定者:
接口 JavaFileManager.Location 中的 getName
返回:
名称

isOutputLocation

public boolean isOutputLocation()
从接口 JavaFileManager.Location 复制的描述
确定此位置是否为输出位置。输出位置是指按照惯例用于输出的位置。

指定者:
接口 JavaFileManager.Location 中的 isOutputLocation
返回:
如果此位置是输出位置,则返回 true;否则返回 false

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java 2 SDK SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策