01: /*
02: * $Id: MarkupElement.java 460102 2006-04-01 23:34:49Z jcompagner $
03: * $Revision: 460102 $
04: * $Date: 2006-04-02 01:34:49 +0200 (Sun, 02 Apr 2006) $
05: *
06: * ==============================================================================
07: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
08: * use this file except in compliance with the License. You may obtain a copy of
09: * the License at
10: *
11: * http://www.apache.org/licenses/LICENSE-2.0
12: *
13: * Unless required by applicable law or agreed to in writing, software
14: * distributed under the License is distributed on an "AS IS" BASIS,
15: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16: * See the License for the specific language governing permissions and
17: * limitations under the License.
18: */
19: package wicket.markup;
20:
21: /**
22: * Base class for different kinds of markup elements. Markup elements are
23: * held in a Markup container object.
24: * <p>
25: * Wicket divides markup like (x)html, wml etc. into two types of MarkupElements:
26: * <ul>
27: * <li>ComponentTag, which represents a "significant" markup tag (meaning that
28: * the tag has some meaning to Wicket)
29: * <li>RawMarkup, which is a section of unparsed markup having no meaning to Wicket.
30: * </ul>
31: *
32: * @see Markup
33: * @see wicket.markup.RawMarkup
34: * @see ComponentTag
35: * @author Jonathan Locke
36: */
37: public abstract class MarkupElement {
38: /**
39: * Constructor.
40: */
41: public MarkupElement() {
42: }
43:
44: /**
45: * Gets whether this element closes the given element.
46: * @param open The open tag
47: * @return True if this markup element closes the given open tag
48: */
49: public boolean closes(final MarkupElement open) {
50: return false;
51: }
52:
53: /**
54: * @return Gets the charseqence representation of this element
55: */
56: public abstract CharSequence toCharSequence();
57:
58: /**
59: * Gets a string represenetation.
60: * @return A string representation suitable for displaying to the user
61: * when something goes wrong.
62: */
63: public abstract String toUserDebugString();
64: }
|