001: //** Copyright Statement ***************************************************
002: //The Salmon Open Framework for Internet Applications (SOFIA)
003: // Copyright (C) 1999 - 2002, Salmon LLC
004: //
005: // This program is free software; you can redistribute it and/or
006: // modify it under the terms of the GNU General Public License version 2
007: // as published by the Free Software Foundation;
008: //
009: // This program is distributed in the hope that it will be useful,
010: // but WITHOUT ANY WARRANTY; without even the implied warranty of
011: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: // GNU General Public License for more details.
013: //
014: // You should have received a copy of the GNU General Public License
015: // along with this program; if not, write to the Free Software
016: // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
017: //
018: // For more information please visit http://www.salmonllc.com
019: //** End Copyright Statement ***************************************************
020: package com.salmonllc.jsp.engine;
021:
022: /////////////////////////
023: //$Archive: /SOFIA/SourceCode/com/salmonllc/jsp/engine/JspElement.java $
024: //$Author: Srufle $
025: //$Revision: 14 $
026: //$Modtime: 4/15/03 1:56a $
027: /////////////////////////
028: /**
029: * Holds one element in a JSP page.
030: */
031: import java.util.Vector;
032:
033: import javax.servlet.jsp.tagext.TagSupport;
034:
035: class JspElement {
036: private JspElement _next;
037: private String _text;
038: private TagSupport _handler;
039: private int _type;
040: private String _error;
041: private String _name;
042: private Vector _attributes;
043: private String _prefix;
044: private JspElement _closingTag;
045:
046: public static final int TAG_EMPTY = 0;
047: public static final int TAG_BODY_START = 1;
048: public static final int TAG_BODY_END = 2;
049: public static final int TAG_HTML = 3;
050: public static final int TAG_ERROR = 4;
051: public static final int TAG_NULL = -1;
052:
053: public JspElement(String name, String prefix, String text,
054: int type, TagSupport handler, String error) {
055: _name = name;
056: _text = text;
057: _type = type;
058: _handler = handler;
059: _error = error;
060: _prefix = prefix;
061: }
062:
063: public JspElement(String name, String prefix, String text,
064: int type, TagSupport handler, String error,
065: Vector attributes) {
066: this (name, prefix, text, type, handler, error);
067: _attributes = attributes;
068: }
069:
070: public Vector getAttributes() {
071: return _attributes;
072: }
073:
074: public JspElement getClosingTag() {
075: return _closingTag;
076: }
077:
078: public String getError() {
079: return _error;
080: }
081:
082: public TagSupport getHandler() {
083: return _handler;
084: }
085:
086: public String getName() {
087: return _name;
088: }
089:
090: public JspElement getNext() {
091: return _next;
092: }
093:
094: public String getPrefix() {
095: return _prefix;
096: }
097:
098: public String getText() {
099: return _text;
100: }
101:
102: public int getType() {
103: return _type;
104: }
105:
106: public void setClosingTag(JspElement tag) {
107: _closingTag = tag;
108: }
109:
110: public void setError(String error) {
111: _error = error;
112: _type = TAG_ERROR;
113: }
114:
115: public void setNext(JspElement next) {
116: _next = next;
117: }
118:
119: public String toString() {
120: return _text + "\n";
121: }
122: }
|