home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
VCAFE.3.0A
/
Main.bin
/
InvalidPersistentAttributeException.java
< prev
next >
Wrap
Text File
|
1998-10-25
|
2KB
|
65 lines
/*
* Copyright 1998 Symantec Corporation, All Rights Reserved.
*/
package com.symantec.itools.vcafe.openapi;
/**
* Indicates the setting or getting of persistent <code>Attributes</code> which can't be properly streamed
* in or out. This can happen if the attribute doesn't properly implement java.io.Serializable, for example.
*
* @see Attributes#getPersistentAttributeValue
* @see Attributes#setPersistentAttributeValue
*
* @author Symantec Internet Tools Division
* @version 1.0
* @since VCafe 3.0
*/
public class InvalidPersistentAttributeException extends RuntimeException
{
/**
* Constructs an InvalidPersistentAttributeException that encapsulates the original
* Exception that occurred when trying to set or get the persistent attribute.
* @param owner The Class that conceptually owns this attribute/value (cannot be null).
* @param attributeName The locale-independent name of the attribute.
* @param exc The original problem exception.
*/
public InvalidPersistentAttributeException(Class owner, String attributeName, Exception exc) {
super(owner.getName() + "[" + attributeName + "]");
this.owner = owner;
this.attributeName = attributeName;
originalException = exc;
}
/**
* Gets a <code>String</code> that represents this object. This <code>String</code> includes the stack trace
* of the original Exception that triggered this InvalidPersistentAttributeException.
*
* @return the <code>String</code>
*/
public String toString() {
java.io.StringWriter sw = new java.io.StringWriter();
java.io.PrintWriter pw = new java.io.PrintWriter(sw);
pw.println(super.toString());
originalException.printStackTrace(pw);
return sw.toString();
}
/**
* The Class that conceptually owns the attribute that triggered the Exception
*/
private Class owner;
/**
* The locale-independent name of the attribute that triggered the Exception
*/
private String attributeName;
/**
* The actual Exception that occurred when trying to set or get the persistent attribute
*/
private Exception originalException;
}