public class InvalidAttributeTargetError
extends java.lang.Error
Target declaration that forbids
it being applied to the program element it has been applied to.
For example:
/**
* This attribute can only be applied to Classes.
* Target(Target.CLASS)
*/
public class MyAttribute {}
public class MyClass {
/**
* Error: Can't apply MyAttribute to a field!
* @@MyAttribute()
*/
private String myField;
}
| Constructor and Description |
|---|
InvalidAttributeTargetError(java.lang.String attributeClass,
java.lang.String element,
int targetFlags)
Creates a new InvalidAttributeTargetError.
|
| Modifier and Type | Method and Description |
|---|---|
private static java.lang.String |
flagsToString(int flags) |
public InvalidAttributeTargetError(java.lang.String attributeClass,
java.lang.String element,
int targetFlags)
attributeClass - name of the type of the attribute that was applied to the wrong target.element - the element that the user tried to apply the attribute to.targetFlags - the targets (bitwise OR of the Target.XXX flags that the attributeClass
can be applied to.