You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by jb...@apache.org on 2010/11/20 19:14:04 UTC
svn commit: r1037284 [5/12] - in /tomcat/taglibs/standard/trunk/jstlel: ./
src/main/java/org/apache/taglibs/standard/lang/jstl/
src/main/java/org/apache/taglibs/standard/lang/jstl/parser/
src/main/java/org/apache/taglibs/standard/lang/support/ src/main...
Modified: tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/Logger.java
URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/Logger.java?rev=1037284&r1=1037283&r2=1037284&view=diff
==============================================================================
--- tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/Logger.java (original)
+++ tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/Logger.java Sat Nov 20 18:14:00 2010
@@ -13,7 +13,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.taglibs.standard.lang.jstl;
@@ -21,759 +21,720 @@ import java.io.PrintStream;
import java.text.MessageFormat;
/**
- *
* <p>The evaluator may pass an instance of this class to operators
* and expressions during evaluation. They should use this to log any
* warning or error messages that might come up. This allows all of
* our logging policies to be concentrated in one class.
- *
+ * <p/>
* <p>Errors are conditions that are severe enough to abort operation.
* Warnings are conditions through which the operation may continue,
* but which should be reported to the developer.
- *
+ *
* @author Nathan Abramson - Art Technology Group
* @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author$
- **/
+ */
+
+public class Logger {
+ //-------------------------------------
+ // Member variables
+ //-------------------------------------
+
+ PrintStream mOut;
+
+ //-------------------------------------
+
+ /**
+ * Constructor
+ *
+ * @param pOut the PrintStream to which warnings should be printed
+ */
+ public Logger(PrintStream pOut) {
+ mOut = pOut;
+ }
+
+ //-------------------------------------
+
+ /**
+ * Returns true if the application should even bother to try logging
+ * a warning.
+ */
+ public boolean isLoggingWarning() {
+ return false;
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs a warning
+ */
+ public void logWarning(String pMessage,
+ Throwable pRootCause)
+ throws ELException {
+ if (isLoggingWarning()) {
+ if (mOut != null) {
+ if (pMessage == null) {
+ mOut.println(pRootCause);
+ } else if (pRootCause == null) {
+ mOut.println(pMessage);
+ } else {
+ mOut.println(pMessage + ": " + pRootCause);
+ }
+ }
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs a warning
+ */
+ public void logWarning(String pTemplate)
+ throws ELException {
+ if (isLoggingWarning()) {
+ logWarning(pTemplate, null);
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs a warning
+ */
+ public void logWarning(Throwable pRootCause)
+ throws ELException {
+ if (isLoggingWarning()) {
+ logWarning(null, pRootCause);
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs a warning
+ */
+ public void logWarning(String pTemplate,
+ Object pArg0)
+ throws ELException {
+ if (isLoggingWarning()) {
+ logWarning
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ }));
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs a warning
+ */
+ public void logWarning(String pTemplate,
+ Throwable pRootCause,
+ Object pArg0)
+ throws ELException {
+ if (isLoggingWarning()) {
+ logWarning
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ }),
+ pRootCause);
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs a warning
+ */
+ public void logWarning(String pTemplate,
+ Object pArg0,
+ Object pArg1)
+ throws ELException {
+ if (isLoggingWarning()) {
+ logWarning
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ "" + pArg1,
+ }));
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs a warning
+ */
+ public void logWarning(String pTemplate,
+ Throwable pRootCause,
+ Object pArg0,
+ Object pArg1)
+ throws ELException {
+ if (isLoggingWarning()) {
+ logWarning
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ "" + pArg1,
+ }),
+ pRootCause);
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs a warning
+ */
+ public void logWarning(String pTemplate,
+ Object pArg0,
+ Object pArg1,
+ Object pArg2)
+ throws ELException {
+ if (isLoggingWarning()) {
+ logWarning
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ "" + pArg1,
+ "" + pArg2,
+ }));
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs a warning
+ */
+ public void logWarning(String pTemplate,
+ Throwable pRootCause,
+ Object pArg0,
+ Object pArg1,
+ Object pArg2)
+ throws ELException {
+ if (isLoggingWarning()) {
+ logWarning
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ "" + pArg1,
+ "" + pArg2,
+ }),
+ pRootCause);
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs a warning
+ */
+ public void logWarning(String pTemplate,
+ Object pArg0,
+ Object pArg1,
+ Object pArg2,
+ Object pArg3)
+ throws ELException {
+ if (isLoggingWarning()) {
+ logWarning
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ "" + pArg1,
+ "" + pArg2,
+ "" + pArg3,
+ }));
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs a warning
+ */
+ public void logWarning(String pTemplate,
+ Throwable pRootCause,
+ Object pArg0,
+ Object pArg1,
+ Object pArg2,
+ Object pArg3)
+ throws ELException {
+ if (isLoggingWarning()) {
+ logWarning
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ "" + pArg1,
+ "" + pArg2,
+ "" + pArg3,
+ }),
+ pRootCause);
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs a warning
+ */
+ public void logWarning(String pTemplate,
+ Object pArg0,
+ Object pArg1,
+ Object pArg2,
+ Object pArg3,
+ Object pArg4)
+ throws ELException {
+ if (isLoggingWarning()) {
+ logWarning
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ "" + pArg1,
+ "" + pArg2,
+ "" + pArg3,
+ "" + pArg4,
+ }));
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs a warning
+ */
+ public void logWarning(String pTemplate,
+ Throwable pRootCause,
+ Object pArg0,
+ Object pArg1,
+ Object pArg2,
+ Object pArg3,
+ Object pArg4)
+ throws ELException {
+ if (isLoggingWarning()) {
+ logWarning
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ "" + pArg1,
+ "" + pArg2,
+ "" + pArg3,
+ "" + pArg4,
+ }),
+ pRootCause);
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs a warning
+ */
+ public void logWarning(String pTemplate,
+ Object pArg0,
+ Object pArg1,
+ Object pArg2,
+ Object pArg3,
+ Object pArg4,
+ Object pArg5)
+ throws ELException {
+ if (isLoggingWarning()) {
+ logWarning
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ "" + pArg1,
+ "" + pArg2,
+ "" + pArg3,
+ "" + pArg4,
+ "" + pArg5,
+ }));
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs a warning
+ */
+ public void logWarning(String pTemplate,
+ Throwable pRootCause,
+ Object pArg0,
+ Object pArg1,
+ Object pArg2,
+ Object pArg3,
+ Object pArg4,
+ Object pArg5)
+ throws ELException {
+ if (isLoggingWarning()) {
+ logWarning
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ "" + pArg1,
+ "" + pArg2,
+ "" + pArg3,
+ "" + pArg4,
+ "" + pArg5,
+ }),
+ pRootCause);
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Returns true if the application should even bother to try logging
+ * an error.
+ */
+ public boolean isLoggingError() {
+ return true;
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs an error
+ */
+ public void logError(String pMessage,
+ Throwable pRootCause)
+ throws ELException {
+ if (isLoggingError()) {
+ if (pMessage == null) {
+ throw new ELException(pRootCause);
+ } else if (pRootCause == null) {
+ throw new ELException(pMessage);
+ } else {
+ throw new ELException(pMessage, pRootCause);
+ }
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs an error
+ */
+ public void logError(String pTemplate)
+ throws ELException {
+ if (isLoggingError()) {
+ logError(pTemplate, null);
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs an error
+ */
+ public void logError(Throwable pRootCause)
+ throws ELException {
+ if (isLoggingError()) {
+ logError(null, pRootCause);
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs an error
+ */
+ public void logError(String pTemplate,
+ Object pArg0)
+ throws ELException {
+ if (isLoggingError()) {
+ logError
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ }));
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs an error
+ */
+ public void logError(String pTemplate,
+ Throwable pRootCause,
+ Object pArg0)
+ throws ELException {
+ if (isLoggingError()) {
+ logError
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ }),
+ pRootCause);
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs an error
+ */
+ public void logError(String pTemplate,
+ Object pArg0,
+ Object pArg1)
+ throws ELException {
+ if (isLoggingError()) {
+ logError
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ "" + pArg1,
+ }));
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs an error
+ */
+ public void logError(String pTemplate,
+ Throwable pRootCause,
+ Object pArg0,
+ Object pArg1)
+ throws ELException {
+ if (isLoggingError()) {
+ logError
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ "" + pArg1,
+ }),
+ pRootCause);
+ }
+ }
-public class Logger
-{
- //-------------------------------------
- // Member variables
- //-------------------------------------
-
- PrintStream mOut;
-
- //-------------------------------------
- /**
- *
- * Constructor
- *
- * @param pOut the PrintStream to which warnings should be printed
- **/
- public Logger (PrintStream pOut)
- {
- mOut = pOut;
- }
-
- //-------------------------------------
- /**
- *
- * Returns true if the application should even bother to try logging
- * a warning.
- **/
- public boolean isLoggingWarning ()
- {
- return false;
- }
-
- //-------------------------------------
- /**
- *
- * Logs a warning
- **/
- public void logWarning (String pMessage,
- Throwable pRootCause)
- throws ELException
- {
- if (isLoggingWarning ()) {
- if(mOut != null) {
- if (pMessage == null) {
- mOut.println (pRootCause);
- }
- else if (pRootCause == null) {
- mOut.println (pMessage);
- }
- else {
- mOut.println (pMessage + ": " + pRootCause);
- }
- }
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs a warning
- **/
- public void logWarning (String pTemplate)
- throws ELException
- {
- if (isLoggingWarning ()) {
- logWarning (pTemplate, null);
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs a warning
- **/
- public void logWarning (Throwable pRootCause)
- throws ELException
- {
- if (isLoggingWarning ()) {
- logWarning (null, pRootCause);
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs a warning
- **/
- public void logWarning (String pTemplate,
- Object pArg0)
- throws ELException
- {
- if (isLoggingWarning ()) {
- logWarning
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- }));
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs a warning
- **/
- public void logWarning (String pTemplate,
- Throwable pRootCause,
- Object pArg0)
- throws ELException
- {
- if (isLoggingWarning ()) {
- logWarning
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- }),
- pRootCause);
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs a warning
- **/
- public void logWarning (String pTemplate,
- Object pArg0,
- Object pArg1)
- throws ELException
- {
- if (isLoggingWarning ()) {
- logWarning
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- "" + pArg1,
- }));
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs a warning
- **/
- public void logWarning (String pTemplate,
- Throwable pRootCause,
- Object pArg0,
- Object pArg1)
- throws ELException
- {
- if (isLoggingWarning ()) {
- logWarning
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- "" + pArg1,
- }),
- pRootCause);
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs a warning
- **/
- public void logWarning (String pTemplate,
- Object pArg0,
- Object pArg1,
- Object pArg2)
- throws ELException
- {
- if (isLoggingWarning ()) {
- logWarning
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- "" + pArg1,
- "" + pArg2,
- }));
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs a warning
- **/
- public void logWarning (String pTemplate,
- Throwable pRootCause,
- Object pArg0,
- Object pArg1,
- Object pArg2)
- throws ELException
- {
- if (isLoggingWarning ()) {
- logWarning
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- "" + pArg1,
- "" + pArg2,
- }),
- pRootCause);
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs a warning
- **/
- public void logWarning (String pTemplate,
- Object pArg0,
- Object pArg1,
- Object pArg2,
- Object pArg3)
- throws ELException
- {
- if (isLoggingWarning ()) {
- logWarning
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- "" + pArg1,
- "" + pArg2,
- "" + pArg3,
- }));
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs a warning
- **/
- public void logWarning (String pTemplate,
- Throwable pRootCause,
- Object pArg0,
- Object pArg1,
- Object pArg2,
- Object pArg3)
- throws ELException
- {
- if (isLoggingWarning ()) {
- logWarning
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- "" + pArg1,
- "" + pArg2,
- "" + pArg3,
- }),
- pRootCause);
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs a warning
- **/
- public void logWarning (String pTemplate,
- Object pArg0,
- Object pArg1,
- Object pArg2,
- Object pArg3,
- Object pArg4)
- throws ELException
- {
- if (isLoggingWarning ()) {
- logWarning
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- "" + pArg1,
- "" + pArg2,
- "" + pArg3,
- "" + pArg4,
- }));
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs a warning
- **/
- public void logWarning (String pTemplate,
- Throwable pRootCause,
- Object pArg0,
- Object pArg1,
- Object pArg2,
- Object pArg3,
- Object pArg4)
- throws ELException
- {
- if (isLoggingWarning ()) {
- logWarning
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- "" + pArg1,
- "" + pArg2,
- "" + pArg3,
- "" + pArg4,
- }),
- pRootCause);
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs a warning
- **/
- public void logWarning (String pTemplate,
- Object pArg0,
- Object pArg1,
- Object pArg2,
- Object pArg3,
- Object pArg4,
- Object pArg5)
- throws ELException
- {
- if (isLoggingWarning ()) {
- logWarning
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- "" + pArg1,
- "" + pArg2,
- "" + pArg3,
- "" + pArg4,
- "" + pArg5,
- }));
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs a warning
- **/
- public void logWarning (String pTemplate,
- Throwable pRootCause,
- Object pArg0,
- Object pArg1,
- Object pArg2,
- Object pArg3,
- Object pArg4,
- Object pArg5)
- throws ELException
- {
- if (isLoggingWarning ()) {
- logWarning
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- "" + pArg1,
- "" + pArg2,
- "" + pArg3,
- "" + pArg4,
- "" + pArg5,
- }),
- pRootCause);
- }
- }
-
- //-------------------------------------
- /**
- *
- * Returns true if the application should even bother to try logging
- * an error.
- **/
- public boolean isLoggingError ()
- {
- return true;
- }
-
- //-------------------------------------
- /**
- *
- * Logs an error
- **/
- public void logError (String pMessage,
- Throwable pRootCause)
- throws ELException
- {
- if (isLoggingError ()) {
- if (pMessage == null) {
- throw new ELException (pRootCause);
- }
- else if (pRootCause == null) {
- throw new ELException (pMessage);
- }
- else {
- throw new ELException (pMessage, pRootCause);
- }
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs an error
- **/
- public void logError (String pTemplate)
- throws ELException
- {
- if (isLoggingError ()) {
- logError (pTemplate, null);
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs an error
- **/
- public void logError (Throwable pRootCause)
- throws ELException
- {
- if (isLoggingError ()) {
- logError (null, pRootCause);
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs an error
- **/
- public void logError (String pTemplate,
- Object pArg0)
- throws ELException
- {
- if (isLoggingError ()) {
- logError
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- }));
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs an error
- **/
- public void logError (String pTemplate,
- Throwable pRootCause,
- Object pArg0)
- throws ELException
- {
- if (isLoggingError ()) {
- logError
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- }),
- pRootCause);
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs an error
- **/
- public void logError (String pTemplate,
- Object pArg0,
- Object pArg1)
- throws ELException
- {
- if (isLoggingError ()) {
- logError
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- "" + pArg1,
- }));
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs an error
- **/
- public void logError (String pTemplate,
- Throwable pRootCause,
- Object pArg0,
- Object pArg1)
- throws ELException
- {
- if (isLoggingError ()) {
- logError
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- "" + pArg1,
- }),
- pRootCause);
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs an error
- **/
- public void logError (String pTemplate,
- Object pArg0,
- Object pArg1,
- Object pArg2)
- throws ELException
- {
- if (isLoggingError ()) {
- logError
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- "" + pArg1,
- "" + pArg2,
- }));
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs an error
- **/
- public void logError (String pTemplate,
- Throwable pRootCause,
- Object pArg0,
- Object pArg1,
- Object pArg2)
- throws ELException
- {
- if (isLoggingError ()) {
- logError
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- "" + pArg1,
- "" + pArg2,
- }),
- pRootCause);
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs an error
- **/
- public void logError (String pTemplate,
- Object pArg0,
- Object pArg1,
- Object pArg2,
- Object pArg3)
- throws ELException
- {
- if (isLoggingError ()) {
- logError
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- "" + pArg1,
- "" + pArg2,
- "" + pArg3,
- }));
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs an error
- **/
- public void logError (String pTemplate,
- Throwable pRootCause,
- Object pArg0,
- Object pArg1,
- Object pArg2,
- Object pArg3)
- throws ELException
- {
- if (isLoggingError ()) {
- logError
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- "" + pArg1,
- "" + pArg2,
- "" + pArg3,
- }),
- pRootCause);
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs an error
- **/
- public void logError (String pTemplate,
- Object pArg0,
- Object pArg1,
- Object pArg2,
- Object pArg3,
- Object pArg4)
- throws ELException
- {
- if (isLoggingError ()) {
- logError
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- "" + pArg1,
- "" + pArg2,
- "" + pArg3,
- "" + pArg4,
- }));
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs an error
- **/
- public void logError (String pTemplate,
- Throwable pRootCause,
- Object pArg0,
- Object pArg1,
- Object pArg2,
- Object pArg3,
- Object pArg4)
- throws ELException
- {
- if (isLoggingError ()) {
- logError
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- "" + pArg1,
- "" + pArg2,
- "" + pArg3,
- "" + pArg4,
- }),
- pRootCause);
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs an error
- **/
- public void logError (String pTemplate,
- Object pArg0,
- Object pArg1,
- Object pArg2,
- Object pArg3,
- Object pArg4,
- Object pArg5)
- throws ELException
- {
- if (isLoggingError ()) {
- logError
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- "" + pArg1,
- "" + pArg2,
- "" + pArg3,
- "" + pArg4,
- "" + pArg5,
- }));
- }
- }
-
- //-------------------------------------
- /**
- *
- * Logs an error
- **/
- public void logError (String pTemplate,
- Throwable pRootCause,
- Object pArg0,
- Object pArg1,
- Object pArg2,
- Object pArg3,
- Object pArg4,
- Object pArg5)
- throws ELException
- {
- if (isLoggingError ()) {
- logError
- (MessageFormat.format
- (pTemplate,
- new Object [] {
- "" + pArg0,
- "" + pArg1,
- "" + pArg2,
- "" + pArg3,
- "" + pArg4,
- "" + pArg5,
- }),
- pRootCause);
+ //-------------------------------------
+
+ /**
+ * Logs an error
+ */
+ public void logError(String pTemplate,
+ Object pArg0,
+ Object pArg1,
+ Object pArg2)
+ throws ELException {
+ if (isLoggingError()) {
+ logError
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ "" + pArg1,
+ "" + pArg2,
+ }));
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs an error
+ */
+ public void logError(String pTemplate,
+ Throwable pRootCause,
+ Object pArg0,
+ Object pArg1,
+ Object pArg2)
+ throws ELException {
+ if (isLoggingError()) {
+ logError
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ "" + pArg1,
+ "" + pArg2,
+ }),
+ pRootCause);
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs an error
+ */
+ public void logError(String pTemplate,
+ Object pArg0,
+ Object pArg1,
+ Object pArg2,
+ Object pArg3)
+ throws ELException {
+ if (isLoggingError()) {
+ logError
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ "" + pArg1,
+ "" + pArg2,
+ "" + pArg3,
+ }));
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs an error
+ */
+ public void logError(String pTemplate,
+ Throwable pRootCause,
+ Object pArg0,
+ Object pArg1,
+ Object pArg2,
+ Object pArg3)
+ throws ELException {
+ if (isLoggingError()) {
+ logError
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ "" + pArg1,
+ "" + pArg2,
+ "" + pArg3,
+ }),
+ pRootCause);
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs an error
+ */
+ public void logError(String pTemplate,
+ Object pArg0,
+ Object pArg1,
+ Object pArg2,
+ Object pArg3,
+ Object pArg4)
+ throws ELException {
+ if (isLoggingError()) {
+ logError
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ "" + pArg1,
+ "" + pArg2,
+ "" + pArg3,
+ "" + pArg4,
+ }));
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs an error
+ */
+ public void logError(String pTemplate,
+ Throwable pRootCause,
+ Object pArg0,
+ Object pArg1,
+ Object pArg2,
+ Object pArg3,
+ Object pArg4)
+ throws ELException {
+ if (isLoggingError()) {
+ logError
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ "" + pArg1,
+ "" + pArg2,
+ "" + pArg3,
+ "" + pArg4,
+ }),
+ pRootCause);
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs an error
+ */
+ public void logError(String pTemplate,
+ Object pArg0,
+ Object pArg1,
+ Object pArg2,
+ Object pArg3,
+ Object pArg4,
+ Object pArg5)
+ throws ELException {
+ if (isLoggingError()) {
+ logError
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ "" + pArg1,
+ "" + pArg2,
+ "" + pArg3,
+ "" + pArg4,
+ "" + pArg5,
+ }));
+ }
+ }
+
+ //-------------------------------------
+
+ /**
+ * Logs an error
+ */
+ public void logError(String pTemplate,
+ Throwable pRootCause,
+ Object pArg0,
+ Object pArg1,
+ Object pArg2,
+ Object pArg3,
+ Object pArg4,
+ Object pArg5)
+ throws ELException {
+ if (isLoggingError()) {
+ logError
+ (MessageFormat.format
+ (pTemplate,
+ new Object[]{
+ "" + pArg0,
+ "" + pArg1,
+ "" + pArg2,
+ "" + pArg3,
+ "" + pArg4,
+ "" + pArg5,
+ }),
+ pRootCause);
+ }
}
- }
- //-------------------------------------
+ //-------------------------------------
}
Modified: tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/MinusOperator.java
URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/MinusOperator.java?rev=1037284&r1=1037283&r2=1037284&view=diff
==============================================================================
--- tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/MinusOperator.java (original)
+++ tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/MinusOperator.java Sat Nov 20 18:14:00 2010
@@ -13,72 +13,66 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.taglibs.standard.lang.jstl;
/**
- *
* <p>The implementation of the minus operator
- *
+ *
* @author Nathan Abramson - Art Technology Group
* @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author$
- **/
+ */
public class MinusOperator
- extends ArithmeticOperator
-{
- //-------------------------------------
- // Singleton
- //-------------------------------------
-
- public static final MinusOperator SINGLETON =
- new MinusOperator ();
-
- //-------------------------------------
- /**
- *
- * Constructor
- **/
- public MinusOperator ()
- {
- }
-
- //-------------------------------------
- // Expression methods
- //-------------------------------------
- /**
- *
- * Returns the symbol representing the operator
- **/
- public String getOperatorSymbol ()
- {
- return "-";
- }
-
- //-------------------------------------
- /**
- *
- * Applies the operator to the given double values, returning a double
- **/
- public double apply (double pLeft,
- double pRight,
- Logger pLogger)
- {
- return pLeft - pRight;
- }
-
- //-------------------------------------
- /**
- *
- * Applies the operator to the given double values, returning a double
- **/
- public long apply (long pLeft,
- long pRight,
- Logger pLogger)
- {
- return pLeft - pRight;
- }
-
- //-------------------------------------
+ extends ArithmeticOperator {
+ //-------------------------------------
+ // Singleton
+ //-------------------------------------
+
+ public static final MinusOperator SINGLETON =
+ new MinusOperator();
+
+ //-------------------------------------
+
+ /**
+ * Constructor
+ */
+ public MinusOperator() {
+ }
+
+ //-------------------------------------
+ // Expression methods
+ //-------------------------------------
+
+ /**
+ * Returns the symbol representing the operator
+ */
+ public String getOperatorSymbol() {
+ return "-";
+ }
+
+ //-------------------------------------
+
+ /**
+ * Applies the operator to the given double values, returning a double
+ */
+ public double apply(double pLeft,
+ double pRight,
+ Logger pLogger) {
+ return pLeft - pRight;
+ }
+
+ //-------------------------------------
+
+ /**
+ * Applies the operator to the given double values, returning a double
+ */
+ public long apply(long pLeft,
+ long pRight,
+ Logger pLogger) {
+ return pLeft - pRight;
+ }
+
+ //-------------------------------------
}
Modified: tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/ModulusOperator.java
URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/ModulusOperator.java?rev=1037284&r1=1037283&r2=1037284&view=diff
==============================================================================
--- tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/ModulusOperator.java (original)
+++ tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/ModulusOperator.java Sat Nov 20 18:14:00 2010
@@ -13,120 +13,114 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.taglibs.standard.lang.jstl;
/**
- *
* <p>The implementation of the modulus operator
- *
+ *
* @author Nathan Abramson - Art Technology Group
* @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author$
- **/
+ */
public class ModulusOperator
- extends BinaryOperator
-{
- //-------------------------------------
- // Singleton
- //-------------------------------------
-
- public static final ModulusOperator SINGLETON =
- new ModulusOperator ();
-
- //-------------------------------------
- /**
- *
- * Constructor
- **/
- public ModulusOperator ()
- {
- }
-
- //-------------------------------------
- // Expression methods
- //-------------------------------------
- /**
- *
- * Returns the symbol representing the operator
- **/
- public String getOperatorSymbol ()
- {
- return "%";
- }
-
- //-------------------------------------
- /**
- *
- * Applies the operator to the given value
- **/
- public Object apply (Object pLeft,
- Object pRight,
- Object pContext,
- Logger pLogger)
- throws ELException
- {
- if (pLeft == null &&
- pRight == null) {
- if (pLogger.isLoggingWarning ()) {
- pLogger.logWarning
- (Constants.ARITH_OP_NULL,
- getOperatorSymbol ());
- }
- return PrimitiveObjects.getInteger (0);
+ extends BinaryOperator {
+ //-------------------------------------
+ // Singleton
+ //-------------------------------------
+
+ public static final ModulusOperator SINGLETON =
+ new ModulusOperator();
+
+ //-------------------------------------
+
+ /**
+ * Constructor
+ */
+ public ModulusOperator() {
}
- if ((pLeft != null &&
- (Coercions.isFloatingPointType (pLeft) ||
- Coercions.isFloatingPointString (pLeft))) ||
- (pRight != null &&
- (Coercions.isFloatingPointType (pRight) ||
- Coercions.isFloatingPointString (pRight)))) {
- double left =
- Coercions.coerceToPrimitiveNumber (pLeft, Double.class, pLogger).
- doubleValue ();
- double right =
- Coercions.coerceToPrimitiveNumber (pRight, Double.class, pLogger).
- doubleValue ();
-
- try {
- return PrimitiveObjects.getDouble (left % right);
- }
- catch (Exception exc) {
- if (pLogger.isLoggingError ()) {
- pLogger.logError
- (Constants.ARITH_ERROR,
- getOperatorSymbol (),
- "" + left,
- "" + right);
- }
- return PrimitiveObjects.getInteger (0);
- }
+ //-------------------------------------
+ // Expression methods
+ //-------------------------------------
+
+ /**
+ * Returns the symbol representing the operator
+ */
+ public String getOperatorSymbol() {
+ return "%";
}
- else {
- long left =
- Coercions.coerceToPrimitiveNumber (pLeft, Long.class, pLogger).
- longValue ();
- long right =
- Coercions.coerceToPrimitiveNumber (pRight, Long.class, pLogger).
- longValue ();
-
- try {
- return PrimitiveObjects.getLong (left % right);
- }
- catch (Exception exc) {
- if (pLogger.isLoggingError ()) {
- pLogger.logError
- (Constants.ARITH_ERROR,
- getOperatorSymbol (),
- "" + left,
- "" + right);
- }
- return PrimitiveObjects.getInteger (0);
- }
+
+ //-------------------------------------
+
+ /**
+ * Applies the operator to the given value
+ */
+ public Object apply(Object pLeft,
+ Object pRight,
+ Object pContext,
+ Logger pLogger)
+ throws ELException {
+ if (pLeft == null &&
+ pRight == null) {
+ if (pLogger.isLoggingWarning()) {
+ pLogger.logWarning
+ (Constants.ARITH_OP_NULL,
+ getOperatorSymbol());
+ }
+ return PrimitiveObjects.getInteger(0);
+ }
+
+ if ((pLeft != null &&
+ (Coercions.isFloatingPointType(pLeft) ||
+ Coercions.isFloatingPointString(pLeft))) ||
+ (pRight != null &&
+ (Coercions.isFloatingPointType(pRight) ||
+ Coercions.isFloatingPointString(pRight)))) {
+ double left =
+ Coercions.coerceToPrimitiveNumber(pLeft, Double.class, pLogger).
+ doubleValue();
+ double right =
+ Coercions.coerceToPrimitiveNumber(pRight, Double.class, pLogger).
+ doubleValue();
+
+ try {
+ return PrimitiveObjects.getDouble(left % right);
+ }
+ catch (Exception exc) {
+ if (pLogger.isLoggingError()) {
+ pLogger.logError
+ (Constants.ARITH_ERROR,
+ getOperatorSymbol(),
+ "" + left,
+ "" + right);
+ }
+ return PrimitiveObjects.getInteger(0);
+ }
+ } else {
+ long left =
+ Coercions.coerceToPrimitiveNumber(pLeft, Long.class, pLogger).
+ longValue();
+ long right =
+ Coercions.coerceToPrimitiveNumber(pRight, Long.class, pLogger).
+ longValue();
+
+ try {
+ return PrimitiveObjects.getLong(left % right);
+ }
+ catch (Exception exc) {
+ if (pLogger.isLoggingError()) {
+ pLogger.logError
+ (Constants.ARITH_ERROR,
+ getOperatorSymbol(),
+ "" + left,
+ "" + right);
+ }
+ return PrimitiveObjects.getInteger(0);
+ }
+ }
}
- }
- //-------------------------------------
+ //-------------------------------------
}
Modified: tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/MultiplyOperator.java
URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/MultiplyOperator.java?rev=1037284&r1=1037283&r2=1037284&view=diff
==============================================================================
--- tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/MultiplyOperator.java (original)
+++ tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/MultiplyOperator.java Sat Nov 20 18:14:00 2010
@@ -13,72 +13,66 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.taglibs.standard.lang.jstl;
/**
- *
* <p>The implementation of the multiply operator
- *
+ *
* @author Nathan Abramson - Art Technology Group
* @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author$
- **/
+ */
public class MultiplyOperator
- extends ArithmeticOperator
-{
- //-------------------------------------
- // Singleton
- //-------------------------------------
-
- public static final MultiplyOperator SINGLETON =
- new MultiplyOperator ();
-
- //-------------------------------------
- /**
- *
- * Constructor
- **/
- public MultiplyOperator ()
- {
- }
-
- //-------------------------------------
- // Expression methods
- //-------------------------------------
- /**
- *
- * Returns the symbol representing the operator
- **/
- public String getOperatorSymbol ()
- {
- return "*";
- }
-
- //-------------------------------------
- /**
- *
- * Applies the operator to the given double values, returning a double
- **/
- public double apply (double pLeft,
- double pRight,
- Logger pLogger)
- {
- return pLeft * pRight;
- }
-
- //-------------------------------------
- /**
- *
- * Applies the operator to the given double values, returning a double
- **/
- public long apply (long pLeft,
- long pRight,
- Logger pLogger)
- {
- return pLeft * pRight;
- }
-
- //-------------------------------------
+ extends ArithmeticOperator {
+ //-------------------------------------
+ // Singleton
+ //-------------------------------------
+
+ public static final MultiplyOperator SINGLETON =
+ new MultiplyOperator();
+
+ //-------------------------------------
+
+ /**
+ * Constructor
+ */
+ public MultiplyOperator() {
+ }
+
+ //-------------------------------------
+ // Expression methods
+ //-------------------------------------
+
+ /**
+ * Returns the symbol representing the operator
+ */
+ public String getOperatorSymbol() {
+ return "*";
+ }
+
+ //-------------------------------------
+
+ /**
+ * Applies the operator to the given double values, returning a double
+ */
+ public double apply(double pLeft,
+ double pRight,
+ Logger pLogger) {
+ return pLeft * pRight;
+ }
+
+ //-------------------------------------
+
+ /**
+ * Applies the operator to the given double values, returning a double
+ */
+ public long apply(long pLeft,
+ long pRight,
+ Logger pLogger) {
+ return pLeft * pRight;
+ }
+
+ //-------------------------------------
}
Modified: tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/NamedValue.java
URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/NamedValue.java?rev=1037284&r1=1037283&r2=1037284&view=diff
==============================================================================
--- tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/NamedValue.java (original)
+++ tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/NamedValue.java Sat Nov 20 18:14:00 2010
@@ -13,79 +13,75 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.taglibs.standard.lang.jstl;
import java.util.Map;
/**
- *
* <p>Represents a name that can be used as the first element of a
* value.
- *
+ *
* @author Nathan Abramson - Art Technology Group
* @author Shawn Bayern
* @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author$
- **/
+ */
public class NamedValue
- extends Expression
-{
- //-------------------------------------
- // Constants
- //-------------------------------------
-
- //-------------------------------------
- // Properties
- //-------------------------------------
- // property name
-
- String mName;
- public String getName ()
- { return mName; }
-
- //-------------------------------------
- /**
- *
- * Constructor
- **/
- public NamedValue (String pName)
- {
- mName = pName;
- }
-
- //-------------------------------------
- // Expression methods
- //-------------------------------------
- /**
- *
- * Returns the expression in the expression language syntax
- **/
- public String getExpressionString ()
- {
- return StringLiteral.toIdentifierToken (mName);
- }
-
- //-------------------------------------
- /**
- *
- * Evaluates by looking up the name in the VariableResolver
- **/
- public Object evaluate (Object pContext,
- VariableResolver pResolver,
- Map functions,
- String defaultPrefix,
- Logger pLogger)
- throws ELException
- {
- if (pResolver == null) {
- return null;
+ extends Expression {
+ //-------------------------------------
+ // Constants
+ //-------------------------------------
+
+ //-------------------------------------
+ // Properties
+ //-------------------------------------
+ // property name
+
+ String mName;
+
+ public String getName() {
+ return mName;
}
- else {
- return pResolver.resolveVariable (mName, pContext);
+
+ //-------------------------------------
+
+ /**
+ * Constructor
+ */
+ public NamedValue(String pName) {
+ mName = pName;
+ }
+
+ //-------------------------------------
+ // Expression methods
+ //-------------------------------------
+
+ /**
+ * Returns the expression in the expression language syntax
+ */
+ public String getExpressionString() {
+ return StringLiteral.toIdentifierToken(mName);
+ }
+
+ //-------------------------------------
+
+ /**
+ * Evaluates by looking up the name in the VariableResolver
+ */
+ public Object evaluate(Object pContext,
+ VariableResolver pResolver,
+ Map functions,
+ String defaultPrefix,
+ Logger pLogger)
+ throws ELException {
+ if (pResolver == null) {
+ return null;
+ } else {
+ return pResolver.resolveVariable(mName, pContext);
+ }
}
- }
- //-------------------------------------
+ //-------------------------------------
}
Modified: tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/NotEqualsOperator.java
URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/NotEqualsOperator.java?rev=1037284&r1=1037283&r2=1037284&view=diff
==============================================================================
--- tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/NotEqualsOperator.java (original)
+++ tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/NotEqualsOperator.java Sat Nov 20 18:14:00 2010
@@ -13,60 +13,55 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.taglibs.standard.lang.jstl;
/**
- *
* <p>The implementation of the not equals operator
- *
+ *
* @author Nathan Abramson - Art Technology Group
* @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author$
- **/
+ */
public class NotEqualsOperator
- extends EqualityOperator
-{
- //-------------------------------------
- // Singleton
- //-------------------------------------
-
- public static final NotEqualsOperator SINGLETON =
- new NotEqualsOperator ();
-
- //-------------------------------------
- /**
- *
- * Constructor
- **/
- public NotEqualsOperator ()
- {
- }
-
- //-------------------------------------
- // Expression methods
- //-------------------------------------
- /**
- *
- * Returns the symbol representing the operator
- **/
- public String getOperatorSymbol ()
- {
- return "!=";
- }
-
- //-------------------------------------
- /**
- *
- * Applies the operator given the fact that the two elements are
- * equal.
- **/
- public boolean apply (boolean pAreEqual,
- Logger pLogger)
- {
- return !pAreEqual;
- }
-
- //-------------------------------------
+ extends EqualityOperator {
+ //-------------------------------------
+ // Singleton
+ //-------------------------------------
+
+ public static final NotEqualsOperator SINGLETON =
+ new NotEqualsOperator();
+
+ //-------------------------------------
+
+ /**
+ * Constructor
+ */
+ public NotEqualsOperator() {
+ }
+
+ //-------------------------------------
+ // Expression methods
+ //-------------------------------------
+
+ /**
+ * Returns the symbol representing the operator
+ */
+ public String getOperatorSymbol() {
+ return "!=";
+ }
+
+ //-------------------------------------
+
+ /**
+ * Applies the operator given the fact that the two elements are
+ * equal.
+ */
+ public boolean apply(boolean pAreEqual,
+ Logger pLogger) {
+ return !pAreEqual;
+ }
+
+ //-------------------------------------
}
Modified: tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/NotOperator.java
URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/NotOperator.java?rev=1037284&r1=1037283&r2=1037284&view=diff
==============================================================================
--- tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/NotOperator.java (original)
+++ tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/NotOperator.java Sat Nov 20 18:14:00 2010
@@ -13,64 +13,59 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.taglibs.standard.lang.jstl;
/**
- *
* <p>The implementation of the not operator
- *
+ *
* @author Nathan Abramson - Art Technology Group
* @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author$
- **/
+ */
public class NotOperator
- extends UnaryOperator
-{
- //-------------------------------------
- // Singleton
- //-------------------------------------
-
- public static final NotOperator SINGLETON =
- new NotOperator ();
-
- //-------------------------------------
- /**
- *
- * Constructor
- **/
- public NotOperator ()
- {
- }
-
- //-------------------------------------
- // Expression methods
- //-------------------------------------
- /**
- *
- * Returns the symbol representing the operator
- **/
- public String getOperatorSymbol ()
- {
- return "not";
- }
-
- //-------------------------------------
- /**
- *
- * Applies the operator to the given value
- **/
- public Object apply (Object pValue,
- Object pContext,
- Logger pLogger)
- throws ELException
- {
- // Coerce the value to a boolean
- boolean val = Coercions.coerceToBoolean (pValue, pLogger).booleanValue ();
+ extends UnaryOperator {
+ //-------------------------------------
+ // Singleton
+ //-------------------------------------
+
+ public static final NotOperator SINGLETON =
+ new NotOperator();
+
+ //-------------------------------------
+
+ /**
+ * Constructor
+ */
+ public NotOperator() {
+ }
+
+ //-------------------------------------
+ // Expression methods
+ //-------------------------------------
+
+ /**
+ * Returns the symbol representing the operator
+ */
+ public String getOperatorSymbol() {
+ return "not";
+ }
+
+ //-------------------------------------
+
+ /**
+ * Applies the operator to the given value
+ */
+ public Object apply(Object pValue,
+ Object pContext,
+ Logger pLogger)
+ throws ELException {
+ // Coerce the value to a boolean
+ boolean val = Coercions.coerceToBoolean(pValue, pLogger).booleanValue();
- return PrimitiveObjects.getBoolean (!val);
- }
+ return PrimitiveObjects.getBoolean(!val);
+ }
- //-------------------------------------
+ //-------------------------------------
}
Modified: tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/NullLiteral.java
URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/NullLiteral.java?rev=1037284&r1=1037283&r2=1037284&view=diff
==============================================================================
--- tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/NullLiteral.java (original)
+++ tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/NullLiteral.java Sat Nov 20 18:14:00 2010
@@ -13,48 +13,44 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.taglibs.standard.lang.jstl;
/**
- *
* <p>An expression representing a null literal value
- *
+ *
* @author Nathan Abramson - Art Technology Group
* @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author$
- **/
+ */
public class NullLiteral
- extends Literal
-{
- //-------------------------------------
- // Member variables
- //-------------------------------------
-
- public static final NullLiteral SINGLETON = new NullLiteral ();
-
- //-------------------------------------
- /**
- *
- * Constructor
- **/
- public NullLiteral ()
- {
- super (null);
- }
-
- //-------------------------------------
- // Expression methods
- //-------------------------------------
- /**
- *
- * Returns the expression in the expression language syntax
- **/
- public String getExpressionString ()
- {
- return "null";
- }
+ extends Literal {
+ //-------------------------------------
+ // Member variables
+ //-------------------------------------
+
+ public static final NullLiteral SINGLETON = new NullLiteral();
+
+ //-------------------------------------
+
+ /**
+ * Constructor
+ */
+ public NullLiteral() {
+ super(null);
+ }
+
+ //-------------------------------------
+ // Expression methods
+ //-------------------------------------
+
+ /**
+ * Returns the expression in the expression language syntax
+ */
+ public String getExpressionString() {
+ return "null";
+ }
- //-------------------------------------
+ //-------------------------------------
}
Modified: tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/OrOperator.java
URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/OrOperator.java?rev=1037284&r1=1037283&r2=1037284&view=diff
==============================================================================
--- tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/OrOperator.java (original)
+++ tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/OrOperator.java Sat Nov 20 18:14:00 2010
@@ -13,92 +13,85 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.taglibs.standard.lang.jstl;
/**
- *
* <p>The implementation of the or operator
- *
+ *
* @author Nathan Abramson - Art Technology Group
* @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author$
- **/
+ */
public class OrOperator
- extends BinaryOperator
-{
- //-------------------------------------
- // Singleton
- //-------------------------------------
-
- public static final OrOperator SINGLETON =
- new OrOperator ();
-
- //-------------------------------------
- /**
- *
- * Constructor
- **/
- public OrOperator ()
- {
- }
-
- //-------------------------------------
- // Expression methods
- //-------------------------------------
- /**
- *
- * Returns the symbol representing the operator
- **/
- public String getOperatorSymbol ()
- {
- return "or";
- }
-
- //-------------------------------------
- /**
- *
- * Applies the operator to the given value
- **/
- public Object apply (Object pLeft,
- Object pRight,
- Object pContext,
- Logger pLogger)
- throws ELException
- {
- // Coerce the values to booleans
- boolean left =
- Coercions.coerceToBoolean (pLeft, pLogger).booleanValue ();
- boolean right =
- Coercions.coerceToBoolean (pRight, pLogger).booleanValue ();
-
- return PrimitiveObjects.getBoolean (left || right);
- }
-
- //-------------------------------------
- /**
- *
- * Returns true if evaluation is necessary given the specified Left
- * value. The And/OrOperators make use of this
- **/
- public boolean shouldEvaluate (Object pLeft)
- {
- return
- (pLeft instanceof Boolean) &&
- ((Boolean) pLeft).booleanValue () == false;
- }
-
- //-------------------------------------
- /**
- *
- * Returns true if the operator expects its arguments to be coerced
- * to Booleans. The And/Or operators set this to true.
- **/
- public boolean shouldCoerceToBoolean ()
- {
- return true;
- }
+ extends BinaryOperator {
+ //-------------------------------------
+ // Singleton
+ //-------------------------------------
+
+ public static final OrOperator SINGLETON =
+ new OrOperator();
+
+ //-------------------------------------
+
+ /**
+ * Constructor
+ */
+ public OrOperator() {
+ }
+
+ //-------------------------------------
+ // Expression methods
+ //-------------------------------------
+
+ /**
+ * Returns the symbol representing the operator
+ */
+ public String getOperatorSymbol() {
+ return "or";
+ }
+
+ //-------------------------------------
+
+ /**
+ * Applies the operator to the given value
+ */
+ public Object apply(Object pLeft,
+ Object pRight,
+ Object pContext,
+ Logger pLogger)
+ throws ELException {
+ // Coerce the values to booleans
+ boolean left =
+ Coercions.coerceToBoolean(pLeft, pLogger).booleanValue();
+ boolean right =
+ Coercions.coerceToBoolean(pRight, pLogger).booleanValue();
+
+ return PrimitiveObjects.getBoolean(left || right);
+ }
+
+ //-------------------------------------
+
+ /**
+ * Returns true if evaluation is necessary given the specified Left
+ * value. The And/OrOperators make use of this
+ */
+ public boolean shouldEvaluate(Object pLeft) {
+ return
+ (pLeft instanceof Boolean) &&
+ ((Boolean) pLeft).booleanValue() == false;
+ }
+
+ //-------------------------------------
+
+ /**
+ * Returns true if the operator expects its arguments to be coerced
+ * to Booleans. The And/Or operators set this to true.
+ */
+ public boolean shouldCoerceToBoolean() {
+ return true;
+ }
- //-------------------------------------
+ //-------------------------------------
}
Modified: tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/PlusOperator.java
URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/PlusOperator.java?rev=1037284&r1=1037283&r2=1037284&view=diff
==============================================================================
--- tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/PlusOperator.java (original)
+++ tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/PlusOperator.java Sat Nov 20 18:14:00 2010
@@ -13,72 +13,66 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.taglibs.standard.lang.jstl;
/**
- *
* <p>The implementation of the plus operator
- *
+ *
* @author Nathan Abramson - Art Technology Group
* @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author$
- **/
+ */
public class PlusOperator
- extends ArithmeticOperator
-{
- //-------------------------------------
- // Singleton
- //-------------------------------------
-
- public static final PlusOperator SINGLETON =
- new PlusOperator ();
-
- //-------------------------------------
- /**
- *
- * Constructor
- **/
- public PlusOperator ()
- {
- }
-
- //-------------------------------------
- // Expression methods
- //-------------------------------------
- /**
- *
- * Returns the symbol representing the operator
- **/
- public String getOperatorSymbol ()
- {
- return "+";
- }
-
- //-------------------------------------
- /**
- *
- * Applies the operator to the given double values, returning a double
- **/
- public double apply (double pLeft,
- double pRight,
- Logger pLogger)
- {
- return pLeft + pRight;
- }
-
- //-------------------------------------
- /**
- *
- * Applies the operator to the given double values, returning a double
- **/
- public long apply (long pLeft,
- long pRight,
- Logger pLogger)
- {
- return pLeft + pRight;
- }
-
- //-------------------------------------
+ extends ArithmeticOperator {
+ //-------------------------------------
+ // Singleton
+ //-------------------------------------
+
+ public static final PlusOperator SINGLETON =
+ new PlusOperator();
+
+ //-------------------------------------
+
+ /**
+ * Constructor
+ */
+ public PlusOperator() {
+ }
+
+ //-------------------------------------
+ // Expression methods
+ //-------------------------------------
+
+ /**
+ * Returns the symbol representing the operator
+ */
+ public String getOperatorSymbol() {
+ return "+";
+ }
+
+ //-------------------------------------
+
+ /**
+ * Applies the operator to the given double values, returning a double
+ */
+ public double apply(double pLeft,
+ double pRight,
+ Logger pLogger) {
+ return pLeft + pRight;
+ }
+
+ //-------------------------------------
+
+ /**
+ * Applies the operator to the given double values, returning a double
+ */
+ public long apply(long pLeft,
+ long pRight,
+ Logger pLogger) {
+ return pLeft + pRight;
+ }
+
+ //-------------------------------------
}
Modified: tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/PrimitiveObjects.java
URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/PrimitiveObjects.java?rev=1037284&r1=1037283&r2=1037284&view=diff
==============================================================================
--- tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/PrimitiveObjects.java (original)
+++ tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/PrimitiveObjects.java Sat Nov 20 18:14:00 2010
@@ -13,231 +13,215 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.taglibs.standard.lang.jstl;
/**
- *
* <p>This converts primitive values to their Object counterparts.
* For bytes and chars, values from 0 to 255 are cached. For shorts,
* ints, and longs, values -1000 to 1000 are cached.
- *
+ *
* @author Nathan Abramson - Art Technology Group
* @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author$
- **/
+ */
-class PrimitiveObjects
-{
- //-------------------------------------
- // Constants
- //-------------------------------------
-
- static int BYTE_LOWER_BOUND = 0;
- static int BYTE_UPPER_BOUND = 255;
- static int CHARACTER_LOWER_BOUND = 0;
- static int CHARACTER_UPPER_BOUND = 255;
- static int SHORT_LOWER_BOUND = -1000;
- static int SHORT_UPPER_BOUND = 1000;
- static int INTEGER_LOWER_BOUND = -1000;
- static int INTEGER_UPPER_BOUND = 1000;
- static int LONG_LOWER_BOUND = -1000;
- static int LONG_UPPER_BOUND = 1000;
-
- //-------------------------------------
- // Member variables
- //-------------------------------------
-
- static Byte [] mBytes = createBytes ();
- static Character [] mCharacters = createCharacters ();
- static Short [] mShorts = createShorts ();
- static Integer [] mIntegers = createIntegers ();
- static Long [] mLongs = createLongs ();
-
- //-------------------------------------
- // Getting primitive values
- //-------------------------------------
- public static Boolean getBoolean (boolean pValue)
- {
- return
- pValue ?
- Boolean.TRUE :
- Boolean.FALSE;
- }
-
- //-------------------------------------
- public static Byte getByte (byte pValue)
- {
- if (pValue >= BYTE_LOWER_BOUND &&
- pValue <= BYTE_UPPER_BOUND) {
- return mBytes [((int) pValue) - BYTE_LOWER_BOUND];
- }
- else {
- return new Byte (pValue);
- }
- }
-
- //-------------------------------------
- public static Character getCharacter (char pValue)
- {
- if (pValue >= CHARACTER_LOWER_BOUND &&
- pValue <= CHARACTER_UPPER_BOUND) {
- return mCharacters [((int) pValue) - CHARACTER_LOWER_BOUND];
- }
- else {
- return new Character (pValue);
- }
- }
-
- //-------------------------------------
- public static Short getShort (short pValue)
- {
- if (pValue >= SHORT_LOWER_BOUND &&
- pValue <= SHORT_UPPER_BOUND) {
- return mShorts [((int) pValue) - SHORT_LOWER_BOUND];
- }
- else {
- return new Short (pValue);
- }
- }
-
- //-------------------------------------
- public static Integer getInteger (int pValue)
- {
- if (pValue >= INTEGER_LOWER_BOUND &&
- pValue <= INTEGER_UPPER_BOUND) {
- return mIntegers [((int) pValue) - INTEGER_LOWER_BOUND];
- }
- else {
- return new Integer (pValue);
- }
- }
-
- //-------------------------------------
- public static Long getLong (long pValue)
- {
- if (pValue >= LONG_LOWER_BOUND &&
- pValue <= LONG_UPPER_BOUND) {
- return mLongs [((int) pValue) - LONG_LOWER_BOUND];
- }
- else {
- return new Long (pValue);
- }
- }
-
- //-------------------------------------
- public static Float getFloat (float pValue)
- {
- return new Float (pValue);
- }
-
- //-------------------------------------
- public static Double getDouble (double pValue)
- {
- return new Double (pValue);
- }
-
- //-------------------------------------
- // Object class equivalents of primitive classes
- //-------------------------------------
- /**
- *
- * If the given class is a primitive class, returns the object
- * version of that class. Otherwise, the class is just returned.
- **/
- public static Class getPrimitiveObjectClass (Class pClass)
- {
- if (pClass == Boolean.TYPE) {
- return Boolean.class;
- }
- else if (pClass == Byte.TYPE) {
- return Byte.class;
- }
- else if (pClass == Short.TYPE) {
- return Short.class;
- }
- else if (pClass == Character.TYPE) {
- return Character.class;
- }
- else if (pClass == Integer.TYPE) {
- return Integer.class;
- }
- else if (pClass == Long.TYPE) {
- return Long.class;
- }
- else if (pClass == Float.TYPE) {
- return Float.class;
- }
- else if (pClass == Double.TYPE) {
- return Double.class;
- }
- else {
- return pClass;
- }
- }
-
- //-------------------------------------
- // Initializing the cached values
- //-------------------------------------
- static Byte [] createBytes ()
- {
- int len = BYTE_UPPER_BOUND - BYTE_LOWER_BOUND + 1;
- Byte [] ret = new Byte [len];
- byte val = (byte) BYTE_LOWER_BOUND;
- for (int i = 0; i < len; i++, val++) {
- ret [i] = new Byte (val);
- }
- return ret;
- }
-
- //-------------------------------------
- static Character [] createCharacters ()
- {
- int len = CHARACTER_UPPER_BOUND - CHARACTER_LOWER_BOUND + 1;
- Character [] ret = new Character [len];
- char val = (char) CHARACTER_LOWER_BOUND;
- for (int i = 0; i < len; i++, val++) {
- ret [i] = new Character (val);
- }
- return ret;
- }
-
- //-------------------------------------
- static Short [] createShorts ()
- {
- int len = SHORT_UPPER_BOUND - SHORT_LOWER_BOUND + 1;
- Short [] ret = new Short [len];
- short val = (short) SHORT_LOWER_BOUND;
- for (int i = 0; i < len; i++, val++) {
- ret [i] = new Short (val);
- }
- return ret;
- }
-
- //-------------------------------------
- static Integer [] createIntegers ()
- {
- int len = INTEGER_UPPER_BOUND - INTEGER_LOWER_BOUND + 1;
- Integer [] ret = new Integer [len];
- int val = (int) INTEGER_LOWER_BOUND;
- for (int i = 0; i < len; i++, val++) {
- ret [i] = new Integer (val);
- }
- return ret;
- }
-
- //-------------------------------------
- static Long [] createLongs ()
- {
- int len = LONG_UPPER_BOUND - LONG_LOWER_BOUND + 1;
- Long [] ret = new Long [len];
- long val = (long) LONG_LOWER_BOUND;
- for (int i = 0; i < len; i++, val++) {
- ret [i] = new Long (val);
+class PrimitiveObjects {
+ //-------------------------------------
+ // Constants
+ //-------------------------------------
+
+ static int BYTE_LOWER_BOUND = 0;
+ static int BYTE_UPPER_BOUND = 255;
+ static int CHARACTER_LOWER_BOUND = 0;
+ static int CHARACTER_UPPER_BOUND = 255;
+ static int SHORT_LOWER_BOUND = -1000;
+ static int SHORT_UPPER_BOUND = 1000;
+ static int INTEGER_LOWER_BOUND = -1000;
+ static int INTEGER_UPPER_BOUND = 1000;
+ static int LONG_LOWER_BOUND = -1000;
+ static int LONG_UPPER_BOUND = 1000;
+
+ //-------------------------------------
+ // Member variables
+ //-------------------------------------
+
+ static Byte[] mBytes = createBytes();
+ static Character[] mCharacters = createCharacters();
+ static Short[] mShorts = createShorts();
+ static Integer[] mIntegers = createIntegers();
+ static Long[] mLongs = createLongs();
+
+ //-------------------------------------
+ // Getting primitive values
+ //-------------------------------------
+
+ public static Boolean getBoolean(boolean pValue) {
+ return
+ pValue ?
+ Boolean.TRUE :
+ Boolean.FALSE;
+ }
+
+ //-------------------------------------
+
+ public static Byte getByte(byte pValue) {
+ if (pValue >= BYTE_LOWER_BOUND &&
+ pValue <= BYTE_UPPER_BOUND) {
+ return mBytes[((int) pValue) - BYTE_LOWER_BOUND];
+ } else {
+ return new Byte(pValue);
+ }
+ }
+
+ //-------------------------------------
+
+ public static Character getCharacter(char pValue) {
+ if (pValue >= CHARACTER_LOWER_BOUND &&
+ pValue <= CHARACTER_UPPER_BOUND) {
+ return mCharacters[((int) pValue) - CHARACTER_LOWER_BOUND];
+ } else {
+ return new Character(pValue);
+ }
+ }
+
+ //-------------------------------------
+
+ public static Short getShort(short pValue) {
+ if (pValue >= SHORT_LOWER_BOUND &&
+ pValue <= SHORT_UPPER_BOUND) {
+ return mShorts[((int) pValue) - SHORT_LOWER_BOUND];
+ } else {
+ return new Short(pValue);
+ }
+ }
+
+ //-------------------------------------
+
+ public static Integer getInteger(int pValue) {
+ if (pValue >= INTEGER_LOWER_BOUND &&
+ pValue <= INTEGER_UPPER_BOUND) {
+ return mIntegers[((int) pValue) - INTEGER_LOWER_BOUND];
+ } else {
+ return new Integer(pValue);
+ }
+ }
+
+ //-------------------------------------
+
+ public static Long getLong(long pValue) {
+ if (pValue >= LONG_LOWER_BOUND &&
+ pValue <= LONG_UPPER_BOUND) {
+ return mLongs[((int) pValue) - LONG_LOWER_BOUND];
+ } else {
+ return new Long(pValue);
+ }
+ }
+
+ //-------------------------------------
+
+ public static Float getFloat(float pValue) {
+ return new Float(pValue);
+ }
+
+ //-------------------------------------
+
+ public static Double getDouble(double pValue) {
+ return new Double(pValue);
+ }
+
+ //-------------------------------------
+ // Object class equivalents of primitive classes
+ //-------------------------------------
+
+ /**
+ * If the given class is a primitive class, returns the object
+ * version of that class. Otherwise, the class is just returned.
+ */
+ public static Class getPrimitiveObjectClass(Class pClass) {
+ if (pClass == Boolean.TYPE) {
+ return Boolean.class;
+ } else if (pClass == Byte.TYPE) {
+ return Byte.class;
+ } else if (pClass == Short.TYPE) {
+ return Short.class;
+ } else if (pClass == Character.TYPE) {
+ return Character.class;
+ } else if (pClass == Integer.TYPE) {
+ return Integer.class;
+ } else if (pClass == Long.TYPE) {
+ return Long.class;
+ } else if (pClass == Float.TYPE) {
+ return Float.class;
+ } else if (pClass == Double.TYPE) {
+ return Double.class;
+ } else {
+ return pClass;
+ }
+ }
+
+ //-------------------------------------
+ // Initializing the cached values
+ //-------------------------------------
+
+ static Byte[] createBytes() {
+ int len = BYTE_UPPER_BOUND - BYTE_LOWER_BOUND + 1;
+ Byte[] ret = new Byte[len];
+ byte val = (byte) BYTE_LOWER_BOUND;
+ for (int i = 0; i < len; i++, val++) {
+ ret[i] = new Byte(val);
+ }
+ return ret;
+ }
+
+ //-------------------------------------
+
+ static Character[] createCharacters() {
+ int len = CHARACTER_UPPER_BOUND - CHARACTER_LOWER_BOUND + 1;
+ Character[] ret = new Character[len];
+ char val = (char) CHARACTER_LOWER_BOUND;
+ for (int i = 0; i < len; i++, val++) {
+ ret[i] = new Character(val);
+ }
+ return ret;
+ }
+
+ //-------------------------------------
+
+ static Short[] createShorts() {
+ int len = SHORT_UPPER_BOUND - SHORT_LOWER_BOUND + 1;
+ Short[] ret = new Short[len];
+ short val = (short) SHORT_LOWER_BOUND;
+ for (int i = 0; i < len; i++, val++) {
+ ret[i] = new Short(val);
+ }
+ return ret;
+ }
+
+ //-------------------------------------
+
+ static Integer[] createIntegers() {
+ int len = INTEGER_UPPER_BOUND - INTEGER_LOWER_BOUND + 1;
+ Integer[] ret = new Integer[len];
+ int val = (int) INTEGER_LOWER_BOUND;
+ for (int i = 0; i < len; i++, val++) {
+ ret[i] = new Integer(val);
+ }
+ return ret;
+ }
+
+ //-------------------------------------
+
+ static Long[] createLongs() {
+ int len = LONG_UPPER_BOUND - LONG_LOWER_BOUND + 1;
+ Long[] ret = new Long[len];
+ long val = (long) LONG_LOWER_BOUND;
+ for (int i = 0; i < len; i++, val++) {
+ ret[i] = new Long(val);
+ }
+ return ret;
}
- return ret;
- }
- //-------------------------------------
+ //-------------------------------------
}
Modified: tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/PropertySuffix.java
URL: http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/PropertySuffix.java?rev=1037284&r1=1037283&r2=1037284&view=diff
==============================================================================
--- tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/PropertySuffix.java (original)
+++ tomcat/taglibs/standard/trunk/jstlel/src/main/java/org/apache/taglibs/standard/lang/jstl/PropertySuffix.java Sat Nov 20 18:14:00 2010
@@ -13,84 +13,82 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- */
+ */
package org.apache.taglibs.standard.lang.jstl;
import java.util.Map;
/**
- *
* <p>Represents an operator that obtains the value of another value's
* property. This is a specialization of ArraySuffix - a.b is
* equivalent to a["b"]
- *
+ *
* @author Nathan Abramson - Art Technology Group
* @author Shawn Bayern
* @version $Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author$
- **/
+ */
public class PropertySuffix
- extends ArraySuffix
-{
- //-------------------------------------
- // Properties
- //-------------------------------------
- // property name
-
- String mName;
- public String getName ()
- { return mName; }
- public void setName (String pName)
- { mName = pName; }
-
- //-------------------------------------
- /**
- *
- * Constructor
- **/
- public PropertySuffix (String pName)
- {
- super (null);
- mName = pName;
- }
-
- //-------------------------------------
- /**
- *
- * Gets the value of the index
- **/
- Object evaluateIndex (Object pContext,
- VariableResolver pResolver,
- Map functions,
- String defaultPrefix,
- Logger pLogger)
- throws ELException
- {
- return mName;
- }
-
- //-------------------------------------
- /**
- *
- * Returns the operator symbol
- **/
- String getOperatorSymbol ()
- {
- return ".";
- }
-
- //-------------------------------------
- // ValueSuffix methods
- //-------------------------------------
- /**
- *
- * Returns the expression in the expression language syntax
- **/
- public String getExpressionString ()
- {
- return "." + StringLiteral.toIdentifierToken (mName);
- }
+ extends ArraySuffix {
+ //-------------------------------------
+ // Properties
+ //-------------------------------------
+ // property name
+
+ String mName;
+
+ public String getName() {
+ return mName;
+ }
+
+ public void setName(String pName) {
+ mName = pName;
+ }
+
+ //-------------------------------------
+
+ /**
+ * Constructor
+ */
+ public PropertySuffix(String pName) {
+ super(null);
+ mName = pName;
+ }
+
+ //-------------------------------------
+
+ /**
+ * Gets the value of the index
+ */
+ Object evaluateIndex(Object pContext,
+ VariableResolver pResolver,
+ Map functions,
+ String defaultPrefix,
+ Logger pLogger)
+ throws ELException {
+ return mName;
+ }
+
+ //-------------------------------------
+
+ /**
+ * Returns the operator symbol
+ */
+ String getOperatorSymbol() {
+ return ".";
+ }
+
+ //-------------------------------------
+ // ValueSuffix methods
+ //-------------------------------------
+
+ /**
+ * Returns the expression in the expression language syntax
+ */
+ public String getExpressionString() {
+ return "." + StringLiteral.toIdentifierToken(mName);
+ }
- //-------------------------------------
+ //-------------------------------------
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org