1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   * 
13   */
14  
15  package com.liferay.portal.xml;
16  
17  import com.liferay.portal.kernel.xml.Namespace;
18  import com.liferay.portal.kernel.xml.QName;
19  
20  /**
21   * <a href="QNameImpl.java.html"><b><i>View Source</i></b></a>
22   *
23   * @author Brian Wing Shun Chan
24   */
25  public class QNameImpl implements QName {
26  
27      public QNameImpl(org.dom4j.QName qName) {
28          _qName = qName;
29      }
30  
31      public boolean equals(Object obj) {
32          org.dom4j.QName qName = ((QNameImpl)obj).getWrappedQName();
33  
34          return _qName.equals(qName);
35      }
36  
37      public String getName() {
38          return _qName.getName();
39      }
40  
41      public Namespace getNamespace() {
42          org.dom4j.Namespace namespace = _qName.getNamespace();
43  
44          if (namespace == null) {
45              return null;
46          }
47          else {
48              return new NamespaceImpl(namespace);
49          }
50      }
51  
52      public String getNamespacePrefix() {
53          return _qName.getNamespacePrefix();
54      }
55  
56      public String getNamespaceURI() {
57          return _qName.getNamespaceURI();
58      }
59  
60      public String getQualifiedName() {
61          return _qName.getQualifiedName();
62      }
63  
64      public org.dom4j.QName getWrappedQName() {
65          return _qName;
66      }
67  
68      public int hashCode() {
69          return _qName.hashCode();
70      }
71  
72      private org.dom4j.QName _qName;
73  
74  }