Gary D. Gregory 2003-08-21 05:35:23 +00:00
parent 4e3962a6e4
commit 8b34e1dffc
3 changed files with 19 additions and 3 deletions

View File

@ -80,8 +80,9 @@ import java.io.Serializable;
* @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a> * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
* @author Stephen Colebourne * @author Stephen Colebourne
* @author Jeff Varszegi * @author Jeff Varszegi
* @author Gary Gregory
* @since 1.0 * @since 1.0
* @version $Id: SerializationUtils.java,v 1.10 2003/08/18 02:22:23 bayard Exp $ * @version $Id: SerializationUtils.java,v 1.11 2003/08/21 05:35:23 ggregory Exp $
*/ */
public class SerializationUtils { public class SerializationUtils {
@ -91,6 +92,7 @@ public class SerializationUtils {
* *
* <p>This constructor is public to permit tools that require a JavaBean instance * <p>This constructor is public to permit tools that require a JavaBean instance
* to operate.</p> * to operate.</p>
* @since 2.0
*/ */
public SerializationUtils() { public SerializationUtils() {
super(); super();

View File

@ -63,13 +63,15 @@ import java.util.Map;
* @see Enum * @see Enum
* @see ValuedEnum * @see ValuedEnum
* @author Stephen Colebourne * @author Stephen Colebourne
* @author Gary Gregory
* @since 1.0 * @since 1.0
* @version $Id: EnumUtils.java,v 1.9 2003/08/18 02:22:24 bayard Exp $ * @version $Id: EnumUtils.java,v 1.10 2003/08/21 05:29:08 ggregory Exp $
*/ */
public class EnumUtils { public class EnumUtils {
/** /**
* Public constructor. This class should not normally be instantiated. * Public constructor. This class should not normally be instantiated.
* @since 2.0
*/ */
public EnumUtils() { public EnumUtils() {
} }

View File

@ -79,7 +79,7 @@ import java.util.List;
* @author Sean C. Sullivan * @author Sean C. Sullivan
* @author Stephen Colebourne * @author Stephen Colebourne
* @since 1.0 * @since 1.0
* @version $Id: NestableDelegate.java,v 1.18 2003/08/18 02:22:24 bayard Exp $ * @version $Id: NestableDelegate.java,v 1.19 2003/08/21 05:33:10 ggregory Exp $
*/ */
public class NestableDelegate implements Serializable { public class NestableDelegate implements Serializable {
@ -100,12 +100,14 @@ public class NestableDelegate implements Serializable {
/** /**
* Whether to print the stack trace top-down. * Whether to print the stack trace top-down.
* This public flag may be set by calling code, typically in initialisation. * This public flag may be set by calling code, typically in initialisation.
* @since 2.0
*/ */
public static boolean topDown = true; public static boolean topDown = true;
/** /**
* Whether to trim the repeated stack trace. * Whether to trim the repeated stack trace.
* This public flag may be set by calling code, typically in initialisation. * This public flag may be set by calling code, typically in initialisation.
* @since 2.0
*/ */
public static boolean trimStackFrames = true; public static boolean trimStackFrames = true;
@ -115,6 +117,7 @@ public class NestableDelegate implements Serializable {
* *
* @param nestable the Nestable implementation (<i>must</i> extend * @param nestable the Nestable implementation (<i>must</i> extend
* {@link java.lang.Throwable}) * {@link java.lang.Throwable})
* @since 2.0
*/ */
public NestableDelegate(Nestable nestable) { public NestableDelegate(Nestable nestable) {
if (nestable instanceof Throwable) { if (nestable instanceof Throwable) {
@ -135,6 +138,7 @@ public class NestableDelegate implements Serializable {
* @throws IndexOutOfBoundsException if the <code>index</code> argument is * @throws IndexOutOfBoundsException if the <code>index</code> argument is
* negative or not less than the count of <code>Throwable</code>s in the * negative or not less than the count of <code>Throwable</code>s in the
* chain * chain
* @since 2.0
*/ */
public String getMessage(int index) { public String getMessage(int index) {
Throwable t = this.getThrowable(index); Throwable t = this.getThrowable(index);
@ -156,6 +160,7 @@ public class NestableDelegate implements Serializable {
* java.lang.Throwable}. * java.lang.Throwable}.
* @return The concatenated message for this and all nested * @return The concatenated message for this and all nested
* <code>Throwable</code>s * <code>Throwable</code>s
* @since 2.0
*/ */
public String getMessage(String baseMsg) { public String getMessage(String baseMsg) {
StringBuffer msg = new StringBuffer(); StringBuffer msg = new StringBuffer();
@ -186,6 +191,7 @@ public class NestableDelegate implements Serializable {
* operation. * operation.
* *
* @return the error messages * @return the error messages
* @since 2.0
*/ */
public String[] getMessages() { public String[] getMessages() {
Throwable[] throwables = this.getThrowables(); Throwable[] throwables = this.getThrowables();
@ -209,6 +215,7 @@ public class NestableDelegate implements Serializable {
* @throws IndexOutOfBoundsException if the <code>index</code> argument is * @throws IndexOutOfBoundsException if the <code>index</code> argument is
* negative or not less than the count of <code>Throwable</code>s in the * negative or not less than the count of <code>Throwable</code>s in the
* chain * chain
* @since 2.0
*/ */
public Throwable getThrowable(int index) { public Throwable getThrowable(int index) {
if (index == 0) { if (index == 0) {
@ -223,6 +230,7 @@ public class NestableDelegate implements Serializable {
* <code>Nestable</code> contained by this delegate. * <code>Nestable</code> contained by this delegate.
* *
* @return the throwable count * @return the throwable count
* @since 2.0
*/ */
public int getThrowableCount() { public int getThrowableCount() {
return ExceptionUtils.getThrowableCount(this.nestable); return ExceptionUtils.getThrowableCount(this.nestable);
@ -234,6 +242,7 @@ public class NestableDelegate implements Serializable {
* element for each <code>Throwable</code>. * element for each <code>Throwable</code>.
* *
* @return the <code>Throwable</code>s * @return the <code>Throwable</code>s
* @since 2.0
*/ */
public Throwable[] getThrowables() { public Throwable[] getThrowables() {
return ExceptionUtils.getThrowables(this.nestable); return ExceptionUtils.getThrowables(this.nestable);
@ -253,6 +262,7 @@ public class NestableDelegate implements Serializable {
* @throws IndexOutOfBoundsException if the <code>fromIndex</code> argument * @throws IndexOutOfBoundsException if the <code>fromIndex</code> argument
* is negative or not less than the count of <code>Throwable</code>s in the * is negative or not less than the count of <code>Throwable</code>s in the
* chain * chain
* @since 2.0
*/ */
public int indexOfThrowable(Class type, int fromIndex) { public int indexOfThrowable(Class type, int fromIndex) {
if (fromIndex < 0) { if (fromIndex < 0) {
@ -355,6 +365,7 @@ public class NestableDelegate implements Serializable {
* *
* @param t The <code>Throwable</code>. * @param t The <code>Throwable</code>.
* @return An array of strings describing each stack frame. * @return An array of strings describing each stack frame.
* @since 2.0
*/ */
protected String[] getStackFrames(Throwable t) { protected String[] getStackFrames(Throwable t) {
StringWriter sw = new StringWriter(); StringWriter sw = new StringWriter();
@ -375,6 +386,7 @@ public class NestableDelegate implements Serializable {
* one just on top. * one just on top.
* *
* @param stacks The list containing String[] elements * @param stacks The list containing String[] elements
* @since 2.0
*/ */
protected void trimStackFrames(List stacks) { protected void trimStackFrames(List stacks) {
for (int size=stacks.size(), i=size-1; i > 0; i--) { for (int size=stacks.size(), i=size-1; i > 0; i--) {