@Retention(value=SOURCE)
public @interface StringDef
This annotation is used within a StringPool
annotation to define
a single character string constant.
A character string constant can be defined in one of the two following ways:
@StringDef(name = "Hello", value = "Hello California!")
@StringDef(name = "S2", reference = "com.sun.jcclassic.samples.stringlib.LibStrings.Hello")
StringPool
Modifier and Type | Required Element and Description |
---|---|
java.lang.String |
name
The name of the defined string constant.
|
public abstract java.lang.String name
public abstract java.lang.String value
This attribute is exclusive of the reference()
attribute. The annotation
processor will fail with an error message if both the value()
and reference()
attributes are defined.
public abstract java.lang.String reference
This attribute is exclusive of the value()
attribute. The annotation
processor will fail with an error message if both the value()
and reference()
attributes are defined.
Copyright © 1998, 2015, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms