wt.util
Class WTException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bywt.util.WTException
All Implemented Interfaces:
LocalizableMessage, Message, Serializable
Direct Known Subclasses:
AccessControlException, ACException, ActionClassNotAnActionException, ActionDoesNotExistException, AddConstraints.ExecutionException, AddConstraintsException, AddConstraintsTestException, AdministrativeDomainException, AlreadyCheckedOutException, ApplicabilityModelException, AttributeTranslationException, BadWorklistException, CalendarException, CannotDeleteBaselineMemberException, ChangeException2, CheckedOutByOtherException, CheckedOutObjectsError, CheckInOutException, CoConfigException, CoConfigHelper_ComputeAttribute.CanNotComputeEnvVarStaticallyException, CoDcaException, CoElementNotFoundException, CollectionContainsDeletedException, CollectionContainsStaleException, ColumnAlreadyExistsException, ColumnDoesNotExistException, CommandException, CompareSchemaException, ConfigException, ConflictException, ConstraintException, ContentException, CounterPartConcurrentUpdateException, CounterPartLockUnlockException, CounterPartUninitializedDeltaException, CounterPartUploadBusyException, CounterPartUploadTimedOutException, CSMException, DCAGeneratorException, DeleteMasterSiteException, DependencyException, DeprecatedWebjectException, DirectiveExecutionException, DirectiveIOException, DisplayColumnAlreadyExistsException, DisplayColumnDoesNotExistException, DisplayItemAlreadyExistsException, DisplayItemDoesNotExistException, DropException, EffectivityException, EPMBaselineException, EPMDocumentException, EPMException, EPMNonoverridableConflicts.HasMainMessageException, EPMNonOverrideableConflictException, EPMStructureException, EPMSupportingDataException, ESIException, ESINoSuchTargetException, ESINoTargetAssignmentException, ESINoValidChangeableException, ESITargetAssignmentException, ExporterException, ExternalVCInterfaceException, FacadeException, FederationServicesException, FilterCriteriaAlreadyExistsException, FilterCriteriaDoesNotExistException, FolderException, FvException, GraphModelException, IAException, IBAException, IllegalContentException, IllegalFormatException, IncompatibleUnitsException, IndexingException, IndexPolicyException, InheritanceException, InvalidAlgorithmArgumentException, InvalidAttributeException, InvalidFilterCriteriaException, InvalidFunctionArgumentException, InvalidLinkException, InvalidNavigateSourceException, InvalidNodeException, InvalidRoleException, InvalidSortRuleException, InvalidTypeException, IUHException, IxbInapplicableActionException, IXBObjectNotFoundException, LifeCycleException, LineNumberUsageException, LinkAlreadyExistException, LinkDoesNotExistException, LockException, LogHelper.IxbException, LogicRepositoryException, ManagerException, MaturityException, MessagingException, ModificationNotAllowedException, MsProjectException, NmException, NodeAlreadyExistException, NodeDoesNotExistException, NoRulesToBuildException, NoSuchAttributeOnElementException, NoSuchDomElementException, NotCheckedOutException, NotificationException, ObjectGraphException, ObjectGraphServiceException, ObjectNoLongerExistsException, ObjectNotForLinkException, ObsoleteWebjectException, OccurrenceException, OrganizationServicesException, OwnershipException, PageContextException, ParameterizedStringException, PartException, PersistenceException, PreviewerException, ProjectException, ProjectManagementException, QMLException, QueryException, QueryException, QueryException, QueueException, RangeException, ReleaseIdException, ReleaseIdRangeException, ReplicaException, RepresentationException, RequirementException, ReviseException, RewindNotSupportedException, RouterException, RuleException, RunnerCanceledException, SandboxException, SchedulerException, SeriesException, SignatureInvalidException, SiteExistsException, SortRuleAlreadyExistsException, SortRuleDoesNotExistException, SQLScriptExecutor.ExecutionException, StandardNmInteropService.IllegalOrMissingDataException, StringLimitException, SubsumeLinksBuildException, TableDataAlreadyExistsException, TableDataDoesNotExistException, TaskDelegateException, TeamException, TransferException, UfidException, UnableToLoadServiceProperties, UnitFormatException, UpdateExecutionException, UpdateRunnerException, UpdateStoreException, UpgradeContextException, UpgradeSchema.ExecutionException, UpgradeSchemaException, URLExistsException, URLProcessorException, UwgmErrorException, UwgmTaskException, VersionControlException, ViewException, ViewMarkUpException, WebjectServiceException, WfException, WorkInProgressException, WTArchiveSystemException, WTContainerException, WTContentHolderException, WTDeliveryException, WTExplorerPartialResultException, WTIntrospectionException, WTNumberFormatException, WTReplicationException, WTResourceException, WTTransportException, XMLMechanismException, XPathException

public class WTException
extends Exception
implements LocalizableMessage

WTException is the base class for Windchill exceptions.

WTExecption is an exception that:

The following is an example of how a method would construct a WTException:
    try {
       doSomething(obj);
    }
    catch (Exception e) {
       Object[] param = { toString(), obj.getConceptualClassname() };
       throw new WTException(e, RESOURCE, "17", param);
    }
 
Localization of the WTException messages relies on the resource bundle and text formatting features of Java. In the example above, RESOURCE is a string constant that identifies the resource bundle containing the localizable message for the exception.



Supported API: true

Extendable: true

See Also:
ResourceBundle, MessageFormat, Serialized Form

Field Summary
private  Object[] additionalMessages
           
private static String CLASSNAME
           
static String GETMESSAGE_LINE_SEPARATOR
           
static String LINE_SEPARATOR
           
private  WTMessage message
           
private  Throwable nestedThrowable
           
private static String RESOURCE
           
static String SPACE_SEPARATOR
           
static String TOSTRING_LINE_SEPARATOR
           
private static boolean VERBOSE_CONSTRUCTOR
           
 
Fields inherited from class java.lang.Exception
 
Fields inherited from class java.lang.Throwable
 
Constructor Summary
WTException()
          Constructs a Windchill exception with no specified detailed message or embedded throwable object.
WTException(Object[] additionalMessages)
          Constructs a Windchill exception with additional messages only.
WTException(String s)
          Constructs a Windchill exception with a non-localizable detailed message.
WTException(String s, Object[] additionalMessages)
          Constructs a Windchill exception with a non-localizable standard message and additional messages.
WTException(String rb, String key, Object[] params)
          Constructs a Windchill exception with a localizable standard message constructed from the bundle, key, and params.
WTException(String rb, String key, Object[] params, Object[] additionalMessages)
          Constructs a Windchill exception with a localizable standard message constructed from the bundle, key, and params.
WTException(Throwable t)
          Constructs a Windchill exception with a nested throwable.
WTException(Throwable t, Object[] additionalMessages)
          Constructs a Windchill exception with a nested throwable and additional messages.
WTException(Throwable t, String s)
          Constructs a Windchill exception with an embedded Throwable object and non-localizable detailed message.
WTException(Throwable t, String s, Object[] additionalMessages)
          Constructs a Windchill exception with an embedded Throwable object, a non-localizable detailed message, and additional messages.
WTException(Throwable t, String rb, String key, Object[] params)
          Constructs a Windchill exception with an embedded Throwable object and a localizable detailed message.
WTException(Throwable t, String rb, String key, Object[] params, Object[] additionalMessages)
          Constructs a Windchill exception with an embedded Throwable object, a localizable detailed message, and additional messages.
WTException(Throwable t, WTMessage message)
          Constructs a Windchill exception with a nested throwable and message.
WTException(Throwable t, WTMessage message, Object[] additionalMessages)
          Constructs a Windchill exception with a nested throwable, message, and additional messages.
WTException(WTMessage message)
          Constructs a Windchill exception given the passed-in message.
WTException(WTMessage message, Object[] additionalMessages)
          Constructs a Windchill exception with a standard message and additional messages.
 
Method Summary
private  void constructorTrace()
           
 Object[] getAdditionalMessageArray()
          Returns the raw "additional" messages object array.
 String getAdditionalMessages()
          Returns the localized "additional" messages.
 String getAdditionalMessages(Locale locale)
          Returns the localized "additional" messages.
 String getLocalizedMessage()
          Returns the localized message, including nested exception.
 String getLocalizedMessage(boolean nested)
          Returns the localized message, optionally including nested exception.
 String getLocalizedMessage(Locale locale)
          Obtain a message, localized to the specified locale.
 String getLocalizedMessage(Locale locale, boolean nested)
          Returns the localized message, for the specified locale, optionally including nested exception.
static String getNestedExceptionString(String msg)
          Returns the localized form of a "nested exception is" string.
static String getNestedExceptionString(String msg, Locale locale)
          Returns the localized form of a "nested exception is" string.
 Throwable getNestedThrowable()
          Returns the embedded throwable object.
 String getStandardMessage()
          Returns the localized "standard" message.
 String getStandardMessage(Locale locale)
          Returns the localized "standard" message using the given locale.
 void printStackTrace()
          Prints this WTException and the backtrace of its most deeply nested embedded Throwable to the standard error stream.
 void printStackTrace(PrintStream s)
          Prints this WTException and the backtrace of its most deeply nested embedded Throwable to the specified print stream.
 void printStackTrace(PrintWriter s)
          Prints this WTException and the backtrace of its most deeply nested embedded Throwable to the specified print writer.
protected  void setLocalizedMessage(String rb, String key, Object[] params)
          Sets the localized message for this WTException.
 String toString()
          Returns a description of this WTException.
 String toString(boolean nested)
          Returns a description of this WTException.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getMessage, getStackTrace, initCause, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

message

private WTMessage message

nestedThrowable

private Throwable nestedThrowable

VERBOSE_CONSTRUCTOR

private static final boolean VERBOSE_CONSTRUCTOR

LINE_SEPARATOR

public static final String LINE_SEPARATOR

SPACE_SEPARATOR

public static String SPACE_SEPARATOR

GETMESSAGE_LINE_SEPARATOR

public static String GETMESSAGE_LINE_SEPARATOR

TOSTRING_LINE_SEPARATOR

public static String TOSTRING_LINE_SEPARATOR

additionalMessages

private Object[] additionalMessages
Constructor Detail

WTException

public WTException()
Constructs a Windchill exception with no specified detailed message or embedded throwable object.

Supported API: true


WTException

public WTException(WTMessage message)
Constructs a Windchill exception given the passed-in message.

Supported API: true

Parameters:
message - the message

WTException

public WTException(Object[] additionalMessages)
Constructs a Windchill exception with additional messages only.

Supported API: true

Parameters:
additionalMessages - the array of additional messages

WTException

public WTException(WTMessage message,
                   Object[] additionalMessages)
Constructs a Windchill exception with a standard message and additional messages.

Supported API: true

Parameters:
message - the standard message
additionalMessages - the array of additional messages

WTException

public WTException(String s)
Constructs a Windchill exception with a non-localizable detailed message.

Supported API: true

Parameters:
s - the detailed message

WTException

public WTException(String s,
                   Object[] additionalMessages)
Constructs a Windchill exception with a non-localizable standard message and additional messages.

Supported API: true

Parameters:
s - the standard message
additionalMessages - the array of additional messages

WTException

public WTException(String rb,
                   String key,
                   Object[] params)
Constructs a Windchill exception with a localizable standard message constructed from the bundle, key, and params.

Supported API: true

Parameters:
rb - the resoure bundle the key resides in
key - the key containing the message in the resource bundle
params - the parameters to substitute in the message

WTException

public WTException(String rb,
                   String key,
                   Object[] params,
                   Object[] additionalMessages)
Constructs a Windchill exception with a localizable standard message constructed from the bundle, key, and params.

Supported API: true

Parameters:
rb - the resoure bundle the key resides in
key - the key containing the message in the resource bundle
params - the parameters to substitute in the message
additionalMessages - the array of additional messages

WTException

public WTException(Throwable t)
Constructs a Windchill exception with a nested throwable.

Supported API: true

Parameters:
t - the nested throwable

WTException

public WTException(Throwable t,
                   WTMessage message)
Constructs a Windchill exception with a nested throwable and message.

Supported API: true

Parameters:
t - the nested throwable
message - the message

WTException

public WTException(Throwable t,
                   Object[] additionalMessages)
Constructs a Windchill exception with a nested throwable and additional messages.

Supported API: true

Parameters:
t - the nested throwable
additionalMessages - the array of additional messages

WTException

public WTException(Throwable t,
                   WTMessage message,
                   Object[] additionalMessages)
Constructs a Windchill exception with a nested throwable, message, and additional messages.

Supported API: true

Parameters:
t - the nested throwable
message - the message
additionalMessages - the array of additional messages

WTException

public WTException(Throwable t,
                   String s)
Constructs a Windchill exception with an embedded Throwable object and non-localizable detailed message.

Supported API: true

Parameters:
t - the embedded Throwable. It may be null.
s - the detailed message. It may be null.

WTException

public WTException(Throwable t,
                   String s,
                   Object[] additionalMessages)
Constructs a Windchill exception with an embedded Throwable object, a non-localizable detailed message, and additional messages.

Supported API: true

Parameters:
t - the embedded Throwable. It may be null.
s - the detailed message. It may be null.
additionalMessages - the array of additional messages. It may be null.

WTException

public WTException(Throwable t,
                   String rb,
                   String key,
                   Object[] params)
Constructs a Windchill exception with an embedded Throwable object and a localizable detailed message.

Supported API: true

Parameters:
t - the embedded Throwable. It may be null.
rb - the name of the base resource bundle subclass containing the localizable message.
key - the key associated with the localizable message
params - an optional set of objects to be formatted into the localizable message text.
See Also:
ResourceBundle, MessageFormat

WTException

public WTException(Throwable t,
                   String rb,
                   String key,
                   Object[] params,
                   Object[] additionalMessages)
Constructs a Windchill exception with an embedded Throwable object, a localizable detailed message, and additional messages.

Supported API: true

Parameters:
t - the embedded Throwable. It may be null.
rb - the name of the base resource bundle subclass containing the localizable message.
key - the key associated with the localizable message
params - an optional set of objects to be formatted into the localizable message text.
additionalMessages - the array of additional messages. It may be null.
See Also:
ResourceBundle, MessageFormat
Method Detail

getNestedThrowable

public Throwable getNestedThrowable()
Returns the embedded throwable object.

Supported API: true


getLocalizedMessage

public String getLocalizedMessage(Locale locale)
Obtain a message, localized to the specified locale.

Supported API: true

Specified by:
getLocalizedMessage in interface LocalizableMessage
Parameters:
locale -
Returns:
String

constructorTrace

private void constructorTrace()

getLocalizedMessage

public String getLocalizedMessage()
Returns the localized message, including nested exception.

Supported API: true


getLocalizedMessage

public String getLocalizedMessage(Locale locale,
                                  boolean nested)
Returns the localized message, for the specified locale, optionally including nested exception.

Supported API: true

Parameters:
nested - include nested exceptions in message

getLocalizedMessage

public String getLocalizedMessage(boolean nested)
Returns the localized message, optionally including nested exception.

Supported API: true

Parameters:
nested - include nested exceptions in message

getNestedExceptionString

public static String getNestedExceptionString(String msg,
                                              Locale locale)
Returns the localized form of a "nested exception is" string. The format of the returned string is based on the last character of the message to which this string will be appended.

Supported API: true

Parameters:
msg - current message
locale - Locale to use

getNestedExceptionString

public static String getNestedExceptionString(String msg)
Returns the localized form of a "nested exception is" string. The format of the returned string is based on the last character of the message to which this string will be appended.

Supported API: true

Parameters:
msg - current message

printStackTrace

public void printStackTrace()
Prints this WTException and the backtrace of its most deeply nested embedded Throwable to the standard error stream.

Supported API: true


printStackTrace

public void printStackTrace(PrintStream s)
Prints this WTException and the backtrace of its most deeply nested embedded Throwable to the specified print stream.

Supported API: true


printStackTrace

public void printStackTrace(PrintWriter s)
Prints this WTException and the backtrace of its most deeply nested embedded Throwable to the specified print writer.

Supported API: true


setLocalizedMessage

protected void setLocalizedMessage(String rb,
                                   String key,
                                   Object[] params)
Sets the localized message for this WTException.

Parameters:
rb - the name of the base resource bundle subclass containing the localizable message.
key - the key associated with the localizable message
params - an optional set of objects to be formatted into the localizable message text.

Supported API: true
See Also:
ResourceBundle, MessageFormat

toString

public String toString()
Returns a description of this WTException. The description includes the descriptions of the nested throwable objects that are embedded within this WTException.

Supported API: true


toString

public String toString(boolean nested)
Returns a description of this WTException. The description optionally includes the descriptions of the nested throwable objects that are embedded within this WTException.

Supported API: true

Parameters:
nested - include nested exceptions in message

getStandardMessage

public String getStandardMessage()
Returns the localized "standard" message. The standard message is the string or localized message passed during the construction of this object.

Supported API: true


getStandardMessage

public String getStandardMessage(Locale locale)
Returns the localized "standard" message using the given locale. The standard message is the string or localized message passed during the construction of this object.

Supported API: true

Parameters:
locale - the locale to apply when localizing the standard message

getAdditionalMessageArray

public Object[] getAdditionalMessageArray()
Returns the raw "additional" messages object array. This is the array of objects passed during the construction of this object.

Supported API: true


getAdditionalMessages

public String getAdditionalMessages()
Returns the localized "additional" messages. The additional messages consist of the array of objects passed during the construction of this object. Each object in the array is localized and each localized result is separated from the other by a newline.

Supported API: true


getAdditionalMessages

public String getAdditionalMessages(Locale locale)
Returns the localized "additional" messages. The additional messages consist of the array of objects passed during the construction of this object. Each object in the array is localized and each localized result is separated from the other by a newline.

Supported API: true

Parameters:
locale - the locale to apply when localizing the standard message