@Documented @Target(value=CONSTRUCTOR) @Retention(value=RUNTIME) public @interface ConstructorProperties
注释在构造函数说明构造函数的对应构造的对象的getter方法的参数。例如:
public class Point {
@ConstructorProperties({"x", "y"})
public Point(int x, int y) {
this.x = x;
this.y = y;
}
public int getX() {
return x;
}
public int getY() {
return y;
}
private final int x, y;
}
注释说明构造函数的第一个参数可以用
getX()方法检索与
getY()方法二。由于参数名不一般可在运行时,没有注释,就没有办法知道参数对应于
getX()和
getY()或其他方式。
public abstract String[] value
吸气剂的名字。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.