01: /*
02: * Copyright 1999-2002,2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.jasig.portal.serialize;
18:
19: import java.util.Hashtable;
20:
21: /**
22: * Holds the state of the currently serialized element.
23: *
24: *
25: * @version $Revision: 36560 $ $Date: 2006-04-28 11:40:04 -0700 (Fri, 28 Apr 2006) $
26: * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
27: * @see BaseMarkupSerializer
28: */
29: public class ElementState {
30:
31: /**
32: * The element's raw tag name (local or prefix:local).
33: */
34: public String rawName;
35:
36: /**
37: * The element's local tag name.
38: */
39: public String localName;
40:
41: /**
42: * The element's namespace URI.
43: */
44: public String namespaceURI;
45:
46: /**
47: * True if element is space preserving.
48: */
49: public boolean preserveSpace;
50:
51: /**
52: * True if element is empty. Turns false immediately
53: * after serializing the first contents of the element.
54: */
55: public boolean empty;
56:
57: /**
58: * True if the last serialized node was an element node.
59: */
60: public boolean afterElement;
61:
62: /**
63: * True if the last serialized node was a comment node.
64: */
65: public boolean afterComment;
66:
67: /**
68: * True if textual content of current element should be
69: * serialized as CDATA section.
70: */
71: public boolean doCData;
72:
73: /**
74: * True if textual content of current element should be
75: * serialized as raw characters (unescaped).
76: */
77: public boolean unescaped;
78:
79: /**
80: * True while inside CData and printing text as CData.
81: */
82: public boolean inCData;
83:
84: /**
85: * Association between namespace URIs (keys) and prefixes (values).
86: */
87: public Hashtable prefixes;
88:
89: public boolean inScript;
90:
91: }
|