001    /**
002     *  Licensed to the Apache Software Foundation (ASF) under one or more
003     *  contributor license agreements.  See the NOTICE file distributed with
004     *  this work for additional information regarding copyright ownership.
005     *  The ASF licenses this file to You under the Apache License, Version 2.0
006     *  (the "License"); you may not use this file except in compliance with
007     *  the License.  You may obtain a copy of the License at
008     *
009     *     http://www.apache.org/licenses/LICENSE-2.0
010     *
011     *  Unless required by applicable law or agreed to in writing, software
012     *  distributed under the License is distributed on an "AS IS" BASIS,
013     *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     *  See the License for the specific language governing permissions and
015     *  limitations under the License.
016     */
017    
018    /*
019     * This code has been borrowed from the Apache Xerces project. We're copying the code to
020     * keep from adding a dependency on Xerces in the Geronimo kernel.
021     */
022    
023    package org.apache.geronimo.system.configuration;
024    
025    import java.util.Hashtable;
026    
027    /**
028     * Holds the state of the currently serialized element.
029     *
030     *
031     * @version $Revision: 476049 $ $Date: 2006-11-16 23:35:17 -0500 (Thu, 16 Nov 2006) $
032     * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
033     * @see BaseMarkupSerializer
034     */
035    public class ElementState
036    {
037    
038    
039        /**
040         * The element's raw tag name (local or prefix:local).
041         */
042        String rawName;
043    
044    
045        /**
046         * The element's local tag name.
047         */
048        String localName;
049    
050    
051        /**
052         * The element's namespace URI.
053         */
054        String namespaceURI;
055    
056    
057        /**
058         * True if element is space preserving.
059         */
060        boolean preserveSpace;
061    
062    
063        /**
064         * True if element is empty. Turns false immediately
065         * after serializing the first contents of the element.
066         */
067        boolean empty;
068    
069    
070        /**
071         * True if the last serialized node was an element node.
072         */
073        boolean afterElement;
074    
075    
076        /**
077         * True if the last serialized node was a comment node.
078         */
079        boolean afterComment;
080    
081    
082        /**
083         * True if textual content of current element should be
084         * serialized as CDATA section.
085         */
086        boolean doCData;
087    
088    
089        /**
090         * True if textual content of current element should be
091         * serialized as raw characters (unescaped).
092         */
093        boolean unescaped;
094    
095    
096        /**
097         * True while inside CData and printing text as CData.
098         */
099        boolean inCData;
100    
101    
102        /**
103         * Association between namespace URIs (keys) and prefixes (values).
104         */
105        Hashtable prefixes;
106    
107    
108    }