View Javadoc
1   /*
2    * Copyright 2007 Edward Kuns
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5    * in compliance with the License. You may obtain a copy of the License at
6    *
7    * http://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software distributed under the License
10   * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11   * or implied. See the License for the specific language governing permissions and limitations under
12   * the License.
13   *
14   * $Id: Root.java 0000 2007-01-11 00:00:00Z ekuns $
15   */
16  package org.castor.xmlctf.xmldiff.xml.nodes;
17  
18  
19  /**
20   * A representation of a Root node.
21   *
22   * @author <a href="mailto:edward.kuns@aspect.com">Edward Kuns</a>
23   * @version $Revision: 0000 $ $Date: 2007-01-11 00:00:00 -0600 (Thu, 11 Jan 2007) $
24   * @since Castor 1.1
25   */
26  public class Root extends ParentNode {
27  
28    /** Serial Version UID. */
29    private static final long serialVersionUID = -4945943618209646133L;
30    /** Local name for a root object is special. */
31    private static final String ROOT_NAME = "#root";
32  
33    /**
34     * Creates a new Root Node. Basically, a root node can contain only Elements and nothing else.
35     */
36    public Root() {
37      super(null, ROOT_NAME, XMLNode.ROOT);
38    }
39  
40    /**
41     * Returns the root node, i.e., <code>this</code>.
42     * 
43     * @return The root node.
44     */
45    public XMLNode getRootNode() {
46      return this;
47    }
48  
49  }