javax.xml.bind
Class TypeConstraintException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by javax.xml.bind.TypeConstraintException
All Implemented Interfaces:
java.io.Serializable

public class TypeConstraintException
extends java.lang.RuntimeException

This is a runtime exception. The desired use is for generated set methods which would like to indicate that the specified value is invalid, for example, because a facet restriction wasn't met.

If a generated setter throws a TypeConstraintException, then it is the JAXB providers task to ensure, that the object, on which the setter is invoked, remains unchanged.

Since:
JAXB1.0
Author:
JSR-31
See Also:
Serialized Form

Constructor Summary
TypeConstraintException(java.lang.String pMessage)
          Creates a new TypeConstraintException with the specified detail message.
TypeConstraintException(java.lang.String pMessage, java.lang.String pErrorCode)
          Creates a new TypeConstraintException with the specified detail message and vendor specific error code.
TypeConstraintException(java.lang.String pMessage, java.lang.String pErrorCode, java.lang.Throwable pLinkedException)
          Creates a new TypeConstraintException with the specified detail message, error code, and linked exception.
TypeConstraintException(java.lang.String pMessage, java.lang.Throwable pLinkedException)
          Creates a new TypeConstraintException with the specified detail message and linked exception.
TypeConstraintException(java.lang.Throwable pLinkedException)
          Creates a new TypeConstraintException with the specified linked exception.
 
Method Summary
 java.lang.String getErrorCode()
          Returns the vendor specific error code, if any, or null.
 java.lang.Throwable getLinkedException()
          Returns the linked exception, if any, or null.
 void setLinkedException(java.lang.Throwable pLinkedException)
          Sets the linked exception.
 java.lang.String toString()
          Converts the linked exception into a String.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TypeConstraintException

public TypeConstraintException(java.lang.String pMessage)

Creates a new TypeConstraintException with the specified detail message.

Parameters:
pMessage - The detail message.

TypeConstraintException

public TypeConstraintException(java.lang.String pMessage,
                               java.lang.String pErrorCode)

Creates a new TypeConstraintException with the specified detail message and vendor specific error code.

Parameters:
pMessage - The detail message.
pErrorCode - The error code.

TypeConstraintException

public TypeConstraintException(java.lang.Throwable pLinkedException)

Creates a new TypeConstraintException with the specified linked exception.

Parameters:
pLinkedException - The linked exception.

TypeConstraintException

public TypeConstraintException(java.lang.String pMessage,
                               java.lang.Throwable pLinkedException)

Creates a new TypeConstraintException with the specified detail message and linked exception.

Parameters:
pMessage - The detail message.
pLinkedException - The linked exception.

TypeConstraintException

public TypeConstraintException(java.lang.String pMessage,
                               java.lang.String pErrorCode,
                               java.lang.Throwable pLinkedException)

Creates a new TypeConstraintException with the specified detail message, error code, and linked exception.

Parameters:
pMessage - The detail message.
pErrorCode - The vendor specific error code.
pLinkedException - The linked exception.
Method Detail

getErrorCode

public java.lang.String getErrorCode()

Returns the vendor specific error code, if any, or null.


getLinkedException

public java.lang.Throwable getLinkedException()

Returns the linked exception, if any, or null.


setLinkedException

public void setLinkedException(java.lang.Throwable pLinkedException)

Sets the linked exception.

Parameters:
pLinkedException - The linked exception or null.

toString

public java.lang.String toString()

Converts the linked exception into a String. Overridden, because the returned string should contain the vendor specific error code, if any.

Overrides:
toString in class java.lang.Throwable