/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* 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.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 javax.servlet.jsp;
/**
- * Contains information about an error, for error pages.
- * The information contained in this instance is meaningless if not used
- * in the context of an error page. To indicate a JSP is an error page,
- * the page author must set the isErrorPage attribute of the page directive
- * to "true".
- *
+ * Contains information about an error, for error pages. The information
+ * contained in this instance is meaningless if not used in the context of an
+ * error page. To indicate a JSP is an error page, the page author must set the
+ * isErrorPage attribute of the page directive to "true".
+ *
* @see PageContext#getErrorData
* @since 2.0
*/
-
public final class ErrorData {
private Throwable throwable;
/**
* Creates a new ErrorData object.
- *
- * @param throwable The Throwable that is the cause of the error
- * @param statusCode The status code of the error
- * @param uri The request URI
- * @param servletName The name of the servlet invoked
+ *
+ * @param throwable
+ * The Throwable that is the cause of the error
+ * @param statusCode
+ * The status code of the error
+ * @param uri
+ * The request URI
+ * @param servletName
+ * The name of the servlet invoked
*/
- public ErrorData( Throwable throwable, int statusCode, String uri,
- String servletName )
- {
- this.throwable = throwable;
- this.statusCode = statusCode;
- this.uri = uri;
- this.servletName = servletName;
+ public ErrorData(Throwable throwable, int statusCode, String uri,
+ String servletName) {
+ this.throwable = throwable;
+ this.statusCode = statusCode;
+ this.uri = uri;
+ this.servletName = servletName;
}
/**
* Returns the Throwable that caused the error.
- *
+ *
* @return The Throwable that caused the error
*/
public Throwable getThrowable() {
- return this.throwable;
+ return this.throwable;
}
/**
* Returns the status code of the error.
- *
+ *
* @return The status code of the error
*/
public int getStatusCode() {
- return this.statusCode;
+ return this.statusCode;
}
/**
* Returns the request URI.
- *
+ *
* @return The request URI
*/
public String getRequestURI() {
- return this.uri;
+ return this.uri;
}
/**
* Returns the name of the servlet invoked.
- *
+ *
* @return The name of the servlet invoked
*/
public String getServletName() {
- return this.servletName;
+ return this.servletName;
}
}
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* 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.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 javax.servlet.jsp;
import javax.el.ELContextListener;
* <p>
* Stores <i>application</i>-scoped information for the JSP container.
* </p>
+ *
* @since 2.1
*/
public interface JspApplicationContext {
- /**
- * <p>
- * Registers an <code>ELContextListener</code> that will notified whenever
- * a new <code>ELContext</code> is created.
- * </p>
- * <p>
- * At the very least, any <code>ELContext</code> instantiated will have reference
- * to the <code>JspContext</code> under <code>JspContext.class</code>.
- * </p>
- *
- * @param listener
- */
- public void addELContextListener(ELContextListener listener);
-
- /**
- * <p>
- * Adds an <code>ELResolver</code> to the chain of EL variable and property management
- * within JSP pages and Tag files.
- * </p>
- * <p>
- * JSP has a default set of ELResolvers to chain for all EL evaluation:
- * <ul>
- * <li><code>ImplicitObjectELResolver</code></li>
- * <li><code>ELResolver</code> instances registered with this method</li>
- * <li><code>MapELResolver</code></li>
- * <li><code>ListELResolver</code></li>
- * <li><code>ArrayELResolver</code></li>
- * <li><code>BeanELResolver</code></li>
- * <li><code>ScopedAttributeELResolver</code></li>
- * </ul>
- * </p>
- *
- * @param resolver an additional resolver
- * @throws IllegalStateException if called after the application's <code>ServletContextListeners</code> have been initialized.
- */
- public void addELResolver(ELResolver resolver) throws IllegalStateException;
-
- /**
- * <p>
- * Returns the JSP container's <code>ExpressionFactory</code> implementation for EL use.
- * </p>
- *
- * @return an <code>ExpressionFactory</code> implementation
- */
- public ExpressionFactory getExpressionFactory();
-
+ /**
+ * <p>
+ * Registers an <code>ELContextListener</code> that will notified whenever a
+ * new <code>ELContext</code> is created.
+ * </p>
+ * <p>
+ * At the very least, any <code>ELContext</code> instantiated will have
+ * reference to the <code>JspContext</code> under
+ * <code>JspContext.class</code>.
+ * </p>
+ *
+ * @param listener
+ */
+ public void addELContextListener(ELContextListener listener);
+
+ /**
+ * <p>
+ * Adds an <code>ELResolver</code> to the chain of EL variable and property
+ * management within JSP pages and Tag files.
+ * </p>
+ * <p>
+ * JSP has a default set of ELResolvers to chain for all EL evaluation:
+ * <ul>
+ * <li><code>ImplicitObjectELResolver</code></li>
+ * <li><code>ELResolver</code> instances registered with this method</li>
+ * <li><code>MapELResolver</code></li>
+ * <li><code>ListELResolver</code></li>
+ * <li><code>ArrayELResolver</code></li>
+ * <li><code>BeanELResolver</code></li>
+ * <li><code>ScopedAttributeELResolver</code></li>
+ * </ul>
+ * </p>
+ *
+ * @param resolver
+ * an additional resolver
+ * @throws IllegalStateException
+ * if called after the application's
+ * <code>ServletContextListeners</code> have been initialized.
+ */
+ public void addELResolver(ELResolver resolver) throws IllegalStateException;
+
+ /**
+ * <p>
+ * Returns the JSP container's <code>ExpressionFactory</code> implementation
+ * for EL use.
+ * </p>
+ *
+ * @return an <code>ExpressionFactory</code> implementation
+ */
+ public ExpressionFactory getExpressionFactory();
+
}
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* 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.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 javax.servlet.jsp;
/**
- * Exception to be used by a Tag Handler to indicate some unrecoverable
- * error.
+ * Exception to be used by a Tag Handler to indicate some unrecoverable error.
* This error is to be caught by the top level of the JSP page and will result
* in an error page.
*/
-
public class JspTagException extends JspException {
+
/**
- * Constructs a new JspTagException with the specified message.
- * The message can be written to the server log and/or displayed
- * for the user.
+ * Constructs a new JspTagException with the specified message. The message
+ * can be written to the server log and/or displayed for the user.
*
- * @param msg a <code>String</code> specifying the text of
- * the exception message
+ * @param msg
+ * a <code>String</code> specifying the text of the exception
+ * message
*/
public JspTagException(String msg) {
- super( msg );
+ super(msg);
}
/**
* Constructs a new JspTagException with no message.
*/
public JspTagException() {
- super();
+ super();
}
/**
- * Constructs a new JspTagException when the JSP Tag
- * needs to throw an exception and include a message
- * about the "root cause" exception that interfered with its
- * normal operation, including a description message.
- *
- *
- * @param message a <code>String</code> containing
- * the text of the exception message
- *
- * @param rootCause the <code>Throwable</code> exception
- * that interfered with the JSP Tag's
- * normal operation, making this JSP Tag
- * exception necessary
- *
+ * Constructs a new JspTagException when the JSP Tag needs to throw an
+ * exception and include a message about the "root cause" exception that
+ * interfered with its normal operation, including a description message.
+ *
+ * @param message
+ * a <code>String</code> containing the text of the exception
+ * message
+ * @param rootCause
+ * the <code>Throwable</code> exception that interfered with the
+ * JSP Tag's normal operation, making this JSP Tag exception
+ * necessary
* @since 2.0
*/
public JspTagException(String message, Throwable rootCause) {
- super( message, rootCause );
+ super(message, rootCause);
}
-
/**
- * Constructs a new JSP Tag exception when the JSP Tag
- * needs to throw an exception and include a message
- * about the "root cause" exception that interfered with its
- * normal operation. The exception's message is based on the localized
- * message of the underlying exception.
- *
- * <p>This method calls the <code>getLocalizedMessage</code> method
- * on the <code>Throwable</code> exception to get a localized exception
- * message. When subclassing <code>JspTagException</code>,
- * this method can be overridden to create an exception message
- * designed for a specific locale.
- *
- * @param rootCause the <code>Throwable</code> exception
- * that interfered with the JSP Tag's
- * normal operation, making the JSP Tag
- * exception necessary
- *
+ * Constructs a new JSP Tag exception when the JSP Tag needs to throw an
+ * exception and include a message about the "root cause" exception that
+ * interfered with its normal operation. The exception's message is based on
+ * the localized message of the underlying exception.
+ * <p>
+ * This method calls the <code>getLocalizedMessage</code> method on the
+ * <code>Throwable</code> exception to get a localized exception message.
+ * When subclassing <code>JspTagException</code>, this method can be
+ * overridden to create an exception message designed for a specific locale.
+ *
+ * @param rootCause
+ * the <code>Throwable</code> exception that interfered with the
+ * JSP Tag's normal operation, making the JSP Tag exception
+ * necessary
* @since 2.0
*/
-
public JspTagException(Throwable rootCause) {
- super( rootCause );
+ super(rootCause);
}
-
}
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* 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.
-*/
-
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 javax.servlet.jsp;
import java.io.IOException;
/**
* <p>
- * The actions and template data in a JSP page is written using the
- * JspWriter object that is referenced by the implicit variable out which
- * is initialized automatically using methods in the PageContext object.
+ * The actions and template data in a JSP page is written using the JspWriter
+ * object that is referenced by the implicit variable out which is initialized
+ * automatically using methods in the PageContext object.
*<p>
* This abstract class emulates some of the functionality found in the
- * java.io.BufferedWriter and java.io.PrintWriter classes,
- * however it differs in that it throws java.io.IOException from the print
- * methods while PrintWriter does not.
- * <p><B>Buffering</B>
+ * java.io.BufferedWriter and java.io.PrintWriter classes, however it differs in
+ * that it throws java.io.IOException from the print methods while PrintWriter
+ * does not.
+ * <p>
+ * <B>Buffering</B>
* <p>
- * The initial JspWriter object is associated with the PrintWriter object
- * of the ServletResponse in a way that depends on whether the page is or
- * is not buffered. If the page is not buffered, output written to this
- * JspWriter object will be written through to the PrintWriter directly,
- * which will be created if necessary by invoking the getWriter() method
- * on the response object. But if the page is buffered, the PrintWriter
- * object will not be created until the buffer is flushed and
- * operations like setContentType() are legal. Since this flexibility
- * simplifies programming substantially, buffering is the default for JSP
- * pages.
+ * The initial JspWriter object is associated with the PrintWriter object of the
+ * ServletResponse in a way that depends on whether the page is or is not
+ * buffered. If the page is not buffered, output written to this JspWriter
+ * object will be written through to the PrintWriter directly, which will be
+ * created if necessary by invoking the getWriter() method on the response
+ * object. But if the page is buffered, the PrintWriter object will not be
+ * created until the buffer is flushed and operations like setContentType() are
+ * legal. Since this flexibility simplifies programming substantially, buffering
+ * is the default for JSP pages.
* <p>
- * Buffering raises the issue of what to do when the buffer is
- * exceeded. Two approaches can be taken:
+ * Buffering raises the issue of what to do when the buffer is exceeded. Two
+ * approaches can be taken:
* <ul>
- * <li>
- * Exceeding the buffer is not a fatal error; when the buffer is
- * exceeded, just flush the output.
- * <li>
- * Exceeding the buffer is a fatal error; when the buffer is exceeded,
- * raise an exception.
+ * <li>Exceeding the buffer is not a fatal error; when the buffer is exceeded,
+ * just flush the output.
+ * <li>Exceeding the buffer is a fatal error; when the buffer is exceeded, raise
+ * an exception.
* </ul>
* <p>
- * Both approaches are valid, and thus both are supported in the JSP
- * technology. The behavior of a page is controlled by the autoFlush
- * attribute, which defaults to true. In general, JSP pages that need to
- * be sure that correct and complete data has been sent to their client
- * may want to set autoFlush to false, with a typical case being that
- * where the client is an application itself. On the other hand, JSP
- * pages that send data that is meaningful even when partially
- * constructed may want to set autoFlush to true; such as when the
- * data is sent for immediate display through a browser. Each application
+ * Both approaches are valid, and thus both are supported in the JSP technology.
+ * The behavior of a page is controlled by the autoFlush attribute, which
+ * defaults to true. In general, JSP pages that need to be sure that correct and
+ * complete data has been sent to their client may want to set autoFlush to
+ * false, with a typical case being that where the client is an application
+ * itself. On the other hand, JSP pages that send data that is meaningful even
+ * when partially constructed may want to set autoFlush to true; such as when
+ * the data is sent for immediate display through a browser. Each application
* will need to consider their specific needs.
* <p>
- * An alternative considered was to make the buffer size unbounded; but,
- * this had the disadvantage that runaway computations would consume an
- * unbounded amount of resources.
+ * An alternative considered was to make the buffer size unbounded; but, this
+ * had the disadvantage that runaway computations would consume an unbounded
+ * amount of resources.
* <p>
- * The "out" implicit variable of a JSP implementation class is of this type.
- * If the page directive selects autoflush="true" then all the I/O operations
- * on this class shall automatically flush the contents of the buffer if an
+ * The "out" implicit variable of a JSP implementation class is of this type. If
+ * the page directive selects autoflush="true" then all the I/O operations on
+ * this class shall automatically flush the contents of the buffer if an
* overflow condition would result if the current operation were performed
* without a flush. If autoflush="false" then all the I/O operations on this
* class shall throw an IOException if performing the current operation would
* result in a buffer overflow condition.
- *
+ *
* @see java.io.Writer
* @see java.io.BufferedWriter
* @see java.io.PrintWriter
*/
-
abstract public class JspWriter extends java.io.Writer {
/**
* Constant indicating that the Writer is not buffering output.
*/
-
- public static final int NO_BUFFER = 0;
+ public static final int NO_BUFFER = 0;
/**
* Constant indicating that the Writer is buffered and is using the
* implementation default buffer size.
*/
-
- public static final int DEFAULT_BUFFER = -1;
+ public static final int DEFAULT_BUFFER = -1;
/**
- * Constant indicating that the Writer is buffered and is unbounded; this
- * is used in BodyContent.
+ * Constant indicating that the Writer is buffered and is unbounded; this is
+ * used in BodyContent.
*/
-
- public static final int UNBOUNDED_BUFFER = -2;
+ public static final int UNBOUNDED_BUFFER = -2;
/**
* Protected constructor.
- *
- * @param bufferSize the size of the buffer to be used by the JspWriter
- * @param autoFlush whether the JspWriter should be autoflushing
+ *
+ * @param bufferSize
+ * the size of the buffer to be used by the JspWriter
+ * @param autoFlush
+ * whether the JspWriter should be autoflushing
*/
-
protected JspWriter(int bufferSize, boolean autoFlush) {
- this.bufferSize = bufferSize;
- this.autoFlush = autoFlush;
+ this.bufferSize = bufferSize;
+ this.autoFlush = autoFlush;
}
/**
- * Write a line separator. The line separator string is defined by the
+ * Write a line separator. The line separator string is defined by the
* system property <tt>line.separator</tt>, and is not necessarily a single
* newline ('\n') character.
- *
- * @exception IOException If an I/O error occurs
+ *
+ * @exception IOException
+ * If an I/O error occurs
*/
-
abstract public void newLine() throws IOException;
/**
- * Print a boolean value. The string produced by <code>{@link
- * java.lang.String#valueOf(boolean)}</code> is written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param b The <code>boolean</code> to be printed
- * @throws java.io.IOException If an error occurred while writing
+ * Print a boolean value. The string produced by <code>{@link
+ * java.lang.String#valueOf(boolean)}</code>
+ * is written to the JspWriter's buffer or, if no buffer is used, directly
+ * to the underlying writer.
+ *
+ * @param b
+ * The <code>boolean</code> to be printed
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void print(boolean b) throws IOException;
/**
- * Print a character. The character is written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param c The <code>char</code> to be printed
- * @throws java.io.IOException If an error occurred while writing
+ * Print a character. The character is written to the JspWriter's buffer or,
+ * if no buffer is used, directly to the underlying writer.
+ *
+ * @param c
+ * The <code>char</code> to be printed
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void print(char c) throws IOException;
/**
- * Print an integer. The string produced by <code>{@link
- * java.lang.String#valueOf(int)}</code> is written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param i The <code>int</code> to be printed
- * @see java.lang.Integer#toString(int)
- * @throws java.io.IOException If an error occurred while writing
+ * Print an integer. The string produced by <code>{@link
+ * java.lang.String#valueOf(int)}</code>
+ * is written to the JspWriter's buffer or, if no buffer is used, directly
+ * to the underlying writer.
+ *
+ * @param i
+ * The <code>int</code> to be printed
+ * @see java.lang.Integer#toString(int)
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void print(int i) throws IOException;
/**
- * Print a long integer. The string produced by <code>{@link
- * java.lang.String#valueOf(long)}</code> is written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param l The <code>long</code> to be printed
- * @see java.lang.Long#toString(long)
- * @throws java.io.IOException If an error occurred while writing
+ * Print a long integer. The string produced by <code>{@link
+ * java.lang.String#valueOf(long)}</code>
+ * is written to the JspWriter's buffer or, if no buffer is used, directly
+ * to the underlying writer.
+ *
+ * @param l
+ * The <code>long</code> to be printed
+ * @see java.lang.Long#toString(long)
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void print(long l) throws IOException;
/**
- * Print a floating-point number. The string produced by <code>{@link
- * java.lang.String#valueOf(float)}</code> is written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param f The <code>float</code> to be printed
- * @see java.lang.Float#toString(float)
- * @throws java.io.IOException If an error occurred while writing
+ * Print a floating-point number. The string produced by <code>{@link
+ * java.lang.String#valueOf(float)}</code>
+ * is written to the JspWriter's buffer or, if no buffer is used, directly
+ * to the underlying writer.
+ *
+ * @param f
+ * The <code>float</code> to be printed
+ * @see java.lang.Float#toString(float)
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void print(float f) throws IOException;
/**
- * Print a double-precision floating-point number. The string produced by
- * <code>{@link java.lang.String#valueOf(double)}</code> is written to
- * the JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param d The <code>double</code> to be printed
- * @see java.lang.Double#toString(double)
- * @throws java.io.IOException If an error occurred while writing
+ * Print a double-precision floating-point number. The string produced by
+ * <code>{@link java.lang.String#valueOf(double)}</code> is written to the
+ * JspWriter's buffer or, if no buffer is used, directly to the underlying
+ * writer.
+ *
+ * @param d
+ * The <code>double</code> to be printed
+ * @see java.lang.Double#toString(double)
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void print(double d) throws IOException;
/**
- * Print an array of characters. The characters are written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param s The array of chars to be printed
- *
- * @throws NullPointerException If <code>s</code> is <code>null</code>
- * @throws java.io.IOException If an error occurred while writing
+ * Print an array of characters. The characters are written to the
+ * JspWriter's buffer or, if no buffer is used, directly to the underlying
+ * writer.
+ *
+ * @param s
+ * The array of chars to be printed
+ * @throws NullPointerException
+ * If <code>s</code> is <code>null</code>
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void print(char s[]) throws IOException;
/**
- * Print a string. If the argument is <code>null</code> then the string
- * <code>"null"</code> is printed. Otherwise, the string's characters are
- * written to the JspWriter's buffer or, if no buffer is used, directly
- * to the underlying writer.
- *
- * @param s The <code>String</code> to be printed
- * @throws java.io.IOException If an error occurred while writing
+ * Print a string. If the argument is <code>null</code> then the string
+ * <code>"null"</code> is printed. Otherwise, the string's characters are
+ * written to the JspWriter's buffer or, if no buffer is used, directly to
+ * the underlying writer.
+ *
+ * @param s
+ * The <code>String</code> to be printed
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void print(String s) throws IOException;
/**
- * Print an object. The string produced by the <code>{@link
- * java.lang.String#valueOf(Object)}</code> method is written to the
- * JspWriter's buffer or, if no buffer is used, directly to the
- * underlying writer.
- *
- * @param obj The <code>Object</code> to be printed
- * @see java.lang.Object#toString()
- * @throws java.io.IOException If an error occurred while writing
+ * Print an object. The string produced by the <code>{@link
+ * java.lang.String#valueOf(Object)}</code>
+ * method is written to the JspWriter's buffer or, if no buffer is used,
+ * directly to the underlying writer.
+ *
+ * @param obj
+ * The <code>Object</code> to be printed
+ * @see java.lang.Object#toString()
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void print(Object obj) throws IOException;
/**
- * Terminate the current line by writing the line separator string. The
- * line separator string is defined by the system property
+ * Terminate the current line by writing the line separator string. The line
+ * separator string is defined by the system property
* <code>line.separator</code>, and is not necessarily a single newline
* character (<code>'\n'</code>).
- * @throws java.io.IOException If an error occurred while writing
+ *
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void println() throws IOException;
/**
- * Print a boolean value and then terminate the line. This method behaves
- * as though it invokes <code>{@link #print(boolean)}</code> and then
+ * Print a boolean value and then terminate the line. This method behaves as
+ * though it invokes <code>{@link #print(boolean)}</code> and then
* <code>{@link #println()}</code>.
- *
- * @param x the boolean to write
- * @throws java.io.IOException If an error occurred while writing
+ *
+ * @param x
+ * the boolean to write
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void println(boolean x) throws IOException;
/**
- * Print a character and then terminate the line. This method behaves as
+ * Print a character and then terminate the line. This method behaves as
* though it invokes <code>{@link #print(char)}</code> and then <code>{@link
- * #println()}</code>.
- *
- * @param x the char to write
- * @throws java.io.IOException If an error occurred while writing
+ * #println()}</code>
+ * .
+ *
+ * @param x
+ * the char to write
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void println(char x) throws IOException;
/**
- * Print an integer and then terminate the line. This method behaves as
+ * Print an integer and then terminate the line. This method behaves as
* though it invokes <code>{@link #print(int)}</code> and then <code>{@link
- * #println()}</code>.
- *
- * @param x the int to write
- * @throws java.io.IOException If an error occurred while writing
+ * #println()}</code>
+ * .
+ *
+ * @param x
+ * the int to write
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void println(int x) throws IOException;
/**
- * Print a long integer and then terminate the line. This method behaves
- * as though it invokes <code>{@link #print(long)}</code> and then
+ * Print a long integer and then terminate the line. This method behaves as
+ * though it invokes <code>{@link #print(long)}</code> and then
* <code>{@link #println()}</code>.
- *
- * @param x the long to write
- * @throws java.io.IOException If an error occurred while writing
+ *
+ * @param x
+ * the long to write
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void println(long x) throws IOException;
/**
- * Print a floating-point number and then terminate the line. This method
+ * Print a floating-point number and then terminate the line. This method
* behaves as though it invokes <code>{@link #print(float)}</code> and then
* <code>{@link #println()}</code>.
- *
- * @param x the float to write
- * @throws java.io.IOException If an error occurred while writing
+ *
+ * @param x
+ * the float to write
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void println(float x) throws IOException;
/**
* Print a double-precision floating-point number and then terminate the
- * line. This method behaves as though it invokes <code>{@link
- * #print(double)}</code> and then <code>{@link #println()}</code>.
- *
- * @param x the double to write
- * @throws java.io.IOException If an error occurred while writing
+ * line. This method behaves as though it invokes <code>{@link
+ * #print(double)}</code> and
+ * then <code>{@link #println()}</code>.
+ *
+ * @param x
+ * the double to write
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void println(double x) throws IOException;
/**
- * Print an array of characters and then terminate the line. This method
+ * Print an array of characters and then terminate the line. This method
* behaves as though it invokes <code>print(char[])</code> and then
* <code>println()</code>.
- *
- * @param x the char[] to write
- * @throws java.io.IOException If an error occurred while writing
+ *
+ * @param x
+ * the char[] to write
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void println(char x[]) throws IOException;
/**
- * Print a String and then terminate the line. This method behaves as
- * though it invokes <code>{@link #print(String)}</code> and then
+ * Print a String and then terminate the line. This method behaves as though
+ * it invokes <code>{@link #print(String)}</code> and then
* <code>{@link #println()}</code>.
- *
- * @param x the String to write
- * @throws java.io.IOException If an error occurred while writing
+ *
+ * @param x
+ * the String to write
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void println(String x) throws IOException;
/**
- * Print an Object and then terminate the line. This method behaves as
+ * Print an Object and then terminate the line. This method behaves as
* though it invokes <code>{@link #print(Object)}</code> and then
* <code>{@link #println()}</code>.
- *
- * @param x the Object to write
- * @throws java.io.IOException If an error occurred while writing
+ *
+ * @param x
+ * the Object to write
+ * @throws java.io.IOException
+ * If an error occurred while writing
*/
-
abstract public void println(Object x) throws IOException;
-
/**
- * Clear the contents of the buffer. If the buffer has been already
- * been flushed then the clear operation shall throw an IOException
- * to signal the fact that some data has already been irrevocably
- * written to the client response stream.
- *
- * @throws IOException If an I/O error occurs
+ * Clear the contents of the buffer. If the buffer has been already been
+ * flushed then the clear operation shall throw an IOException to signal the
+ * fact that some data has already been irrevocably written to the client
+ * response stream.
+ *
+ * @throws IOException
+ * If an I/O error occurs
*/
-
abstract public void clear() throws IOException;
/**
- * Clears the current contents of the buffer. Unlike clear(), this
- * method will not throw an IOException if the buffer has already been
- * flushed. It merely clears the current content of the buffer and
- * returns.
- *
- * @throws IOException If an I/O error occurs
+ * Clears the current contents of the buffer. Unlike clear(), this method
+ * will not throw an IOException if the buffer has already been flushed. It
+ * merely clears the current content of the buffer and returns.
+ *
+ * @throws IOException
+ * If an I/O error occurs
*/
-
abstract public void clearBuffer() throws IOException;
/**
- * Flush the stream. If the stream has saved any characters from the
- * various write() methods in a buffer, write them immediately to their
- * intended destination. Then, if that destination is another character or
- * byte stream, flush it. Thus one flush() invocation will flush all the
- * buffers in a chain of Writers and OutputStreams.
+ * Flush the stream. If the stream has saved any characters from the various
+ * write() methods in a buffer, write them immediately to their intended
+ * destination. Then, if that destination is another character or byte
+ * stream, flush it. Thus one flush() invocation will flush all the buffers
+ * in a chain of Writers and OutputStreams.
* <p>
* The method may be invoked indirectly if the buffer size is exceeded.
* <p>
- * Once a stream has been closed,
- * further write() or flush() invocations will cause an IOException to be
- * thrown.
- *
- * @exception IOException If an I/O error occurs
+ * Once a stream has been closed, further write() or flush() invocations
+ * will cause an IOException to be thrown.
+ *
+ * @exception IOException
+ * If an I/O error occurs
*/
-
@Override
abstract public void flush() throws IOException;
/**
* Close the stream, flushing it first.
* <p>
- * This method needs not be invoked explicitly for the initial JspWriter
- * as the code generated by the JSP container will automatically
- * include a call to close().
+ * This method needs not be invoked explicitly for the initial JspWriter as
+ * the code generated by the JSP container will automatically include a call
+ * to close().
* <p>
* Closing a previously-closed stream, unlike flush(), has no effect.
- *
- * @exception IOException If an I/O error occurs
+ *
+ * @exception IOException
+ * If an I/O error occurs
*/
-
@Override
abstract public void close() throws IOException;
/**
* This method returns the size of the buffer used by the JspWriter.
- *
+ *
* @return the size of the buffer in bytes, or 0 is unbuffered.
*/
-
- public int getBufferSize() { return bufferSize; }
+ public int getBufferSize() {
+ return bufferSize;
+ }
/**
* This method returns the number of unused bytes in the buffer.
- *
+ *
* @return the number of bytes unused in the buffer
*/
-
abstract public int getRemaining();
/**
* This method indicates whether the JspWriter is autoFlushing.
- *
- * @return if this JspWriter is auto flushing or throwing IOExceptions
- * on buffer overflow conditions
+ *
+ * @return if this JspWriter is auto flushing or throwing IOExceptions on
+ * buffer overflow conditions
*/
-
- public boolean isAutoFlush() { return autoFlush; }
+ public boolean isAutoFlush() {
+ return autoFlush;
+ }
/*
* fields
/**
* The size of the buffer used by the JspWriter.
*/
- protected int bufferSize;
-
+ protected int bufferSize;
+
/**
* Whether the JspWriter is autoflushing.
*/
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* 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.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 javax.servlet.jsp;
/**
- * Exception to indicate the calling page must cease evaluation.
- * Thrown by a simple tag handler to indicate that the remainder of
- * the page must not be evaluated. The result is propagated back to
- * the page in the case where one tag invokes another (as can be
- * the case with tag files). The effect is similar to that of a
- * Classic Tag Handler returning Tag.SKIP_PAGE from doEndTag().
- * Jsp Fragments may also throw this exception. This exception
+ * Exception to indicate the calling page must cease evaluation. Thrown by a
+ * simple tag handler to indicate that the remainder of the page must not be
+ * evaluated. The result is propagated back to the page in the case where one
+ * tag invokes another (as can be the case with tag files). The effect is
+ * similar to that of a Classic Tag Handler returning Tag.SKIP_PAGE from
+ * doEndTag(). Jsp Fragments may also throw this exception. This exception
* should not be thrown manually in a JSP page or tag file - the behavior is
- * undefined. The exception is intended to be thrown inside
- * SimpleTag handlers and in JSP fragments.
+ * undefined. The exception is intended to be thrown inside SimpleTag handlers
+ * and in JSP fragments.
*
* @see javax.servlet.jsp.tagext.SimpleTag#doTag
* @see javax.servlet.jsp.tagext.JspFragment#invoke
* @see javax.servlet.jsp.tagext.Tag#doEndTag
* @since 2.0
*/
-public class SkipPageException
- extends JspException
-{
+public class SkipPageException extends JspException {
+
/**
* Creates a SkipPageException with no message.
*/
public SkipPageException() {
super();
}
-
+
/**
* Creates a SkipPageException with the provided message.
- *
- * @param message the detail message
+ *
+ * @param message
+ * the detail message
*/
- public SkipPageException( String message ) {
- super( message );
+ public SkipPageException(String message) {
+ super(message);
}
/**
* Creates a SkipPageException with the provided message and root cause.
- *
- * @param message the detail message
- * @param rootCause the originating cause of this exception
+ *
+ * @param message
+ * the detail message
+ * @param rootCause
+ * the originating cause of this exception
*/
- public SkipPageException( String message, Throwable rootCause ) {
- super( message, rootCause );
+ public SkipPageException(String message, Throwable rootCause) {
+ super(message, rootCause);
}
/**
* Creates a SkipPageException with the provided root cause.
- *
- * @param rootCause the originating cause of this exception
+ *
+ * @param rootCause
+ * the originating cause of this exception
*/
- public SkipPageException( Throwable rootCause ) {
- super( rootCause );
+ public SkipPageException(Throwable rootCause) {
+ super(rootCause);
}
-
}
-
-
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* 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.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 javax.servlet.jsp.el;
-
/**
- * <p>The abstract base class for an expression-language evaluator.
- * Classes that implement an expression language expose their functionality
- * via this abstract class.</p>
- *
- * <p>An instance of the ExpressionEvaluator can be obtained via the
- * JspContext / PageContext</p>
- *
- * <p>The parseExpression() and evaluate() methods must be thread-safe.
- * That is, multiple threads may call these methods on the same
- * ExpressionEvaluator object simultaneously. Implementations should
- * synchronize access if they depend on transient state. Implementations
- * should not, however, assume that only one object of each
- * ExpressionEvaluator type will be instantiated; global caching should
- * therefore be static.</p>
- *
- * <p>Only a single EL expression, starting with '${' and ending with
- * '}', can be parsed or evaluated at a time. EL expressions
- * cannot be mixed with static text. For example, attempting to
- * parse or evaluate "<code>abc${1+1}def${1+1}ghi</code>" or even
- * "<code>${1+1}${1+1}</code>" will cause an <code>ELException</code> to
- * be thrown.</p>
- *
- * <p>The following are examples of syntactically legal EL expressions:
- *
+ * <p>
+ * The abstract base class for an expression-language evaluator. Classes that
+ * implement an expression language expose their functionality via this abstract
+ * class.
+ * </p>
+ * <p>
+ * An instance of the ExpressionEvaluator can be obtained via the JspContext /
+ * PageContext
+ * </p>
+ * <p>
+ * The parseExpression() and evaluate() methods must be thread-safe. That is,
+ * multiple threads may call these methods on the same ExpressionEvaluator
+ * object simultaneously. Implementations should synchronize access if they
+ * depend on transient state. Implementations should not, however, assume that
+ * only one object of each ExpressionEvaluator type will be instantiated; global
+ * caching should therefore be static.
+ * </p>
+ * <p>
+ * Only a single EL expression, starting with '${' and ending with '}', can be
+ * parsed or evaluated at a time. EL expressions cannot be mixed with static
+ * text. For example, attempting to parse or evaluate "
+ * <code>abc${1+1}def${1+1}ghi</code>" or even "<code>${1+1}${1+1}</code>" will
+ * cause an <code>ELException</code> to be thrown.
+ * </p>
+ * <p>
+ * The following are examples of syntactically legal EL expressions:
* <ul>
- * <li><code>${person.lastName}</code></li>
- * <li><code>${8 * 8}</code></li>
- * <li><code>${my:reverse('hello')}</code></li>
+ * <li><code>${person.lastName}</code></li>
+ * <li><code>${8 * 8}</code></li>
+ * <li><code>${my:reverse('hello')}</code></li>
* </ul>
* </p>
- *
+ *
* @since 2.0
* @deprecated
*/
-@SuppressWarnings("dep-ann") // TCK signature test fails with annotation
+@SuppressWarnings("dep-ann")
+// TCK signature test fails with annotation
public abstract class ExpressionEvaluator {
/**
- * Prepare an expression for later evaluation. This method should perform
- * syntactic validation of the expression; if in doing so it detects
- * errors, it should raise an ELParseException.
- *
- * @param expression The expression to be evaluated.
- * @param expectedType The expected type of the result of the evaluation
- * @param fMapper A FunctionMapper to resolve functions found in
- * the expression. It can be null, in which case no functions
- * are supported for this invocation. The ExpressionEvaluator
- * must not hold on to the FunctionMapper reference after
- * returning from <code>parseExpression()</code>. The
- * <code>Expression</code> object returned must invoke the same
- * functions regardless of whether the mappings in the
- * provided <code>FunctionMapper</code> instance change between
- * calling <code>ExpressionEvaluator.parseExpression()</code>
- * and <code>Expression.evaluate()</code>.
+ * Prepare an expression for later evaluation. This method should perform
+ * syntactic validation of the expression; if in doing so it detects errors,
+ * it should raise an ELParseException.
+ *
+ * @param expression
+ * The expression to be evaluated.
+ * @param expectedType
+ * The expected type of the result of the evaluation
+ * @param fMapper
+ * A FunctionMapper to resolve functions found in the expression.
+ * It can be null, in which case no functions are supported for
+ * this invocation. The ExpressionEvaluator must not hold on to
+ * the FunctionMapper reference after returning from
+ * <code>parseExpression()</code>. The <code>Expression</code>
+ * object returned must invoke the same functions regardless of
+ * whether the mappings in the provided
+ * <code>FunctionMapper</code> instance change between calling
+ * <code>ExpressionEvaluator.parseExpression()</code> and
+ * <code>Expression.evaluate()</code>.
* @return The Expression object encapsulating the arguments.
- *
- * @exception ELException Thrown if parsing errors were found.
- */
- public abstract Expression parseExpression( String expression,
- @SuppressWarnings("unchecked") // TCK signature fails with generics
- Class expectedType,
- FunctionMapper fMapper)
- throws ELException;
-
+ * @exception ELException
+ * Thrown if parsing errors were found.
+ */
+ public abstract Expression parseExpression(String expression,
+ @SuppressWarnings("unchecked")// TCK signature fails with generics
+ Class expectedType, FunctionMapper fMapper) throws ELException;
- /**
- * Evaluates an expression. This method may perform some syntactic
- * validation and, if so, it should raise an ELParseException error if
- * it encounters syntactic errors. EL evaluation errors should cause
- * an ELException to be raised.
- *
- * @param expression The expression to be evaluated.
- * @param expectedType The expected type of the result of the evaluation
- * @param vResolver A VariableResolver instance that can be used at
- * runtime to resolve the name of implicit objects into Objects.
- * @param fMapper A FunctionMapper to resolve functions found in
- * the expression. It can be null, in which case no functions
- * are supported for this invocation.
+ /**
+ * Evaluates an expression. This method may perform some syntactic
+ * validation and, if so, it should raise an ELParseException error if it
+ * encounters syntactic errors. EL evaluation errors should cause an
+ * ELException to be raised.
+ *
+ * @param expression
+ * The expression to be evaluated.
+ * @param expectedType
+ * The expected type of the result of the evaluation
+ * @param vResolver
+ * A VariableResolver instance that can be used at runtime to
+ * resolve the name of implicit objects into Objects.
+ * @param fMapper
+ * A FunctionMapper to resolve functions found in the expression.
+ * It can be null, in which case no functions are supported for
+ * this invocation.
* @return The result of the expression evaluation.
- *
- * @exception ELException Thrown if the expression evaluation failed.
+ * @exception ELException
+ * Thrown if the expression evaluation failed.
*/
- public abstract Object evaluate( String expression,
- @SuppressWarnings("unchecked") // TCK signature fails with generics
- Class expectedType,
- VariableResolver vResolver,
- FunctionMapper fMapper)
- throws ELException;
+ public abstract Object evaluate(
+ String expression,
+ @SuppressWarnings("unchecked")// TCK signature fails with generics
+ Class expectedType, VariableResolver vResolver,
+ FunctionMapper fMapper) throws ELException;
}
-
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* 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.
-*/
-
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 javax.servlet.jsp.el;
import java.beans.FeatureDescriptor;
public class ScopedAttributeELResolver extends ELResolver {
- public ScopedAttributeELResolver() {
- super();
- }
+ public ScopedAttributeELResolver() {
+ super();
+ }
- @Override
+ @Override
public Object getValue(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException, ELException {
- if (context == null) {
- throw new NullPointerException();
- }
-
- if (base == null) {
- context.setPropertyResolved(true);
- if (property != null) {
- String key = property.toString();
- PageContext page = (PageContext) context
- .getContext(JspContext.class);
- return page.findAttribute(key);
- }
- }
-
- return null;
- }
-
- @Override
+ throws NullPointerException, PropertyNotFoundException, ELException {
+ if (context == null) {
+ throw new NullPointerException();
+ }
+
+ if (base == null) {
+ context.setPropertyResolved(true);
+ if (property != null) {
+ String key = property.toString();
+ PageContext page = (PageContext) context
+ .getContext(JspContext.class);
+ return page.findAttribute(key);
+ }
+ }
+
+ return null;
+ }
+
+ @Override
public Class<Object> getType(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException, ELException {
- if (context == null) {
- throw new NullPointerException();
- }
+ throws NullPointerException, PropertyNotFoundException, ELException {
+ if (context == null) {
+ throw new NullPointerException();
+ }
- if (base == null) {
- context.setPropertyResolved(true);
- return Object.class;
- }
+ if (base == null) {
+ context.setPropertyResolved(true);
+ return Object.class;
+ }
- return null;
- }
+ return null;
+ }
- @Override
+ @Override
public void setValue(ELContext context, Object base, Object property,
- Object value) throws NullPointerException,
- PropertyNotFoundException, PropertyNotWritableException,
- ELException {
- if (context == null) {
- throw new NullPointerException();
- }
-
- if (base == null) {
- context.setPropertyResolved(true);
- if (property != null) {
- String key = property.toString();
- PageContext page = (PageContext) context
- .getContext(JspContext.class);
- int scope = page.getAttributesScope(key);
- if (scope != 0) {
- page.setAttribute(key, value, scope);
- } else {
- page.setAttribute(key, value);
- }
- }
- }
- }
-
- @Override
+ Object value) throws NullPointerException,
+ PropertyNotFoundException, PropertyNotWritableException,
+ ELException {
+ if (context == null) {
+ throw new NullPointerException();
+ }
+
+ if (base == null) {
+ context.setPropertyResolved(true);
+ if (property != null) {
+ String key = property.toString();
+ PageContext page = (PageContext) context
+ .getContext(JspContext.class);
+ int scope = page.getAttributesScope(key);
+ if (scope != 0) {
+ page.setAttribute(key, value, scope);
+ } else {
+ page.setAttribute(key, value);
+ }
+ }
+ }
+ }
+
+ @Override
public boolean isReadOnly(ELContext context, Object base, Object property)
- throws NullPointerException, PropertyNotFoundException, ELException {
- if (context == null) {
- throw new NullPointerException();
- }
-
- if (base == null) {
- context.setPropertyResolved(true);
- }
-
- return false;
- }
-
- @Override
- public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
-
- PageContext ctxt = (PageContext) context.getContext(JspContext.class);
- List<FeatureDescriptor> list = new ArrayList<FeatureDescriptor>();
- Enumeration<String> e;
- Object value;
- String name;
-
- e = ctxt.getAttributeNamesInScope(PageContext.PAGE_SCOPE);
- while (e.hasMoreElements()) {
- name = e.nextElement();
- value = ctxt.getAttribute(name, PageContext.PAGE_SCOPE);
- FeatureDescriptor descriptor = new FeatureDescriptor();
- descriptor.setName(name);
- descriptor.setDisplayName(name);
- descriptor.setExpert(false);
- descriptor.setHidden(false);
- descriptor.setPreferred(true);
- descriptor.setShortDescription("page scoped attribute");
- descriptor.setValue("type", value.getClass());
- descriptor.setValue("resolvableAtDesignTime", Boolean.FALSE);
- list.add(descriptor);
- }
-
- e = ctxt.getAttributeNamesInScope(PageContext.REQUEST_SCOPE);
- while (e.hasMoreElements()) {
- name = e.nextElement();
- value = ctxt.getAttribute(name, PageContext.REQUEST_SCOPE);
- FeatureDescriptor descriptor = new FeatureDescriptor();
- descriptor.setName(name);
- descriptor.setDisplayName(name);
- descriptor.setExpert(false);
- descriptor.setHidden(false);
- descriptor.setPreferred(true);
- descriptor.setShortDescription("request scope attribute");
- descriptor.setValue("type", value.getClass());
- descriptor.setValue("resolvableAtDesignTime", Boolean.FALSE);
- list.add(descriptor);
- }
-
- if (ctxt.getSession() != null) {
- e = ctxt.getAttributeNamesInScope(PageContext.SESSION_SCOPE);
- while (e.hasMoreElements()) {
- name = e.nextElement();
- value = ctxt.getAttribute(name, PageContext.SESSION_SCOPE);
- FeatureDescriptor descriptor = new FeatureDescriptor();
- descriptor.setName(name);
- descriptor.setDisplayName(name);
- descriptor.setExpert(false);
- descriptor.setHidden(false);
- descriptor.setPreferred(true);
- descriptor.setShortDescription("session scoped attribute");
- descriptor.setValue("type", value.getClass());
- descriptor.setValue("resolvableAtDesignTime", Boolean.FALSE);
- list.add(descriptor);
- }
- }
-
- e = ctxt.getAttributeNamesInScope(PageContext.APPLICATION_SCOPE);
- while (e.hasMoreElements()) {
- name = e.nextElement();
- value = ctxt.getAttribute(name, PageContext.APPLICATION_SCOPE);
- FeatureDescriptor descriptor = new FeatureDescriptor();
- descriptor.setName(name);
- descriptor.setDisplayName(name);
- descriptor.setExpert(false);
- descriptor.setHidden(false);
- descriptor.setPreferred(true);
- descriptor.setShortDescription("application scoped attribute");
- descriptor.setValue("type", value.getClass());
- descriptor.setValue("resolvableAtDesignTime", Boolean.FALSE);
- list.add(descriptor);
- }
- return list.iterator();
- }
-
- @Override
+ throws NullPointerException, PropertyNotFoundException, ELException {
+ if (context == null) {
+ throw new NullPointerException();
+ }
+
+ if (base == null) {
+ context.setPropertyResolved(true);
+ }
+
+ return false;
+ }
+
+ @Override
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
+ Object base) {
+
+ PageContext ctxt = (PageContext) context.getContext(JspContext.class);
+ List<FeatureDescriptor> list = new ArrayList<FeatureDescriptor>();
+ Enumeration<String> e;
+ Object value;
+ String name;
+
+ e = ctxt.getAttributeNamesInScope(PageContext.PAGE_SCOPE);
+ while (e.hasMoreElements()) {
+ name = e.nextElement();
+ value = ctxt.getAttribute(name, PageContext.PAGE_SCOPE);
+ FeatureDescriptor descriptor = new FeatureDescriptor();
+ descriptor.setName(name);
+ descriptor.setDisplayName(name);
+ descriptor.setExpert(false);
+ descriptor.setHidden(false);
+ descriptor.setPreferred(true);
+ descriptor.setShortDescription("page scoped attribute");
+ descriptor.setValue("type", value.getClass());
+ descriptor.setValue("resolvableAtDesignTime", Boolean.FALSE);
+ list.add(descriptor);
+ }
+
+ e = ctxt.getAttributeNamesInScope(PageContext.REQUEST_SCOPE);
+ while (e.hasMoreElements()) {
+ name = e.nextElement();
+ value = ctxt.getAttribute(name, PageContext.REQUEST_SCOPE);
+ FeatureDescriptor descriptor = new FeatureDescriptor();
+ descriptor.setName(name);
+ descriptor.setDisplayName(name);
+ descriptor.setExpert(false);
+ descriptor.setHidden(false);
+ descriptor.setPreferred(true);
+ descriptor.setShortDescription("request scope attribute");
+ descriptor.setValue("type", value.getClass());
+ descriptor.setValue("resolvableAtDesignTime", Boolean.FALSE);
+ list.add(descriptor);
+ }
+
+ if (ctxt.getSession() != null) {
+ e = ctxt.getAttributeNamesInScope(PageContext.SESSION_SCOPE);
+ while (e.hasMoreElements()) {
+ name = e.nextElement();
+ value = ctxt.getAttribute(name, PageContext.SESSION_SCOPE);
+ FeatureDescriptor descriptor = new FeatureDescriptor();
+ descriptor.setName(name);
+ descriptor.setDisplayName(name);
+ descriptor.setExpert(false);
+ descriptor.setHidden(false);
+ descriptor.setPreferred(true);
+ descriptor.setShortDescription("session scoped attribute");
+ descriptor.setValue("type", value.getClass());
+ descriptor.setValue("resolvableAtDesignTime", Boolean.FALSE);
+ list.add(descriptor);
+ }
+ }
+
+ e = ctxt.getAttributeNamesInScope(PageContext.APPLICATION_SCOPE);
+ while (e.hasMoreElements()) {
+ name = e.nextElement();
+ value = ctxt.getAttribute(name, PageContext.APPLICATION_SCOPE);
+ FeatureDescriptor descriptor = new FeatureDescriptor();
+ descriptor.setName(name);
+ descriptor.setDisplayName(name);
+ descriptor.setExpert(false);
+ descriptor.setHidden(false);
+ descriptor.setPreferred(true);
+ descriptor.setShortDescription("application scoped attribute");
+ descriptor.setValue("type", value.getClass());
+ descriptor.setValue("resolvableAtDesignTime", Boolean.FALSE);
+ list.add(descriptor);
+ }
+ return list.iterator();
+ }
+
+ @Override
public Class<String> getCommonPropertyType(ELContext context, Object base) {
- if (base == null) {
- return String.class;
- }
- return null;
- }
+ if (base == null) {
+ return String.class;
+ }
+ return null;
+ }
}
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* 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.
-*/
-
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 javax.servlet.jsp.el;
/**
- * <p>This class is used to customize the way an ExpressionEvaluator resolves
- * variable references at evaluation time. For example, instances of this class can
- * implement their own variable lookup mechanisms, or introduce the
- * notion of "implicit variables" which override any other variables.
- * An instance of this class should be passed when evaluating
- * an expression.</p>
- *
- * <p>An instance of this class includes the context against which resolution
- * will happen</p>
- *
+ * <p>
+ * This class is used to customize the way an ExpressionEvaluator resolves
+ * variable references at evaluation time. For example, instances of this class
+ * can implement their own variable lookup mechanisms, or introduce the notion
+ * of "implicit variables" which override any other variables. An instance of
+ * this class should be passed when evaluating an expression.
+ * </p>
+ * <p>
+ * An instance of this class includes the context against which resolution will
+ * happen
+ * </p>
+ *
* @since 2.0
* @deprecated
*/
-@SuppressWarnings("dep-ann") // TCK signature test fails with annotation
-public interface VariableResolver
-{
- //-------------------------------------
- /**
- * Resolves the specified variable.
- * Returns null if the variable is not found.
- *
- * @param pName the name of the variable to resolve
- * @return the result of the variable resolution
- *
- * @throws ELException if a failure occurred while trying to resolve
- * the given variable
- **/
- public Object resolveVariable (String pName)
- throws ELException;
-
- //-------------------------------------
+@SuppressWarnings("dep-ann")
+// TCK signature test fails with annotation
+public interface VariableResolver {
+
+ /**
+ * Resolves the specified variable. Returns null if the variable is not
+ * found.
+ *
+ * @param pName
+ * the name of the variable to resolve
+ * @return the result of the variable resolution
+ * @throws ELException
+ * if a failure occurred while trying to resolve the given
+ * variable
+ */
+ public Object resolveVariable(String pName) throws ELException;
}
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* 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.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 javax.servlet.jsp.tagext;
import java.io.Reader;
/**
* An encapsulation of the evaluation of the body of an action so it is
- * available to a tag handler. BodyContent is a subclass of JspWriter.
- *
+ * available to a tag handler. BodyContent is a subclass of JspWriter.
* <p>
- * Note that the content of BodyContent is the result of evaluation, so
- * it will not contain actions and the like, but the result of their
- * invocation.
- *
+ * Note that the content of BodyContent is the result of evaluation, so it will
+ * not contain actions and the like, but the result of their invocation.
* <p>
- * BodyContent has methods to convert its contents into
- * a String, to read its contents, and to clear the contents.
- *
+ * BodyContent has methods to convert its contents into a String, to read its
+ * contents, and to clear the contents.
* <p>
- * The buffer size of a BodyContent object is unbounded. A
- * BodyContent object cannot be in autoFlush mode. It is not possible to
- * invoke flush on a BodyContent object, as there is no backing stream.
- *
+ * The buffer size of a BodyContent object is unbounded. A BodyContent object
+ * cannot be in autoFlush mode. It is not possible to invoke flush on a
+ * BodyContent object, as there is no backing stream.
* <p>
- * Instances of BodyContent are created by invoking the pushBody and
- * popBody methods of the PageContext class. A BodyContent is enclosed
- * within another JspWriter (maybe another BodyContent object) following
- * the structure of their associated actions.
- *
+ * Instances of BodyContent are created by invoking the pushBody and popBody
+ * methods of the PageContext class. A BodyContent is enclosed within another
+ * JspWriter (maybe another BodyContent object) following the structure of their
+ * associated actions.
* <p>
- * A BodyContent is made available to a BodyTag through a setBodyContent()
- * call. The tag handler can use the object until after the call to
- * doEndTag().
+ * A BodyContent is made available to a BodyTag through a setBodyContent() call.
+ * The tag handler can use the object until after the call to doEndTag().
*/
-
public abstract class BodyContent extends JspWriter {
-
+
/**
- * Protected constructor.
- *
- * Unbounded buffer, no autoflushing.
- *
- * @param e the enclosing JspWriter
+ * Protected constructor. Unbounded buffer, no autoflushing.
+ *
+ * @param e
+ * the enclosing JspWriter
*/
-
protected BodyContent(JspWriter e) {
- super(UNBOUNDED_BUFFER , false);
- this.enclosingWriter = e;
+ super(UNBOUNDED_BUFFER, false);
+ this.enclosingWriter = e;
}
/**
* Redefined flush() so it is not legal.
- *
* <p>
- * It is not valid to flush a BodyContent because there is no backing
- * stream behind it.
- *
- * @throws IOException always thrown
+ * It is not valid to flush a BodyContent because there is no backing stream
+ * behind it.
+ *
+ * @throws IOException
+ * always thrown
*/
-
@Override
public void flush() throws IOException {
- throw new IOException("Illegal to flush within a custom tag");
+ throw new IOException("Illegal to flush within a custom tag");
}
/**
* Clear the body without throwing any exceptions.
*/
-
public void clearBody() {
- try {
- this.clear();
- } catch (IOException ex) {
- // TODO -- clean this one up.
- throw new Error("internal error!;");
- }
+ try {
+ this.clear();
+ } catch (IOException ex) {
+ // TODO -- clean this one up.
+ throw new Error("internal error!;");
+ }
}
/**
* Return the value of this BodyContent as a Reader.
- *
+ *
* @return the value of this BodyContent as a Reader
*/
public abstract Reader getReader();
-
/**
* Return the value of the BodyContent as a String.
- *
+ *
* @return the value of the BodyContent as a String
*/
public abstract String getString();
-
/**
- * Write the contents of this BodyContent into a Writer.
- * Subclasses may optimize common invocation patterns.
- *
- * @param out The writer into which to place the contents of
- * this body evaluation
- * @throws IOException if an I/O error occurred while writing the
- * contents of this BodyContent to the given Writer
+ * Write the contents of this BodyContent into a Writer. Subclasses may
+ * optimize common invocation patterns.
+ *
+ * @param out
+ * The writer into which to place the contents of this body
+ * evaluation
+ * @throws IOException
+ * if an I/O error occurred while writing the contents of this
+ * BodyContent to the given Writer
*/
-
public abstract void writeOut(Writer out) throws IOException;
-
/**
* Get the enclosing JspWriter.
- *
+ *
* @return the enclosing JspWriter passed at construction time
*/
-
public JspWriter getEnclosingWriter() {
- return enclosingWriter;
+ return enclosingWriter;
}
-
// private fields
private JspWriter enclosingWriter;
- }
+}
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* 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.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 javax.servlet.jsp.tagext;
import javax.servlet.jsp.*;
/**
- * The BodyTag interface extends IterationTag by defining additional
- * methods that let a tag handler manipulate the content of evaluating its body.
- *
+ * The BodyTag interface extends IterationTag by defining additional methods
+ * that let a tag handler manipulate the content of evaluating its body.
* <p>
- * It is the responsibility of the tag handler to manipulate the body
- * content. For example the tag handler may take the body content,
- * convert it into a String using the bodyContent.getString
- * method and then use it. Or the tag handler may take the body
- * content and write it out into its enclosing JspWriter using
- * the bodyContent.writeOut method.
- *
- * <p> A tag handler that implements BodyTag is treated as one that
- * implements IterationTag, except that the doStartTag method can
- * return SKIP_BODY, EVAL_BODY_INCLUDE or EVAL_BODY_BUFFERED.
- *
+ * It is the responsibility of the tag handler to manipulate the body content.
+ * For example the tag handler may take the body content, convert it into a
+ * String using the bodyContent.getString method and then use it. Or the tag
+ * handler may take the body content and write it out into its enclosing
+ * JspWriter using the bodyContent.writeOut method.
* <p>
- * If EVAL_BODY_INCLUDE is returned, then evaluation happens
- * as in IterationTag.
- *
+ * A tag handler that implements BodyTag is treated as one that implements
+ * IterationTag, except that the doStartTag method can return SKIP_BODY,
+ * EVAL_BODY_INCLUDE or EVAL_BODY_BUFFERED.
* <p>
- * If EVAL_BODY_BUFFERED is returned, then a BodyContent object will be
- * created (by code generated by the JSP compiler) to capture the body
- * evaluation.
- * The code generated by the JSP compiler obtains the BodyContent object by
- * calling the pushBody method of the current pageContext, which
- * additionally has the effect of saving the previous out value.
- * The page compiler returns this object by calling the popBody
- * method of the PageContext class;
- * the call also restores the value of out.
- *
+ * If EVAL_BODY_INCLUDE is returned, then evaluation happens as in IterationTag.
* <p>
- * The interface provides one new property with a setter method and one
- * new action method.
- *
- * <p><B>Properties</B>
- * <p> There is a new property: bodyContent, to contain the BodyContent
- * object, where the JSP Page implementation object will place the
- * evaluation (and reevaluation, if appropriate) of the body. The setter
- * method (setBodyContent) will only be invoked if doStartTag() returns
- * EVAL_BODY_BUFFERED and the corresponding action element does not have
- * an empty body.
- *
- * <p><B>Methods</B>
- * <p> In addition to the setter method for the bodyContent property, there
- * is a new action method: doInitBody(), which is invoked right after
- * setBodyContent() and before the body evaluation. This method is only
- * invoked if doStartTag() returns EVAL_BODY_BUFFERED.
- *
- * <p><B>Lifecycle</B>
- * <p> Lifecycle details are described by the transition diagram below.
- * Exceptions that are thrown during the computation of doStartTag(),
- * setBodyContent(), doInitBody(), BODY, doAfterBody() interrupt the
- * execution sequence and are propagated up the stack, unless the
- * tag handler implements the TryCatchFinally interface; see that
- * interface for details.
+ * If EVAL_BODY_BUFFERED is returned, then a BodyContent object will be created
+ * (by code generated by the JSP compiler) to capture the body evaluation. The
+ * code generated by the JSP compiler obtains the BodyContent object by calling
+ * the pushBody method of the current pageContext, which additionally has the
+ * effect of saving the previous out value. The page compiler returns this
+ * object by calling the popBody method of the PageContext class; the call also
+ * restores the value of out.
+ * <p>
+ * The interface provides one new property with a setter method and one new
+ * action method.
+ * <p>
+ * <B>Properties</B>
+ * <p>
+ * There is a new property: bodyContent, to contain the BodyContent object,
+ * where the JSP Page implementation object will place the evaluation (and
+ * reevaluation, if appropriate) of the body. The setter method (setBodyContent)
+ * will only be invoked if doStartTag() returns EVAL_BODY_BUFFERED and the
+ * corresponding action element does not have an empty body.
+ * <p>
+ * <B>Methods</B>
+ * <p>
+ * In addition to the setter method for the bodyContent property, there is a new
+ * action method: doInitBody(), which is invoked right after setBodyContent()
+ * and before the body evaluation. This method is only invoked if doStartTag()
+ * returns EVAL_BODY_BUFFERED.
+ * <p>
+ * <B>Lifecycle</B>
+ * <p>
+ * Lifecycle details are described by the transition diagram below. Exceptions
+ * that are thrown during the computation of doStartTag(), setBodyContent(),
+ * doInitBody(), BODY, doAfterBody() interrupt the execution sequence and are
+ * propagated up the stack, unless the tag handler implements the
+ * TryCatchFinally interface; see that interface for details.
* <p>
* <IMG src="doc-files/BodyTagProtocol.gif"
- * alt="Lifecycle Details Transition Diagram for BodyTag"/>
- *
- * <p><B>Empty and Non-Empty Action</B>
- * <p> If the TagLibraryDescriptor file indicates that the action must
- * always have an empty element body, by an <body-content> entry
- * of "empty", then the doStartTag() method must return SKIP_BODY.
- * Otherwise, the doStartTag() method may return SKIP_BODY,
- * EVAL_BODY_INCLUDE, or EVAL_BODY_BUFFERED.
- *
- * <p>Note that which methods are invoked after the doStartTag() depends on
- * both the return value and on if the custom action element is empty
- * or not in the JSP page, not how it's declared in the TLD.
- *
+ * alt="Lifecycle Details Transition Diagram for BodyTag"/>
+ * <p>
+ * <B>Empty and Non-Empty Action</B>
+ * <p>
+ * If the TagLibraryDescriptor file indicates that the action must always have
+ * an empty element body, by an <body-content> entry of "empty", then the
+ * doStartTag() method must return SKIP_BODY. Otherwise, the doStartTag() method
+ * may return SKIP_BODY, EVAL_BODY_INCLUDE, or EVAL_BODY_BUFFERED.
+ * <p>
+ * Note that which methods are invoked after the doStartTag() depends on both
+ * the return value and on if the custom action element is empty or not in the
+ * JSP page, not how it's declared in the TLD.
* <p>
* If SKIP_BODY is returned the body is not evaluated, and doEndTag() is
* invoked.
- *
* <p>
- * If EVAL_BODY_INCLUDE is returned, and the custom action element is not
- * empty, setBodyContent() is not invoked,
- * doInitBody() is not invoked, the body is evaluated and
- * "passed through" to the current out, doAfterBody() is invoked
- * and then, after zero or more iterations, doEndTag() is invoked.
- * If the custom action element is empty, only doStart() and
- * doEndTag() are invoked.
- *
+ * If EVAL_BODY_INCLUDE is returned, and the custom action element is not empty,
+ * setBodyContent() is not invoked, doInitBody() is not invoked, the body is
+ * evaluated and "passed through" to the current out, doAfterBody() is invoked
+ * and then, after zero or more iterations, doEndTag() is invoked. If the custom
+ * action element is empty, only doStart() and doEndTag() are invoked.
* <p>
* If EVAL_BODY_BUFFERED is returned, and the custom action element is not
- * empty, setBodyContent() is invoked,
- * doInitBody() is invoked, the body is evaluated, doAfterBody() is
- * invoked, and then, after zero or more iterations, doEndTag() is invoked.
- * If the custom action element is empty, only doStart() and doEndTag()
- * are invoked.
+ * empty, setBodyContent() is invoked, doInitBody() is invoked, the body is
+ * evaluated, doAfterBody() is invoked, and then, after zero or more iterations,
+ * doEndTag() is invoked. If the custom action element is empty, only doStart()
+ * and doEndTag() are invoked.
*/
-
public interface BodyTag extends IterationTag {
/**
- * Deprecated constant that has the same value as EVAL_BODY_BUFFERED
- * and EVAL_BODY_AGAIN. This name has been marked as deprecated
- * to encourage the use of the two different terms, which are much
- * more descriptive.
- *
- * @deprecated As of Java JSP API 1.2, use BodyTag.EVAL_BODY_BUFFERED
- * or IterationTag.EVAL_BODY_AGAIN.
+ * Deprecated constant that has the same value as EVAL_BODY_BUFFERED and
+ * EVAL_BODY_AGAIN. This name has been marked as deprecated to encourage the
+ * use of the two different terms, which are much more descriptive.
+ *
+ * @deprecated As of Java JSP API 1.2, use BodyTag.EVAL_BODY_BUFFERED or
+ * IterationTag.EVAL_BODY_AGAIN.
*/
- @SuppressWarnings("dep-ann") // TCK signature test fails with annotation
+ @SuppressWarnings("dep-ann")
+ // TCK signature test fails with annotation
public final static int EVAL_BODY_TAG = 2;
/**
- * Request the creation of new buffer, a BodyContent on which to
- * evaluate the body of this tag.
- *
- * Returned from doStartTag when it implements BodyTag.
- * This is an illegal return value for doStartTag when the class
+ * Request the creation of new buffer, a BodyContent on which to evaluate
+ * the body of this tag. Returned from doStartTag when it implements
+ * BodyTag. This is an illegal return value for doStartTag when the class
* does not implement BodyTag.
*/
-
public final static int EVAL_BODY_BUFFERED = 2;
-
/**
- * Set the bodyContent property.
- * This method is invoked by the JSP page implementation object at
- * most once per action invocation.
- * This method will be invoked before doInitBody.
- * This method will not be invoked for empty tags or for non-empty
- * tags whose doStartTag() method returns SKIP_BODY or EVAL_BODY_INCLUDE.
- *
+ * Set the bodyContent property. This method is invoked by the JSP page
+ * implementation object at most once per action invocation. This method
+ * will be invoked before doInitBody. This method will not be invoked for
+ * empty tags or for non-empty tags whose doStartTag() method returns
+ * SKIP_BODY or EVAL_BODY_INCLUDE.
* <p>
- * When setBodyContent is invoked, the value of the implicit object out
- * has already been changed in the pageContext object. The BodyContent
- * object passed will have not data on it but may have been reused
- * (and cleared) from some previous invocation.
- *
+ * When setBodyContent is invoked, the value of the implicit object out has
+ * already been changed in the pageContext object. The BodyContent object
+ * passed will have not data on it but may have been reused (and cleared)
+ * from some previous invocation.
* <p>
* The BodyContent object is available and with the appropriate content
- * until after the invocation of the doEndTag method, at which case it
- * may be reused.
- *
- * @param b the BodyContent
+ * until after the invocation of the doEndTag method, at which case it may
+ * be reused.
+ *
+ * @param b
+ * the BodyContent
* @see #doInitBody
* @see #doAfterBody
*/
-
void setBodyContent(BodyContent b);
-
/**
- * Prepare for evaluation of the body.
- * This method is invoked by the JSP page implementation object
- * after setBodyContent and before the first time
- * the body is to be evaluated.
- * This method will not be invoked for empty tags or for non-empty
- * tags whose doStartTag() method returns SKIP_BODY or EVAL_BODY_INCLUDE.
- *
+ * Prepare for evaluation of the body. This method is invoked by the JSP
+ * page implementation object after setBodyContent and before the first time
+ * the body is to be evaluated. This method will not be invoked for empty
+ * tags or for non-empty tags whose doStartTag() method returns SKIP_BODY or
+ * EVAL_BODY_INCLUDE.
* <p>
* The JSP container will resynchronize the values of any AT_BEGIN and
* NESTED variables (defined by the associated TagExtraInfo or TLD) after
* the invocation of doInitBody().
- *
- * @throws JspException if an error occurred while processing this tag
+ *
+ * @throws JspException
+ * if an error occurred while processing this tag
* @see #doAfterBody
*/
-
void doInitBody() throws JspException;
-
}
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* 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.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 javax.servlet.jsp.tagext;
import javax.servlet.jsp.JspException;
/**
* A base class for defining tag handlers implementing BodyTag.
- *
* <p>
- * The BodyTagSupport class implements the BodyTag interface and adds
- * additional convenience methods including getter methods for the
- * bodyContent property and methods to get at the previous out JspWriter.
- *
+ * The BodyTagSupport class implements the BodyTag interface and adds additional
+ * convenience methods including getter methods for the bodyContent property and
+ * methods to get at the previous out JspWriter.
* <p>
- * Many tag handlers will extend BodyTagSupport and only redefine a
- * few methods.
+ * Many tag handlers will extend BodyTagSupport and only redefine a few methods.
*/
-
public class BodyTagSupport extends TagSupport implements BodyTag {
/**
- * Default constructor, all subclasses are required to only define
- * a public constructor with the same signature, and to call the
- * superclass constructor.
- *
- * This constructor is called by the code generated by the JSP
+ * Default constructor, all subclasses are required to only define a public
+ * constructor with the same signature, and to call the superclass
+ * constructor. This constructor is called by the code generated by the JSP
* translator.
*/
-
public BodyTagSupport() {
- super();
+ super();
}
/**
* Default processing of the start tag returning EVAL_BODY_BUFFERED.
- *
+ *
* @return EVAL_BODY_BUFFERED
- * @throws JspException if an error occurred while processing this tag
+ * @throws JspException
+ * if an error occurred while processing this tag
* @see BodyTag#doStartTag
*/
-
@Override
public int doStartTag() throws JspException {
return EVAL_BODY_BUFFERED;
}
-
/**
* Default processing of the end tag returning EVAL_PAGE.
- *
+ *
* @return EVAL_PAGE
- * @throws JspException if an error occurred while processing this tag
+ * @throws JspException
+ * if an error occurred while processing this tag
* @see Tag#doEndTag
*/
-
@Override
public int doEndTag() throws JspException {
- return super.doEndTag();
+ return super.doEndTag();
}
-
// Actions related to body evaluation
/**
* Prepare for evaluation of the body: stash the bodyContent away.
- *
- * @param b the BodyContent
+ *
+ * @param b
+ * the BodyContent
* @see #doAfterBody
* @see #doInitBody()
* @see BodyTag#setBodyContent
*/
-
public void setBodyContent(BodyContent b) {
- this.bodyContent = b;
+ this.bodyContent = b;
}
-
/**
* Prepare for evaluation of the body just before the first body evaluation:
* no action.
- *
- * @throws JspException if an error occurred while processing this tag
+ *
+ * @throws JspException
+ * if an error occurred while processing this tag
* @see #setBodyContent
* @see #doAfterBody
* @see BodyTag#doInitBody
*/
-
public void doInitBody() throws JspException {
// NOOP by default
}
-
/**
* After the body evaluation: do not reevaluate and continue with the page.
* By default nothing is done with the bodyContent data (if any).
- *
+ *
* @return SKIP_BODY
- * @throws JspException if an error occurred while processing this tag
+ * @throws JspException
+ * if an error occurred while processing this tag
* @see #doInitBody
* @see BodyTag#doAfterBody
*/
-
@Override
public int doAfterBody() throws JspException {
- return SKIP_BODY;
+ return SKIP_BODY;
}
-
/**
* Release state.
- *
+ *
* @see Tag#release
*/
-
@Override
public void release() {
- bodyContent = null;
+ bodyContent = null;
- super.release();
+ super.release();
}
/**
* Get current bodyContent.
- *
+ *
* @return the body content.
*/
-
public BodyContent getBodyContent() {
- return bodyContent;
+ return bodyContent;
}
-
/**
* Get surrounding out JspWriter.
- *
+ *
* @return the enclosing JspWriter, from the bodyContent.
*/
-
public JspWriter getPreviousOut() {
- return bodyContent.getEnclosingWriter();
+ return bodyContent.getEnclosingWriter();
}
// protected fields
/**
* The current BodyContent for this BodyTag.
*/
- protected BodyContent bodyContent;
+ protected BodyContent bodyContent;
}
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* 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.
-*/
-
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 javax.servlet.jsp.tagext;
import javax.servlet.jsp.*;
-
/**
- * Wraps any SimpleTag and exposes it using a Tag interface. This is used
- * to allow collaboration between classic Tag handlers and SimpleTag
- * handlers.
+ * Wraps any SimpleTag and exposes it using a Tag interface. This is used to
+ * allow collaboration between classic Tag handlers and SimpleTag handlers.
* <p>
- * Because SimpleTag does not extend Tag, and because Tag.setParent()
- * only accepts a Tag instance, a classic tag handler (one
- * that implements Tag) cannot have a SimpleTag as its parent. To remedy
- * this, a TagAdapter is created to wrap the SimpleTag parent, and the
- * adapter is passed to setParent() instead. A classic Tag Handler can
- * call getAdaptee() to retrieve the encapsulated SimpleTag instance.
- *
+ * Because SimpleTag does not extend Tag, and because Tag.setParent() only
+ * accepts a Tag instance, a classic tag handler (one that implements Tag)
+ * cannot have a SimpleTag as its parent. To remedy this, a TagAdapter is
+ * created to wrap the SimpleTag parent, and the adapter is passed to
+ * setParent() instead. A classic Tag Handler can call getAdaptee() to retrieve
+ * the encapsulated SimpleTag instance.
+ *
* @since 2.0
*/
-public class TagAdapter
- implements Tag
-{
+public class TagAdapter implements Tag {
/** The simple tag that's being adapted. */
private SimpleTag simpleTagAdaptee;
private boolean parentDetermined;
/**
- * Creates a new TagAdapter that wraps the given SimpleTag and
- * returns the parent tag when getParent() is called.
- *
- * @param adaptee The SimpleTag being adapted as a Tag.
+ * Creates a new TagAdapter that wraps the given SimpleTag and returns the
+ * parent tag when getParent() is called.
+ *
+ * @param adaptee
+ * The SimpleTag being adapted as a Tag.
*/
- public TagAdapter( SimpleTag adaptee ) {
- if( adaptee == null ) {
- // Cannot wrap a null adaptee.
- throw new IllegalArgumentException();
+ public TagAdapter(SimpleTag adaptee) {
+ if (adaptee == null) {
+ // Cannot wrap a null adaptee.
+ throw new IllegalArgumentException();
}
this.simpleTagAdaptee = adaptee;
}
-
+
/**
* Must not be called.
- *
- * @param pc ignored.
- * @throws UnsupportedOperationException Must not be called
+ *
+ * @param pc
+ * ignored.
+ * @throws UnsupportedOperationException
+ * Must not be called
*/
public void setPageContext(PageContext pc) {
- throw new UnsupportedOperationException(
- "Illegal to invoke setPageContext() on TagAdapter wrapper" );
+ throw new UnsupportedOperationException(
+ "Illegal to invoke setPageContext() on TagAdapter wrapper");
}
-
/**
- * Must not be called. The parent of this tag is always
+ * Must not be called. The parent of this tag is always
* getAdaptee().getParent().
- *
- * @param parentTag ignored.
- * @throws UnsupportedOperationException Must not be called.
+ *
+ * @param parentTag
+ * ignored.
+ * @throws UnsupportedOperationException
+ * Must not be called.
*/
- public void setParent( Tag parentTag ) {
- throw new UnsupportedOperationException(
- "Illegal to invoke setParent() on TagAdapter wrapper" );
+ public void setParent(Tag parentTag) {
+ throw new UnsupportedOperationException(
+ "Illegal to invoke setParent() on TagAdapter wrapper");
}
-
/**
- * Returns the parent of this tag, which is always
- * getAdaptee().getParent().
- *
+ * Returns the parent of this tag, which is always getAdaptee().getParent().
* This will either be the enclosing Tag (if getAdaptee().getParent()
- * implements Tag), or an adapter to the enclosing Tag (if
+ * implements Tag), or an adapter to the enclosing Tag (if
* getAdaptee().getParent() does not implement Tag).
- *
+ *
* @return The parent of the tag being adapted.
*/
public Tag getParent() {
- if (!parentDetermined) {
- JspTag adapteeParent = simpleTagAdaptee.getParent();
- if (adapteeParent != null) {
- if (adapteeParent instanceof Tag) {
- this.parent = (Tag) adapteeParent;
- } else {
- // Must be SimpleTag - no other types defined.
- this.parent = new TagAdapter((SimpleTag) adapteeParent);
- }
- }
- parentDetermined = true;
- }
+ if (!parentDetermined) {
+ JspTag adapteeParent = simpleTagAdaptee.getParent();
+ if (adapteeParent != null) {
+ if (adapteeParent instanceof Tag) {
+ this.parent = (Tag) adapteeParent;
+ } else {
+ // Must be SimpleTag - no other types defined.
+ this.parent = new TagAdapter((SimpleTag) adapteeParent);
+ }
+ }
+ parentDetermined = true;
+ }
- return this.parent;
+ return this.parent;
}
-
+
/**
- * Gets the tag that is being adapted to the Tag interface.
- * This should be an instance of SimpleTag in JSP 2.0, but room
- * is left for other kinds of tags in future spec versions.
- *
+ * Gets the tag that is being adapted to the Tag interface. This should be
+ * an instance of SimpleTag in JSP 2.0, but room is left for other kinds of
+ * tags in future spec versions.
+ *
* @return the tag that is being adapted
*/
public JspTag getAdaptee() {
/**
* Must not be called.
- *
+ *
* @return always throws UnsupportedOperationException
- * @throws UnsupportedOperationException Must not be called
- * @throws JspException never thrown
+ * @throws UnsupportedOperationException
+ * Must not be called
+ * @throws JspException
+ * never thrown
*/
public int doStartTag() throws JspException {
- throw new UnsupportedOperationException(
- "Illegal to invoke doStartTag() on TagAdapter wrapper" );
+ throw new UnsupportedOperationException(
+ "Illegal to invoke doStartTag() on TagAdapter wrapper");
}
-
+
/**
* Must not be called.
- *
+ *
* @return always throws UnsupportedOperationException
- * @throws UnsupportedOperationException Must not be called
- * @throws JspException never thrown
+ * @throws UnsupportedOperationException
+ * Must not be called
+ * @throws JspException
+ * never thrown
*/
public int doEndTag() throws JspException {
- throw new UnsupportedOperationException(
- "Illegal to invoke doEndTag() on TagAdapter wrapper" );
+ throw new UnsupportedOperationException(
+ "Illegal to invoke doEndTag() on TagAdapter wrapper");
}
/**
* Must not be called.
- *
- * @throws UnsupportedOperationException Must not be called
+ *
+ * @throws UnsupportedOperationException
+ * Must not be called
*/
public void release() {
- throw new UnsupportedOperationException(
- "Illegal to invoke release() on TagAdapter wrapper" );
+ throw new UnsupportedOperationException(
+ "Illegal to invoke release() on TagAdapter wrapper");
}
}
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* 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.
-*/
-
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 javax.servlet.jsp.tagext;
import javax.servlet.jsp.tagext.TagInfo;
/**
* Translation-time information associated with a taglib directive, and its
- * underlying TLD file.
- *
- * Most of the information is directly from the TLD, except for
- * the prefix and the uri values used in the taglib directive
- *
- *
+ * underlying TLD file. Most of the information is directly from the TLD, except
+ * for the prefix and the uri values used in the taglib directive
*/
-
abstract public class TagLibraryInfo {
/**
- * Constructor.
- *
- * This will invoke the constructors for TagInfo, and TagAttributeInfo
- * after parsing the TLD file.
- *
- * @param prefix the prefix actually used by the taglib directive
- * @param uri the URI actually used by the taglib directive
+ * Constructor. This will invoke the constructors for TagInfo, and
+ * TagAttributeInfo after parsing the TLD file.
+ *
+ * @param prefix
+ * the prefix actually used by the taglib directive
+ * @param uri
+ * the URI actually used by the taglib directive
*/
protected TagLibraryInfo(String prefix, String uri) {
- this.prefix = prefix;
- this.uri = uri;
+ this.prefix = prefix;
+ this.uri = uri;
}
// ==== methods accessing taglib information =======
/**
- * The value of the uri attribute from the taglib directive for
- * this library.
- *
+ * The value of the uri attribute from the taglib directive for this
+ * library.
+ *
* @return the value of the uri attribute
*/
-
public String getURI() {
return uri;
}
/**
* The prefix assigned to this taglib from the taglib directive
- *
+ *
* @return the prefix assigned to this taglib from the taglib directive
*/
-
public String getPrefixString() {
- return prefix;
+ return prefix;
}
// ==== methods using the TLD data =======
/**
- * The preferred short name (prefix) as indicated in the TLD.
- * This may be used by authoring tools as the preferred prefix
- * to use when creating an taglib directive for this library.
- *
+ * The preferred short name (prefix) as indicated in the TLD. This may be
+ * used by authoring tools as the preferred prefix to use when creating an
+ * taglib directive for this library.
+ *
* @return the preferred short name for the library
*/
public String getShortName() {
}
/**
- * The "reliable" URN indicated in the TLD (the uri element).
- * This may be used by authoring tools as a global identifier
- * to use when creating a taglib directive for this library.
- *
+ * The "reliable" URN indicated in the TLD (the uri element). This may be
+ * used by authoring tools as a global identifier to use when creating a
+ * taglib directive for this library.
+ *
* @return a reliable URN to a TLD like this
*/
public String getReliableURN() {
return urn;
}
-
/**
* Information (documentation) for this TLD.
- *
+ *
* @return the info string for this tag lib
*/
-
public String getInfoString() {
return info;
}
-
/**
* A string describing the required version of the JSP container.
*
* @return the (minimal) required version of the JSP container.
* @see javax.servlet.jsp.JspEngineInfo
*/
-
public String getRequiredVersion() {
return jspversion;
}
-
/**
* An array describing the tags that are defined in this tag library.
- *
- * @return the TagInfo objects corresponding to the tags defined by this
- * tag library, or a zero length array if this tag library
- * defines no tags
+ *
+ * @return the TagInfo objects corresponding to the tags defined by this tag
+ * library, or a zero length array if this tag library defines no
+ * tags
*/
public TagInfo[] getTags() {
return tags;
/**
* An array describing the tag files that are defined in this tag library.
- *
- * @return the TagFileInfo objects corresponding to the tag files defined
- * by this tag library, or a zero length array if this
- * tag library defines no tags files
+ *
+ * @return the TagFileInfo objects corresponding to the tag files defined by
+ * this tag library, or a zero length array if this tag library
+ * defines no tags files
* @since 2.0
*/
public TagFileInfo[] getTagFiles() {
return tagFiles;
}
-
/**
- * Get the TagInfo for a given tag name, looking through all the
- * tags in this tag library.
- *
- * @param shortname The short name (no prefix) of the tag
- * @return the TagInfo for the tag with the specified short name, or
- * null if no such tag is found
+ * Get the TagInfo for a given tag name, looking through all the tags in
+ * this tag library.
+ *
+ * @param shortname
+ * The short name (no prefix) of the tag
+ * @return the TagInfo for the tag with the specified short name, or null if
+ * no such tag is found
*/
-
public TagInfo getTag(String shortname) {
TagInfo tags[] = getTags();
return null;
}
- for (int i=0; i < tags.length; i++) {
+ for (int i = 0; i < tags.length; i++) {
if (tags[i].getTagName().equals(shortname)) {
return tags[i];
}
}
/**
- * Get the TagFileInfo for a given tag name, looking through all the
- * tag files in this tag library.
- *
- * @param shortname The short name (no prefix) of the tag
- * @return the TagFileInfo for the specified Tag file, or null
- * if no Tag file is found
+ * Get the TagFileInfo for a given tag name, looking through all the tag
+ * files in this tag library.
+ *
+ * @param shortname
+ * The short name (no prefix) of the tag
+ * @return the TagFileInfo for the specified Tag file, or null if no Tag
+ * file is found
* @since 2.0
*/
public TagFileInfo getTagFile(String shortname) {
return null;
}
- for (int i=0; i < tagFiles.length; i++) {
+ for (int i = 0; i < tagFiles.length; i++) {
if (tagFiles[i].getName().equals(shortname)) {
return tagFiles[i];
}
/**
* An array describing the functions that are defined in this tag library.
- *
- * @return the functions defined in this tag library, or a zero
- * length array if the tag library defines no functions.
+ *
+ * @return the functions defined in this tag library, or a zero length array
+ * if the tag library defines no functions.
* @since 2.0
*/
public FunctionInfo[] getFunctions() {
return functions;
}
-
/**
* Get the FunctionInfo for a given function name, looking through all the
* functions in this tag library.
- *
- * @param name The name (no prefix) of the function
- * @return the FunctionInfo for the function with the given name, or null
- * if no such function exists
+ *
+ * @param name
+ * The name (no prefix) of the function
+ * @return the FunctionInfo for the function with the given name, or null if
+ * no such function exists
* @since 2.0
*/
public FunctionInfo getFunction(String name) {
return null;
}
- for (int i=0; i < functions.length; i++) {
+ for (int i = 0; i < functions.length; i++) {
if (functions[i].getName().equals(name)) {
return functions[i];
}
return null;
}
-
/**
- * Returns an array of TagLibraryInfo objects representing the entire set
- * of tag libraries (including this TagLibraryInfo) imported by taglib
- * directives in the translation unit that references this TagLibraryInfo.
- * If a tag library is imported more than once and bound to different prefixes,
- * only the TagLibraryInfo bound to the first prefix must be included
- * in the returned array.
- *
- * @return Array of TagLibraryInfo objects representing the entire set
- * of tag libraries (including this TagLibraryInfo) imported by taglib
+ * Returns an array of TagLibraryInfo objects representing the entire set of
+ * tag libraries (including this TagLibraryInfo) imported by taglib
* directives in the translation unit that references this TagLibraryInfo.
+ * If a tag library is imported more than once and bound to different
+ * prefixes, only the TagLibraryInfo bound to the first prefix must be
+ * included in the returned array.
+ *
+ * @return Array of TagLibraryInfo objects representing the entire set of
+ * tag libraries (including this TagLibraryInfo) imported by taglib
+ * directives in the translation unit that references this
+ * TagLibraryInfo.
* @since 2.1
*/
public abstract javax.servlet.jsp.tagext.TagLibraryInfo[] getTagLibraryInfos();
-
-
+
// Protected fields
/**
* The prefix assigned to this taglib from the taglib directive.
*/
- protected String prefix;
-
+ protected String prefix;
+
/**
- * The value of the uri attribute from the taglib directive for
- * this library.
+ * The value of the uri attribute from the taglib directive for this
+ * library.
*/
- protected String uri;
-
+ protected String uri;
+
/**
* An array describing the tags that are defined in this tag library.
*/
- protected TagInfo[] tags;
-
+ protected TagInfo[] tags;
+
/**
* An array describing the tag files that are defined in this tag library.
- *
+ *
* @since 2.0
*/
protected TagFileInfo[] tagFiles;
-
+
/**
* An array describing the functions that are defined in this tag library.
- *
+ *
* @since 2.0
*/
protected FunctionInfo[] functions;
// Tag Library Data
-
+
/**
* The version of the tag library.
*/
protected String tlibversion; // required
-
+
/**
* The version of the JSP specification this tag library is written to.
*/
- protected String jspversion; // required
-
+ protected String jspversion; // required
+
/**
* The preferred short name (prefix) as indicated in the TLD.
*/
- protected String shortname; // required
-
+ protected String shortname; // required
+
/**
* The "reliable" URN indicated in the TLD.
*/
- protected String urn; // required
-
+ protected String urn; // required
+
/**
* Information (documentation) for this TLD.
*/
- protected String info; // optional
+ protected String info; // optional
}
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* 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 javax.servlet.jsp.tagext;
-
-/**
- * Variable information for a tag in a Tag Library;
- * This class is instantiated from the Tag Library Descriptor file (TLD)
- * and is available only at translation time.
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * This object should be immutable.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * This information is only available in JSP 1.2 format TLDs or above.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 javax.servlet.jsp.tagext;
+/**
+ * Variable information for a tag in a Tag Library; This class is instantiated
+ * from the Tag Library Descriptor file (TLD) and is available only at
+ * translation time. This object should be immutable. This information is only
+ * available in JSP 1.2 format TLDs or above.
+ */
public class TagVariableInfo {
/**
* Constructor for TagVariableInfo.
- *
- * @param nameGiven value of <name-given>
- * @param nameFromAttribute value of <name-from-attribute>
- * @param className value of <variable-class>
- * @param declare value of <declare>
- * @param scope value of <scope>
+ *
+ * @param nameGiven
+ * value of <name-given>
+ * @param nameFromAttribute
+ * value of <name-from-attribute>
+ * @param className
+ * value of <variable-class>
+ * @param declare
+ * value of <declare>
+ * @param scope
+ * value of <scope>
*/
- public TagVariableInfo(
- String nameGiven,
- String nameFromAttribute,
- String className,
- boolean declare,
- int scope) {
- this.nameGiven = nameGiven;
- this.nameFromAttribute = nameFromAttribute;
- this.className = className;
- this.declare = declare;
- this.scope = scope;
+ public TagVariableInfo(String nameGiven, String nameFromAttribute,
+ String className, boolean declare, int scope) {
+ this.nameGiven = nameGiven;
+ this.nameFromAttribute = nameFromAttribute;
+ this.className = className;
+ this.declare = declare;
+ this.scope = scope;
}
/**
* The body of the <name-given> element.
- *
+ *
* @return The variable name as a constant
*/
-
public String getNameGiven() {
- return nameGiven;
+ return nameGiven;
}
/**
- * The body of the <name-from-attribute> element.
- * This is the name of an attribute whose (translation-time)
- * value will give the name of the variable. One of
- * <name-given> or <name-from-attribute> is required.
- *
+ * The body of the <name-from-attribute> element. This is the name of
+ * an attribute whose (translation-time) value will give the name of the
+ * variable. One of <name-given> or <name-from-attribute> is
+ * required.
+ *
* @return The attribute whose value defines the variable name
*/
-
public String getNameFromAttribute() {
- return nameFromAttribute;
+ return nameFromAttribute;
}
/**
- * The body of the <variable-class> element.
- *
- * @return The name of the class of the variable or
- * 'java.lang.String' if not defined in the TLD.
+ * The body of the <variable-class> element.
+ *
+ * @return The name of the class of the variable or 'java.lang.String' if
+ * not defined in the TLD.
*/
-
public String getClassName() {
- return className;
+ return className;
}
/**
* The body of the <declare> element.
- *
- * @return Whether the variable is to be declared or not.
- * If not defined in the TLD, 'true' will be returned.
+ *
+ * @return Whether the variable is to be declared or not. If not defined in
+ * the TLD, 'true' will be returned.
*/
-
public boolean getDeclare() {
- return declare;
+ return declare;
}
/**
* The body of the <scope> element.
- *
- * @return The scope to give the variable. NESTED
- * scope will be returned if not defined in
- * the TLD.
+ *
+ * @return The scope to give the variable. NESTED scope will be returned if
+ * not defined in the TLD.
*/
-
public int getScope() {
- return scope;
+ return scope;
}
-
/*
* private fields
*/
- private String nameGiven; // <name-given>
- private String nameFromAttribute; // <name-from-attribute>
- private String className; // <class>
- private boolean declare; // <declare>
- private int scope; // <scope>
+ private String nameGiven; // <name-given>
+ private String nameFromAttribute; // <name-from-attribute>
+ private String className; // <class>
+ private boolean declare; // <declare>
+ private int scope; // <scope>
}
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* 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.
-*/
-
-
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 javax.servlet.jsp.tagext;
-
/**
* A validation message from either TagLibraryValidator or TagExtraInfo.
* <p>
- * As of JSP 2.0, a JSP container must support a jsp:id attribute
- * to provide higher quality validation errors.
- * The container will track the JSP pages
- * as passed to the container, and will assign to each element
- * a unique "id", which is passed as the value of the jsp:id
- * attribute. Each XML element in the XML view available will
- * be extended with this attribute. The TagLibraryValidator
- * can then use the attribute in one or more ValidationMessage
- * objects. The container then, in turn, can use these
- * values to provide more precise information on the location
- * of an error.
- *
+ * As of JSP 2.0, a JSP container must support a jsp:id attribute to provide
+ * higher quality validation errors. The container will track the JSP pages as
+ * passed to the container, and will assign to each element a unique "id", which
+ * is passed as the value of the jsp:id attribute. Each XML element in the XML
+ * view available will be extended with this attribute. The TagLibraryValidator
+ * can then use the attribute in one or more ValidationMessage objects. The
+ * container then, in turn, can use these values to provide more precise
+ * information on the location of an error.
* <p>
- * The actual prefix of the <code>id</code> attribute may or may not be
+ * The actual prefix of the <code>id</code> attribute may or may not be
* <code>jsp</code> but it will always map to the namespace
- * <code>http://java.sun.com/JSP/Page</code>. A TagLibraryValidator
+ * <code>http://java.sun.com/JSP/Page</code>. A TagLibraryValidator
* implementation must rely on the uri, not the prefix, of the <code>id</code>
* attribute.
*/
-
public class ValidationMessage {
/**
- * Create a ValidationMessage. The message String should be
- * non-null. The value of id may be null, if the message
- * is not specific to any XML element, or if no jsp:id
- * attributes were passed on. If non-null, the value of
- * id must be the value of a jsp:id attribute for the PageData
+ * Create a ValidationMessage. The message String should be non-null. The
+ * value of id may be null, if the message is not specific to any XML
+ * element, or if no jsp:id attributes were passed on. If non-null, the
+ * value of id must be the value of a jsp:id attribute for the PageData
* passed into the validate() method.
- *
- * @param id Either null, or the value of a jsp:id attribute.
- * @param message A localized validation message.
+ *
+ * @param id
+ * Either null, or the value of a jsp:id attribute.
+ * @param message
+ * A localized validation message.
*/
public ValidationMessage(String id, String message) {
- this.id = id;
- this.message = message;
+ this.id = id;
+ this.message = message;
}
-
/**
- * Get the jsp:id.
- * Null means that there is no information available.
- *
+ * Get the jsp:id. Null means that there is no information available.
+ *
* @return The jsp:id information.
*/
public String getId() {
- return id;
+ return id;
}
/**
* Get the localized validation message.
- *
+ *
* @return A validation message
*/
- public String getMessage(){
- return message;
+ public String getMessage() {
+ return message;
}
// Private data
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* 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.
-*/
-
-
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 javax.servlet.jsp.tagext;
/**
- * Information on the scripting variables that are created/modified by
- * a tag (at run-time). This information is provided by TagExtraInfo
- * classes and it is used by the translation phase of JSP.
- *
+ * Information on the scripting variables that are created/modified by a tag (at
+ * run-time). This information is provided by TagExtraInfo classes and it is
+ * used by the translation phase of JSP.
* <p>
- * Scripting variables generated by a custom action have an associated
- * scope of either AT_BEGIN, NESTED, or AT_END.
- *
+ * Scripting variables generated by a custom action have an associated scope of
+ * either AT_BEGIN, NESTED, or AT_END.
* <p>
- * The class name (VariableInfo.getClassName) in the returned objects
- * is used to determine the types of the scripting variables.
- * Note that because scripting variables are assigned their values
- * from scoped attributes which cannot be of primitive types,
- * "boxed" types such as <code>java.lang.Integer</code> must
- * be used instead of primitives.
- *
+ * The class name (VariableInfo.getClassName) in the returned objects is used to
+ * determine the types of the scripting variables. Note that because scripting
+ * variables are assigned their values from scoped attributes which cannot be of
+ * primitive types, "boxed" types such as
+ * <code>java.lang.Integer</code> must be used instead of primitives.
* <p>
- * The class name may be a Fully Qualified Class Name, or a short
- * class name.
- *
+ * The class name may be a Fully Qualified Class Name, or a short class name.
* <p>
- * If a Fully Qualified Class Name is provided, it should refer to a
- * class that should be in the CLASSPATH for the Web Application (see
- * Servlet 2.4 specification - essentially it is WEB-INF/lib and
- * WEB-INF/classes). Failure to be so will lead to a translation-time
- * error.
- *
+ * If a Fully Qualified Class Name is provided, it should refer to a class that
+ * should be in the CLASSPATH for the Web Application (see Servlet 2.4
+ * specification - essentially it is WEB-INF/lib and WEB-INF/classes). Failure
+ * to be so will lead to a translation-time error.
* <p>
- * If a short class name is given in the VariableInfo objects, then
- * the class name must be that of a public class in the context of the
- * import directives of the page where the custom action appears.
- * The class must also be in the CLASSPATH for the Web Application
- * (see Servlet 2.4 specification - essentially it is WEB-INF/lib and
- * WEB-INF/classes). Failure to be so will lead to a translation-time
- * error.
- *
- * <p><B>Usage Comments</B>
+ * If a short class name is given in the VariableInfo objects, then the class
+ * name must be that of a public class in the context of the import directives
+ * of the page where the custom action appears. The class must also be in the
+ * CLASSPATH for the Web Application (see Servlet 2.4 specification -
+ * essentially it is WEB-INF/lib and WEB-INF/classes). Failure to be so will
+ * lead to a translation-time error.
* <p>
- * Frequently a fully qualified class name will refer to a class that
- * is known to the tag library and thus, delivered in the same JAR
- * file as the tag handlers. In most other remaining cases it will
- * refer to a class that is in the platform on which the JSP processor
- * is built (like J2EE). Using fully qualified class names in this
- * manner makes the usage relatively resistant to configuration
- * errors.
- *
+ * <B>Usage Comments</B>
* <p>
- * A short name is usually generated by the tag library based on some
- * attributes passed through from the custom action user (the author),
- * and it is thus less robust: for instance a missing import directive
- * in the referring JSP page will lead to an invalid short name class
- * and a translation error.
- *
- * <p><B>Synchronization Protocol</B>
- *
+ * Frequently a fully qualified class name will refer to a class that is known
+ * to the tag library and thus, delivered in the same JAR file as the tag
+ * handlers. In most other remaining cases it will refer to a class that is in
+ * the platform on which the JSP processor is built (like J2EE). Using fully
+ * qualified class names in this manner makes the usage relatively resistant to
+ * configuration errors.
* <p>
- * The result of the invocation on getVariableInfo is an array of
- * VariableInfo objects. Each such object describes a scripting
- * variable by providing its name, its type, whether the variable is
- * new or not, and what its scope is. Scope is best described through
- * a picture:
- *
+ * A short name is usually generated by the tag library based on some attributes
+ * passed through from the custom action user (the author), and it is thus less
+ * robust: for instance a missing import directive in the referring JSP page
+ * will lead to an invalid short name class and a translation error.
+ * <p>
+ * <B>Synchronization Protocol</B>
+ * <p>
+ * The result of the invocation on getVariableInfo is an array of VariableInfo
+ * objects. Each such object describes a scripting variable by providing its
+ * name, its type, whether the variable is new or not, and what its scope is.
+ * Scope is best described through a picture:
* <p>
* <IMG src="doc-files/VariableInfo-1.gif"
- * alt="NESTED, AT_BEGIN and AT_END Variable Scopes"/>
- *
- *<p>
+ * alt="NESTED, AT_BEGIN and AT_END Variable Scopes"/>
+ * <p>
* The JSP 2.0 specification defines the interpretation of 3 values:
- *
* <ul>
- * <li> NESTED, if the scripting variable is available between
- * the start tag and the end tag of the action that defines it.
- * <li>
- * AT_BEGIN, if the scripting variable is available from the start tag
- * of the action that defines it until the end of the scope.
- * <li> AT_END, if the scripting variable is available after the end tag
- * of the action that defines it until the end of the scope.
+ * <li>NESTED, if the scripting variable is available between the start tag and
+ * the end tag of the action that defines it.
+ * <li>AT_BEGIN, if the scripting variable is available from the start tag of
+ * the action that defines it until the end of the scope.
+ * <li>AT_END, if the scripting variable is available after the end tag of the
+ * action that defines it until the end of the scope.
* </ul>
- *
- * The scope value for a variable implies what methods may affect its
- * value and thus where synchronization is needed as illustrated by
- * the table below. <b>Note:</b> the synchronization of the variable(s)
- * will occur <em>after</em> the respective method has been called.
- *
- * <blockquote>
- * <table cellpadding="2" cellspacing="2" border="0" width="55%"
- * bgcolor="#999999" summary="Variable Synchronization Points">
+ * The scope value for a variable implies what methods may affect its value and
+ * thus where synchronization is needed as illustrated by the table below.
+ * <b>Note:</b> the synchronization of the variable(s) will occur <em>after</em>
+ * the respective method has been called. <blockquote>
+ * <table cellpadding="2" cellspacing="2" border="0" width="55%" * bgcolor="#999999" summary="Variable Synchronization Points">
* <tbody>
- * <tr align="center">
- * <td valign="top" colspan="6" bgcolor="#999999"><u><b>Variable Synchronization
- * Points</b></u><br>
- * </td>
- * </tr>
- * <tr>
- * <th valign="top" bgcolor="#c0c0c0"> </th>
- * <th valign="top" bgcolor="#c0c0c0" align="center">doStartTag()</th>
- * <th valign="top" bgcolor="#c0c0c0" align="center">doInitBody()</th>
- * <th valign="top" bgcolor="#c0c0c0" align="center">doAfterBody()</th>
- * <th valign="top" bgcolor="#c0c0c0" align="center">doEndTag()</th>
- * <th valign="top" bgcolor="#c0c0c0" align="center">doTag()</th>
- * </tr>
- * <tr>
- * <td valign="top" bgcolor="#c0c0c0"><b>Tag<br>
- * </b></td>
- * <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, NESTED<br>
- * </td>
- * <td valign="top" align="center" bgcolor="#ffffff"><br>
- * </td>
- * <td valign="top" align="center" bgcolor="#ffffff"><br>
- * </td>
- * <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, AT_END<br>
- * </td>
- * <td valign="top" align="center" bgcolor="#ffffff"><br>
- * </td>
- * </tr>
- * <tr>
- * <td valign="top" bgcolor="#c0c0c0"><b>IterationTag<br>
- * </b></td>
- * <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, NESTED<br>
- * </td>
- * <td valign="top" align="center" bgcolor="#ffffff"><br>
- * </td>
- * <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, NESTED<br>
- * </td>
- * <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, AT_END<br>
- * </td>
- * <td valign="top" align="center" bgcolor="#ffffff"><br>
- * </td>
- * </tr>
- * <tr>
- * <td valign="top" bgcolor="#c0c0c0"><b>BodyTag<br>
- * </b></td>
- * <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, NESTED<sup>1</sup><br>
- * </td>
- * <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, NESTED<sup>1</sup><br>
- * </td>
- * <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, NESTED<br>
- * </td>
- * <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, AT_END<br>
- * </td>
- * <td valign="top" align="center" bgcolor="#ffffff"><br>
- * </td>
- * </tr>
- * <tr>
- * <td valign="top" bgcolor="#c0c0c0"><b>SimpleTag<br>
- * </b></td>
- * <td valign="top" align="center" bgcolor="#ffffff"><br>
- * </td>
- * <td valign="top" align="center" bgcolor="#ffffff"><br>
- * </td>
- * <td valign="top" align="center" bgcolor="#ffffff"><br>
- * </td>
- * <td valign="top" align="center" bgcolor="#ffffff"><br>
- * </td>
- * <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, AT_END<br>
- * </td>
- * </tr>
+ * <tr align="center">
+ * <td valign="top" colspan="6" bgcolor="#999999"><u><b>Variable Synchronization
+ * Points</b></u><br>
+ * </td>
+ * </tr>
+ * <tr>
+ * <th valign="top" bgcolor="#c0c0c0"> </th>
+ * <th valign="top" bgcolor="#c0c0c0" align="center">doStartTag()</th>
+ * <th valign="top" bgcolor="#c0c0c0" align="center">doInitBody()</th>
+ * <th valign="top" bgcolor="#c0c0c0" align="center">doAfterBody()</th>
+ * <th valign="top" bgcolor="#c0c0c0" align="center">doEndTag()</th>
+ * <th valign="top" bgcolor="#c0c0c0" align="center">doTag()</th>
+ * </tr>
+ * <tr>
+ * <td valign="top" bgcolor="#c0c0c0"><b>Tag<br>
+ * </b></td>
+ * <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, NESTED<br>
+ * </td>
+ * <td valign="top" align="center" bgcolor="#ffffff"><br>
+ * </td>
+ * <td valign="top" align="center" bgcolor="#ffffff"><br>
+ * </td>
+ * <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, AT_END<br>
+ * </td>
+ * <td valign="top" align="center" bgcolor="#ffffff"><br>
+ * </td>
+ * </tr>
+ * <tr>
+ * <td valign="top" bgcolor="#c0c0c0"><b>IterationTag<br>
+ * </b></td>
+ * <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, NESTED<br>
+ * </td>
+ * <td valign="top" align="center" bgcolor="#ffffff"><br>
+ * </td>
+ * <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, NESTED<br>
+ * </td>
+ * <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, AT_END<br>
+ * </td>
+ * <td valign="top" align="center" bgcolor="#ffffff"><br>
+ * </td>
+ * </tr>
+ * <tr>
+ * <td valign="top" bgcolor="#c0c0c0"><b>BodyTag<br>
+ * </b></td>
+ * <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN,
+ * NESTED<sup>1</sup><br>
+ * </td>
+ * <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN,
+ * NESTED<sup>1</sup><br>
+ * </td>
+ * <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, NESTED<br>
+ * </td>
+ * <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, AT_END<br>
+ * </td>
+ * <td valign="top" align="center" bgcolor="#ffffff"><br>
+ * </td>
+ * </tr>
+ * <tr>
+ * <td valign="top" bgcolor="#c0c0c0"><b>SimpleTag<br>
+ * </b></td>
+ * <td valign="top" align="center" bgcolor="#ffffff"><br>
+ * </td>
+ * <td valign="top" align="center" bgcolor="#ffffff"><br>
+ * </td>
+ * <td valign="top" align="center" bgcolor="#ffffff"><br>
+ * </td>
+ * <td valign="top" align="center" bgcolor="#ffffff"><br>
+ * </td>
+ * <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, AT_END<br>
+ * </td>
+ * </tr>
* </tbody>
* </table>
- * <sup>1</sup> Called after <code>doStartTag()</code> if
- * <code>EVAL_BODY_INCLUDE</code> is returned, or after
- * <code>doInitBody()</code> otherwise.
- * </blockquote>
- *
- * <p><B>Variable Information in the TLD</B>
+ * <sup>1</sup> Called after <code>doStartTag()</code> if
+ * <code>EVAL_BODY_INCLUDE</code> is returned, or after
+ * <code>doInitBody()</code> otherwise. </blockquote>
+ * <p>
+ * <B>Variable Information in the TLD</B>
* <p>
* Scripting variable information can also be encoded directly for most cases
* into the Tag Library Descriptor using the <variable> subelement of the
- * <tag> element. See the JSP specification.
+ * <tag> element. See the JSP specification.
*/
-
public class VariableInfo {
/**
*/
public static final int AT_END = 2;
-
/**
- * Constructor
- * These objects can be created (at translation time) by the TagExtraInfo
- * instances.
- *
- * @param varName The name of the scripting variable
- * @param className The type of this variable
- * @param declare If true, it is a new variable (in some languages this will
- * require a declaration)
- * @param scope Indication on the lexical scope of the variable
+ * Constructor These objects can be created (at translation time) by the
+ * TagExtraInfo instances.
+ *
+ * @param varName
+ * The name of the scripting variable
+ * @param className
+ * The type of this variable
+ * @param declare
+ * If true, it is a new variable (in some languages this will
+ * require a declaration)
+ * @param scope
+ * Indication on the lexical scope of the variable
*/
-
- public VariableInfo(String varName,
- String className,
- boolean declare,
- int scope) {
- this.varName = varName;
- this.className = className;
- this.declare = declare;
- this.scope = scope;
+ public VariableInfo(String varName, String className, boolean declare,
+ int scope) {
+ this.varName = varName;
+ this.className = className;
+ this.declare = declare;
+ this.scope = scope;
}
// Accessor methods
-
+
/**
* Returns the name of the scripting variable.
- *
+ *
* @return the name of the scripting variable
*/
- public String getVarName() {
- return varName;
+ public String getVarName() {
+ return varName;
}
-
+
/**
* Returns the type of this variable.
- *
+ *
* @return the type of this variable
*/
- public String getClassName() {
- return className;
+ public String getClassName() {
+ return className;
}
-
+
/**
- * Returns whether this is a new variable.
- * If so, in some languages this will require a declaration.
- *
+ * Returns whether this is a new variable. If so, in some languages this
+ * will require a declaration.
+ *
* @return whether this is a new variable.
*/
- public boolean getDeclare() {
- return declare;
+ public boolean getDeclare() {
+ return declare;
}
-
+
/**
* Returns the lexical scope of the variable.
*
- * @return the lexical scope of the variable, either AT_BEGIN, AT_END,
- * or NESTED.
+ * @return the lexical scope of the variable, either AT_BEGIN, AT_END, or
+ * NESTED.
* @see #AT_BEGIN
* @see #AT_END
* @see #NESTED
*/
- public int getScope() {
- return scope;
+ public int getScope() {
+ return scope;
}
-
// == private data
private String varName;
private String className;
private boolean declare;
private int scope;
}
-