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:
Serializable

public class InvalidAttributeTargetError
extends 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;
 }
 

Since:
2.1
See Also:
Serialized Form

Constructor Summary
InvalidAttributeTargetError(String attributeClass, String element, int targetFlags)
          Creates a new InvalidAttributeTargetError.
 
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(String attributeClass,
                                   String element,
                                   int targetFlags)
Creates a new InvalidAttributeTargetError.

Parameters:
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.
Since:
2.1


Copyright © The Apache Software Foundation. All Rights Reserved.