View Javadoc
1   /*
2    * Copyright 2007 Edward Kuns
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
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   * $Id: Root.java 0000 2007-01-11 00:00:00Z ekuns $
17   */
18  package org.castor.xmlctf.xmldiff.xml.nodes;
19  
20  
21  /**
22   * A representation of a Root node.
23   *
24   * @author <a href="mailto:edward.kuns@aspect.com">Edward Kuns</a>
25   * @version $Revision: 0000 $ $Date: 2007-01-11 00:00:00 -0600 (Thu, 11 Jan 2007) $
26   * @since Castor 1.1
27   */
28  public class Root extends ParentNode {
29  
30      /** Serial Version UID. */
31      private static final long   serialVersionUID = -4945943618209646133L;
32      /** Local name for a root object is special. */
33      private static final String ROOT_NAME = "#root";
34  
35      /**
36       * Creates a new Root Node.  Basically, a root node can contain only
37       * Elements and nothing else.
38       */
39      public Root() {
40          super(null, ROOT_NAME, XMLNode.ROOT);
41      }
42  
43      /**
44       * Returns the root node, i.e., <code>this</code>.
45       * @return The root node.
46       */
47      public XMLNode getRootNode() {
48          return this;
49      }
50  
51  }