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: Namespace.java 0000 2007-01-11 00:00:00Z ekuns $
17   */
18  package org.castor.xmlctf.xmldiff.xml.nodes;
19  
20  /**
21   * A class representing a Namespace for an Element.  Objects of this type
22   * are not part of the XML node tree.
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 Namespace  {
29  
30      /** Prefix for this Namespace */
31      private final String      _prefix;
32      /** Namespace URI of this Namespace. */
33      private final String      _namespaceUri;
34  
35      /**
36       * Creates a new Namespace object for an XML Element.
37       *
38       * @param prefix the prefix of this namespace binding. (May be null.)
39       * @param namespaceURI the namespace URI mapped to this prefix. (May be
40       *        null.)
41       */
42      public Namespace(final String prefix, final String namespaceURI) {
43          _prefix        = prefix;
44          _namespaceUri  = namespaceURI;
45      }
46  
47      /**
48       * Returns the prefix of this namespace.
49       * @return The prefix of this namespace.
50       */
51      public String getPrefix() {
52          return _prefix;
53      }
54  
55      /**
56       * Returns the string value of the namespace.
57       * @return The string value of the namespace.
58       */
59      public String getNamespaceUri() {
60          return _namespaceUri;
61      }
62  
63  }