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