View Javadoc

1   /**
2    *
3    * Copyright 2006 The Apache Software Foundation
4    *
5    *  Licensed under the Apache License, Version 2.0 (the "License");
6    *  you may not use this file except in compliance with the License.
7    *  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   *  Unless required by applicable law or agreed to in writing, software
12   *  distributed under the License is distributed on an "AS IS" BASIS,
13   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   *  See the License for the specific language governing permissions and
15   *  limitations under the License.
16   */
17  
18  /*
19   * This code has been borrowed from the Apache Xerces project. We're copying the code to
20   * keep from adding a dependency on Xerces in the Geronimo kernel.
21   */
22  
23  package org.apache.geronimo.system.configuration;
24  
25  import java.util.Hashtable;
26  
27  /**
28   * Holds the state of the currently serialized element.
29   *
30   *
31   * @version $Revision: 410741 $ $Date: 2006-05-31 21:35:48 -0700 (Wed, 31 May 2006) $
32   * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
33   * @see BaseMarkupSerializer
34   */
35  public class ElementState
36  {
37  
38  
39      /**
40       * The element's raw tag name (local or prefix:local).
41       */
42      String rawName;
43  
44  
45      /**
46       * The element's local tag name.
47       */
48      String localName;
49  
50  
51      /**
52       * The element's namespace URI.
53       */
54      String namespaceURI;
55  
56  
57      /**
58       * True if element is space preserving.
59       */
60      boolean preserveSpace;
61  
62  
63      /**
64       * True if element is empty. Turns false immediately
65       * after serializing the first contents of the element.
66       */
67      boolean empty;
68  
69  
70      /**
71       * True if the last serialized node was an element node.
72       */
73      boolean afterElement;
74  
75  
76      /**
77       * True if the last serialized node was a comment node.
78       */
79      boolean afterComment;
80  
81  
82      /**
83       * True if textual content of current element should be
84       * serialized as CDATA section.
85       */
86      boolean doCData;
87  
88  
89      /**
90       * True if textual content of current element should be
91       * serialized as raw characters (unescaped).
92       */
93      boolean unescaped;
94  
95  
96      /**
97       * True while inside CData and printing text as CData.
98       */
99      boolean inCData;
100 
101 
102     /**
103      * Association between namespace URIs (keys) and prefixes (values).
104      */
105     Hashtable prefixes;
106 
107 
108 }