Homepage

org.tinymarbles.exception
Class TypeMismatchException

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
                          extended by org.tinymarbles.exception.TypeMismatchException
All Implemented Interfaces:
Serializable

public class TypeMismatchException
extends IllegalAttributeDefinitionException

Indicates that an attribute definition cannot take place because an attribute with a different type is already declared for that PType.

Author:
duke
See Also:
PType.putAttribute(String, Class), Serialized Form

Constructor Summary
TypeMismatchException(PType type, String name, Class valueClass, Class existingClass)
          Calls the full constructor with an empty cause.
TypeMismatchException(Throwable cause, PType type, String name, Class valueClass, Class existingClass)
          Full constructor.
 
Method Summary
 Class getExistingClass()
          Gets the value class of the existing attribute.
 
Methods inherited from class org.tinymarbles.exception.IllegalAttributeDefinitionException
getModifiers, getValueClass, isPersistentValue, throwIfNotConcretePublic, throwIfNotPValue, throwIfNull, throwIfReserved
 
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

TypeMismatchException

public TypeMismatchException(PType type,
                             String name,
                             Class valueClass,
                             Class existingClass)
Calls the full constructor with an empty cause.

Parameters:
type -
name -
valueClass -
existingClass -

TypeMismatchException

public TypeMismatchException(Throwable cause,
                             PType type,
                             String name,
                             Class valueClass,
                             Class existingClass)
Full constructor.

Parameters:
cause - the underlying cause for this exception
type - the persistent type where the attribute definition failed
name - the name of the attribute
valueClass - the class of the failed definition
existingClass - the class of the existing attribute
Method Detail

getExistingClass

public Class getExistingClass()
Gets the value class of the existing attribute.

Returns:
the class of the existing attribute

Homepage