org.apache.commons.attributes
Class InvalidAttributeTargetError

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Error
          extended byorg.apache.commons.attributes.InvalidAttributeTargetError
All Implemented Interfaces:
java.io.Serializable

public class InvalidAttributeTargetError
extends java.lang.Error

Thrown when an attribute has a 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;
 }
 

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.lang.Error
 
Fields inherited from class java.lang.Throwable
 
Constructor Summary
InvalidAttributeTargetError(java.lang.String attributeClass, java.lang.String element, int targetFlags)
           
 
Method Summary
private static java.lang.String flagsToString(int flags)
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InvalidAttributeTargetError

public InvalidAttributeTargetError(java.lang.String attributeClass,
                                   java.lang.String element,
                                   int targetFlags)
Method Detail

flagsToString

private static final java.lang.String flagsToString(int flags)