You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by hu...@apache.org on 2002/08/14 19:50:49 UTC
cvs commit: jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/lang Tokens.java TestData.java ResourceException.java PropertiesException.java PopulateException.java ParameterException.java Log.java Exceptions.java.save ChainedException.java BaseException.java
husted 2002/08/14 10:50:49
Added: scaffold/src/java/org/apache/commons/scaffold/lang
Tokens.java TestData.java ResourceException.java
PropertiesException.java PopulateException.java
ParameterException.java Log.java
Exceptions.java.save ChainedException.java
BaseException.java
Log:
[SCAFFOLD] New sandbox component
Revision Changes Path
1.1 jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/lang/Tokens.java
Index: Tokens.java
===================================================================
package org.apache.commons.scaffold.lang;
/**
* Language and programming tokens.
*
* @author Ted Husted
* @version $Revision: 1.1 $ $Date: 2002/08/14 17:50:49 $
*/
public final class Tokens {
/**
* The wild card character to represent a blank select.
*/
public static String PARAM_ANY = "*";
/**
* The equality indicator to represent name = value.
*/
public static String PARAM_EQUALS = " = ";
// ---------------------------------------------------- Attribute Keys
/**
* Default key for a result object.
*/
public static final String RESULT_KEY = "RESULT";
/**
* Default key for application properties.
*/
public static final String PROPERTIES_KEY = "PROPERTIES";
// ---------------------------------------- Error and exception phrases
public static final String ABSTRACT_EXCEPTION =
"Required method not implemented.";
public static final String INVALID_SCOPE =
" invalid scope.";
// --------------------------------------- Common Action Mapping tokens
public static final String CANCEL = "cancel";
public static final String CONTINUE = "continue";
public static final String DISPATCH = "dispatch";
public static final String DONE = "done";
public static final String EMPTY = "empty";
public static final String ERROR = "error";
public static final String EXIT = "exit";
public static final String FAILURE = "failure";
public static final String FORWARD = "forward";
public static final String GET_TOKEN = "getToken";
public static final String LOGON = "logon";
public static final String LOGOFF = "logoff";
public static final String MENU = "menu";
public static final String NEXT = "next";
public static final String PREVIOUS = "previous";
public static final String SET_TOKEN = "setToken";
public static final String SUCCESS = "success";
public static final String WELCOME = "welcome";
public static final String APPLICATION = "application";
public static final String RESULT = "result";
public static final String REQUEST = "request";
public static final String SESSION = "session";
public static final String PATH = "path";
public static final String OK = "ok";
// --------------------------------- Common Application Resource tokens
public static final String ERROR_GENERAL =
"error.general";
public static final String ERROR_DETAIL =
"error.detail";
public static final String ERROR_CANCEL =
"error.cancel";
public static final String ERROR_TOKEN =
"error.token";
public static final String HELPER_ACCESS_ERROR =
"data.access.error";
public static final String DATA_ACCESS_DENIED =
"data.access.denied";
public static final String DATA_ACCESS_ERROR =
"data.access.error";
public static final String DATA_ACCESS_EMPTY =
"data.access.empty"; // not found
public static final String DATA_RECORD_INSERTED =
"data.record.inserted";
public static final String DATA_RECORD_UPDATED =
"data.record.updated";
public static final String DATA_RECORD_DELETED =
"data.record.deleted";
public static final String DATA_RECORD_RESTORED =
"data.record.restored";
public static final String PROCESS_COMPLETE =
"process.complete";
// --------------------------------- Common Application Resource tokens
public static final String DATA_TRANSFER_ERROR =
"data.transfer.error";
public static final String PROCESS_MISSING_PARAMETER =
"process.missing.parameter";
// ------------------------------------------------------ Content types
/**
* Plain text MIME type. Good for XML.
*/
public static final String TEXT_PLAIN = "text/plain";
// ------------------------------------------------- Exception messages
/**
* Default message for throwing exception (en).
*/
public static final String ALLOCATE_KEY_EXCEPTION =
"Unable to allocate key.";
/**
* Default message for throwing exception (en).
*/
public static final String STORE_EXCEPTION =
"Unable to insert or update record.";
/**
* Default message for throwing exception (en).
*/
public static final String SELECT_EXCEPTION =
"Unable to retrieve record.";
/**
* Default message for throwing exception (en).
*/
public static final String INSERT_EXCEPTION =
"Unable to insert record.";
/**
* Default message for throwing exception (en).
*/
public static final String UPDATE_EXCEPTION =
"Unable to update record.";
/**
* Default message for throwing exception (en).
*/
public static final String NOT_IMPLEMENTED_EXCEPTION =
"Method not implemented.";
/**
* Default message for throwing exception (en).
*/
public static final String INVALID_QUERY_EXCEPTION =
"Query not processed; are parameters valid?";
/**
* Default message for throwing exception (en).
*/
public static final String DATA_ACCESS_EXCEPTION =
"Unable to access data.";
// end Tokens
}
/*
*
* Copyright (c) 2002 Synthis Corporation.
* 430 10th Street NW, Suite S-108, Atlanta GA 30318, U.S.A.
* All rights reserved.
*
* This software is licensed to you free of charge under
* the Apache Software License, so long as this copyright
* statement, list of conditions, and comments, remains
* in the source code. See bottom of file for more
* license information.
*
* This software was written to support code generation
* for the Apache Struts J2EE architecture by Synthis'
* visual application modeling tool Adalon.
*
* For more information on Adalon and Struts code
* generation please visit http://www.synthis.com
*
*/
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Scaffold", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
1.1 jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/lang/TestData.java
Index: TestData.java
===================================================================
package org.apache.commons.scaffold.lang;
/**
* Statics for use in test classes.
*/
public class TestData {
// ------------------------------------------------------------- Integers
/**
* Integers for fields with a count, 0..2.
*/
public final static Integer[] INTEGER_COUNT = {
new Integer(123),
new Integer(456),
new Integer(789)
};
/**
* Integers for fields with an id, 0..2.
*/
public final static Integer[] INTEGER_ID = {
new Integer(1),
new Integer(2),
new Integer(3)
};
// -------------------------------------------------------------- Strings
/**
* EmailAddress Format.
*/
public final static String[] EMAIL_ADDRESS = {
new String("aaaaa@aaaaa.com"),
new String("bbbbb@bbbbb.org"),
new String("ccccc@ccccc.net")
};
/**
* Short, 5-character strings, 0..2.
*/
public final static String[] STRING_5 = {
new String("aaaaa"),
new String("bbbbb"),
new String("ccccc")
};
/**
* Medium, 10-character strings, 0..2.
*/
public final static String[] STRING_10 = {
new String("aaaaaaaaaa"),
new String("bbbbbbbbbb"),
new String("cccccccccc")
};
/**
* Long, 20-character strings, 0..2.
*/
public final static String[] STRING_20 = {
new String("aaaaaaaaaaaaaaaaaaaa"),
new String("bbbbbbbbbbbbbbbbbbbb"),
new String("cccccccccccccccccccc")
};
// ---------------------------------------------------------------- Dates
/**
* Date type
*/
public final static String[] DATE = {
new String("2002-01-31"),
new String("2002-02-28"),
new String("2002-03-31")
};
} // end TestData
/*
*
* Copyright (c) 2002 Synthis Corporation.
* 430 10th Street NW, Suite S-108, Atlanta GA 30318, U.S.A.
* All rights reserved.
*
* This software is licensed to you free of charge under
* the Apache Software License, so long as this copyright
* statement, list of conditions, and comments, remains
* in the source code. See bottom of file for more
* license information.
*
* This software was written to support code generation
* for the Apache Struts J2EE architecture by Synthis'
* visual application modeling tool Adalon.
*
* For more information on Adalon and Struts code
* generation please visit http://www.synthis.com
*
*/
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Scaffold", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
1.1 jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/lang/ResourceException.java
Index: ResourceException.java
===================================================================
package org.apache.commons.scaffold.lang;
/**
* Exception for error accessing a resource needed for a model
* (index file, data file).
*
* @author Ted Husted
* @version $Revision: 1.1 $ $Date: 2002/08/14 17:50:49 $
*/
public class ResourceException extends BaseException {
public static final String MESSAGE =
"ResourceException: A required resource is not available.";
public ResourceException (String message) {
super (message);
}
public ResourceException (String message, Throwable cause) {
super (message, cause);
}
public ResourceException (Throwable cause) {
super (MESSAGE,cause);
}
public ResourceException () {
super (MESSAGE);
}
}
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Scaffold", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
1.1 jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/lang/PropertiesException.java
Index: PropertiesException.java
===================================================================
package org.apache.commons.scaffold.lang;
/**
* Exception for error populating object.
*
* @author Ted Husted
* @version $Revision: 1.1 $ $Date: 2002/08/14 17:50:49 $
*/
public class PropertiesException extends ResourceException {
public static final String MESSAGE =
"Unable to load properties file";
public PropertiesException (String message) {
super (message);
}
public PropertiesException (String message, Throwable cause) {
super (message, cause);
}
public PropertiesException (Throwable cause) {
super (MESSAGE,cause);
}
public PropertiesException () {
super (MESSAGE);
}
}
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Scaffold", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
1.1 jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/lang/PopulateException.java
Index: PopulateException.java
===================================================================
package org.apache.commons.scaffold.lang;
/**
* Exception for error populating object.
*
* @author Ted Husted
* @version $Revision: 1.1 $ $Date: 2002/08/14 17:50:49 $
*/
public class PopulateException extends BaseException {
public static final String MESSAGE =
"Unable to transfer data";
public PopulateException (String message) {
super (message);
}
public PopulateException (String message, Throwable cause) {
super (message, cause);
}
public PopulateException (Throwable cause) {
super (MESSAGE,cause);
}
public PopulateException () {
super (MESSAGE);
}
}
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Scaffold", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
1.1 jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/lang/ParameterException.java
Index: ParameterException.java
===================================================================
package org.apache.commons.scaffold.lang;
/**
* Exception for error accessing a resource needed for a model
* (index file, data file).
*
* @author Ted Husted
* @version $Revision: 1.1 $ $Date: 2002/08/14 17:50:49 $
*/
public class ParameterException extends BaseException {
public static final String MESSAGE =
"ParameterException: Required input is missing or invalid.";
public ParameterException (String message) {
super (message);
}
public ParameterException (String message, Throwable cause) {
super (message, cause);
}
public ParameterException (Throwable cause) {
super (MESSAGE,cause);
}
public ParameterException () {
super (MESSAGE);
}
}
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Scaffold", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
1.1 jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/lang/Log.java
Index: Log.java
===================================================================
package org.apache.commons.scaffold.lang;
/**
* Constants for use with logging.
*
* @author Ted Husted
* @version $Revision: 1.1 $ $Date: 2002/08/14 17:50:49 $
*/
public final class Log {
// --------------------------------------------------------- Log levels
/**
* An unexpected error; must log. This is the default level.
*/
public static final int ERROR = 0;
/**
* A milestone event that system administrators
* might find interesting, like a user logging in.
*/
public static final int VERBOSE = 1; // Helpful to sysadmins
/**
* A programming event that developers might find
* interesting, like an object being created.
*/
public static final int DEBUG = 2;
/**
* Token for setting the log level as a servlet init-param.
*/
public static final String LOG_LEVEL_PARAMETER = "debug";
/**
* Token for setting the digester log level as a servlet init-param.
*/
public static final String DIGESTER_LOG_PARAMETER = "detail";
// -------------------------------------------------------- Log Phrases
/**
* Partial string for assembling a message.
*/
public static final String CLASS =
"class: ";
/**
* Partial string for assembling a message.
*/
public static final String PATH =
"path: ";
/**
* Partial string for assembling a message.
*/
public static final String NAME =
"name: ";
/**
* Partial string for assembling a message.
*/
public static final String SPACE =
" ";
/**
* Partial string for assembling a message.
*/
public static final String NOT_FOUND =
"was not found ";
/**
* Error creating object
*/
public static final String CREATE_OBJECT_ERROR =
"*** ERROR creating object ";
/**
* Prefix for logging exceptions.
*/
public static final String ACTION_EXCEPTION =
"*** ACTION EXCEPTION: ";
/**
* Executing base logic.
*/
public static final String BASE_LOGIC_EXECUTING =
"Executing base logic ";
/**
* Parsing tokens.
*/
public static final String TOKENS_PARSING =
"Parsing tokens ";
/**
* Creating Helper.
*/
public static final String HELPER_CREATING =
"Creating Helper ";
/**
* Helper created.
*/
public static final String HELPER_CREATED =
"Helper created ";
/**
* Helper processing.
*/
public static final String HELPER_PROCESSING =
"Processing helper beans ";
/**
* Executing helpers.
*/
public static final String HELPER_EXECUTING =
"Executing helper beans ";
/**
* Populating helper
*/
public static final String HELPER_POPULATE =
"Populate helper bean ";
/**
* Checking outcome of helper
*/
public static final String HELPER_OUTCOME =
"Processing helper outcome ";
/**
* Bean helper
*/
public static final String PROCESS_BEAN_NULL_SCOPE =
"** ProcessAction: Process result indicates a null scope ";
/**
* Process action - Business method should not return null.
*/
public static final String PROCESS_RESULT_NULL =
"** ProcessAction: ProcessResult is NULL " ;
// ----------------------------------------------------- Public Methods
/**
* Convenience utility to send a line of text to default system.out
* console.
* Not recommended for use in production use.
* Simply calls <code>System.out.println</code>.
*
* @param text String to print
*/
public static void consoleln(String text) {
System.out.println(text);
} // end consoleln()
/**
* Convenience utility to send text to default system.out console.
* Not recommended for use in production use.
* Simply calls <code>System.out.println</code>.
*
* @param text String to print
*/
public static void console(String text) {
System.out.print(text);
} // end console()
// end Log
}
/*
*
* Copyright (c) 2002 Synthis Corporation.
* 430 10th Street NW, Suite S-108, Atlanta GA 30318, U.S.A.
* All rights reserved.
*
* This software is licensed to you free of charge under
* the Apache Software License, so long as this copyright
* statement, list of conditions, and comments, remains
* in the source code. See bottom of file for more
* license information.
*
* This software was written to support code generation
* for the Apache Struts J2EE architecture by Synthis'
* visual application modeling tool Adalon.
*
* For more information on Adalon and Struts code
* generation please visit http://www.synthis.com
*
*/
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Scaffold", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
1.1 jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/lang/Exceptions.java.save
Index: Exceptions.java.save
===================================================================
package org.apache.commons.scaffold.lang;
import java.util.ArrayList;
import java.util.Iterator;
/**
* @author Ted Husted
* @version $Revision: 1.1 $ $Date: 2002/08/14 17:50:49 $
*/
public class Exceptions extends ArrayList {
}
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
1.1 jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/lang/ChainedException.java
Index: ChainedException.java
===================================================================
/**
* Mimicks new functionality in 1.4
*/
package org.apache.commons.scaffold.lang;
import org.apache.commons.scaffold.text.ConvertUtils;
/**
* http://www.javaworld.com/javaworld/jw-08-2001/jw-0803-exceptions.html
* @author Brian Geotz
* @version $Revision: 1.1 $ $Date: 2002/08/14 17:50:49 $
*/
public class ChainedException extends Exception {
private static final String CAUSED_BY = "Caused by: ";
private Throwable cause;
public ChainedException() {
super();
}
public ChainedException(String message) {
super(message);
}
public ChainedException(String message, Throwable cause) {
super(message);
this.cause = cause;
}
public ChainedException(Throwable cause) {
super();
this.cause = cause;
}
public Throwable getCause() {
return this.cause;
}
public boolean isCause() {
return (this.cause!=null);
}
public String getCauseMessage() {
if (this.cause==null)
return null;
return this.cause.getMessage();
}
public void getMessage(StringBuffer sb) {
sb.append(super.getMessage());
sb.append(ConvertUtils.LINE_FEED);
if (cause != null) {
sb.append(CAUSED_BY);
if (cause instanceof ChainedException) {
ChainedException chainedCause = (ChainedException) cause;
chainedCause.getMessage(sb);
}
else {
sb.append(cause.getMessage());
}
}
}
public void printStackTrace() {
super.printStackTrace();
if (cause != null) {
System.err.println(CAUSED_BY);
cause.printStackTrace();
}
}
public void printStackTrace(java.io.PrintStream ps) {
super.printStackTrace(ps);
if (cause != null) {
ps.println(CAUSED_BY);
cause.printStackTrace(ps);
}
}
public void printStackTrace(java.io.PrintWriter pw) {
super.printStackTrace(pw);
if (cause != null) {
pw.println(CAUSED_BY);
cause.printStackTrace(pw);
}
}
}
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Scaffold", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
1.1 jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/lang/BaseException.java
Index: BaseException.java
===================================================================
package org.apache.commons.scaffold.lang;
/**
* Base exception for additional subclasses.
*
* @author Ted Husted
* @version $Revision: 1.1 $ $Date: 2002/08/14 17:50:49 $
* @todo Add message bundle to package and localized messages.
*/
public class BaseException extends ChainedException {
public BaseException (String message) {
super (message);
}
public BaseException (String message, Throwable cause) {
super (message, cause);
}
}
/*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Scaffold", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>