Homepage

org.tinymarbles.exception
Class IllegalAttributeDefinitionException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by java.lang.IllegalArgumentException
                  extended by org.tinymarbles.exception.AttributeException
                      extended by org.tinymarbles.exception.IllegalAttributeDefinitionException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
TypeMismatchException, ValueConstructionException

public class IllegalAttributeDefinitionException
extends AttributeException

This Exception occurs when the client application tries to define an attribute using invalid parameters. For more details, see the documentation of PAttribute

Author:
duke
See Also:
throwIfNotConcretePublic(String, Class), throwIfNotPValue(String, Class), throwIfNull(String, Class), Serialized Form

Constructor Summary
  IllegalAttributeDefinitionException(String message, String name, Class valueClass, int modifiers, boolean pValueSubclass)
          Constructor without a cause
protected IllegalAttributeDefinitionException(String message, Throwable cause, String name, Class valueClass, int modifiers, boolean pValueSubclass)
          Full Constructor for the exception
 
Method Summary
 int getModifiers()
          Gets the class modifiers from reflection.
 Class getValueClass()
          Gets the value class of the attribute definition
 boolean isPersistentValue()
          Asks if the value class is a subclass of PValue
static void throwIfNotConcretePublic(String name, Class valueClass)
          Throws an exception if the value class is not concrete and public.
static void throwIfNotPValue(String name, Class valueClass)
           
static void throwIfNull(String name, Class valueClass)
           
static void throwIfReserved(String name, Class valueClass)
           
 
Methods inherited from class org.tinymarbles.exception.AttributeException
getAttributeName
 
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

IllegalAttributeDefinitionException

protected IllegalAttributeDefinitionException(String message,
                                              Throwable cause,
                                              String name,
                                              Class valueClass,
                                              int modifiers,
                                              boolean pValueSubclass)
Full Constructor for the exception

Parameters:
message - the exception message
cause - an underlying cause, if it exists
name - the name of the attribute
valueClass - the value class of the attribute
modifiers - class modifiers for the value class
pValueSubclass - when false, means that the definition provided a value class that is not a subclass of PValue

IllegalAttributeDefinitionException

public IllegalAttributeDefinitionException(String message,
                                           String name,
                                           Class valueClass,
                                           int modifiers,
                                           boolean pValueSubclass)
Constructor without a cause

Parameters:
message - the exception message
name - the name of the attribute
valueClass - the value class of the attribute
modifiers - class modifiers for the value class
pValueSubclass - when false, means that the definition provided a value class that is not a subclass of PValue
Method Detail

getValueClass

public Class getValueClass()
Gets the value class of the attribute definition

Returns:
the value class

getModifiers

public int getModifiers()
Gets the class modifiers from reflection.

Returns:
the modifiers, or 0 (zero) if unknown.

isPersistentValue

public boolean isPersistentValue()
Asks if the value class is a subclass of PValue

Returns:
true when the class is a subclass of pvalue, false otherwise.
See Also:
PValue

throwIfNotConcretePublic

public static void throwIfNotConcretePublic(String name,
                                            Class valueClass)
                                     throws IllegalAttributeDefinitionException
Throws an exception if the value class is not concrete and public.

Parameters:
name - the declared name for the attribute
valueClass - the class of the persistent value object
Throws:
IllegalAttributeDefinitionException

throwIfNotPValue

public static void throwIfNotPValue(String name,
                                    Class valueClass)
Parameters:
name - the declared name for the attribute
valueClass - the class of the persistent value object

throwIfNull

public static void throwIfNull(String name,
                               Class valueClass)
Parameters:
name - the declared name for the attribute
valueClass - the class of the persistent value object

throwIfReserved

public static void throwIfReserved(String name,
                                   Class valueClass)
Parameters:
name - the declared name for the attribute
valueClass - the class of the persistent value object

Homepage