001: /*
002: * Copyright (c) 1998-2003 Caucho Technology -- all rights reserved
003: *
004: * This file is part of Resin(R) Open Source
005: *
006: * Each copy or derived work must preserve the copyright notice and this
007: * notice unmodified.
008: *
009: * Resin Open Source is free software; you can redistribute it and/or modify
010: * it under the terms of the GNU General Public License as published by
011: * the Free Software Foundation; either version 2 of the License, or
012: * (at your option) any later version.
013: *
014: * Resin Open Source is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017: * of NON-INFRINGEMENT. See the GNU General Public License for more
018: * details.
019: *
020: * You should have received a copy of the GNU General Public License
021: * along with Resin Open Source; if not, write to the
022: *
023: * Free Software Foundation, Inc.
024: * 59 Temple Place, Suite 330
025: * Boston, MA 02111-1307 USA
026: *
027: * @author Scott Ferguson
028: */
029:
030: package javax.servlet.jsp;
031:
032: import javax.el.ELContext;
033: import javax.servlet.jsp.el.ExpressionEvaluator;
034: import javax.servlet.jsp.el.VariableResolver;
035: import java.io.Writer;
036: import java.util.Enumeration;
037:
038: public abstract class JspContext {
039: /**
040: * Returns the current output for the page.
041: */
042: public abstract JspWriter getOut();
043:
044: /**
045: * Gets the named page attribute.
046: *
047: * @param name of the attribute
048: */
049: public abstract Object getAttribute(String name);
050:
051: /**
052: * Sets the named page attribute.
053: *
054: * @param name name of the attribute
055: * @param attribute non-null attribute value.
056: */
057: public abstract void setAttribute(String name, Object attribute);
058:
059: /**
060: * Removes the named page attribute.
061: */
062: public abstract void removeAttribute(String name);
063:
064: /**
065: * Return an enumeration of all the attribute names.
066: */
067: public abstract Enumeration getAttributeNames();
068:
069: /**
070: * Sets an attribute in a given scope. You should use the scope-specific
071: * routines instead, like request.setAttribute.
072: *
073: * @param name attribute name
074: * @param o attribute value
075: * @param scope attribute scope
076: */
077: public abstract void setAttribute(String name, Object o, int scope);
078:
079: /**
080: * Gets an attribute in a given scope. You should use the scope-specific
081: * routines instead, like request.getAttribute.
082: *
083: * @param name attribute name
084: * @param scope attribute scope
085: */
086: public abstract Object getAttribute(String name, int scope);
087:
088: /**
089: * Removes an attribute in a given scope. You should use the scope-specific
090: * routines instead, like request.removeAttribute.
091: */
092: public abstract void removeAttribute(String name, int scope);
093:
094: /**
095: * Lists attribute names in a given scope. You should use the scope-specific
096: * routines instead, like request.getAttributeNames
097: */
098: public abstract Enumeration getAttributeNamesInScope(int scope);
099:
100: /**
101: * Returns the scope for an attribute.
102: */
103: public abstract int getAttributesScope(String name);
104:
105: /**
106: * Finds an attribute in all scopes.
107: */
108: public abstract Object findAttribute(String name);
109:
110: /**
111: * Internal routine to support BodyTags.
112: */
113: public JspWriter pushBody(Writer writer) {
114: return null;
115: }
116:
117: /**
118: * Internal routine to support BodyTags.
119: */
120: public JspWriter popBody() {
121: return null;
122: }
123:
124: /**
125: * Returns an expression evaluator for creating JSP EL expressions.
126: * @Deprecated
127: */
128: public abstract ExpressionEvaluator getExpressionEvaluator();
129:
130: /**
131: * Returns a variable resolver for evaluating JSP EL expressions.
132: * @Deprecated
133: */
134: public abstract VariableResolver getVariableResolver();
135:
136: /**
137: * Returns the EL context with the JspContext
138: */
139: public abstract ELContext getELContext();
140: }
|