001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.xml;
016    
017    import com.liferay.portal.kernel.util.StringPool;
018    import com.liferay.portal.kernel.xml.DocumentType;
019    
020    /**
021     * @author Brian Wing Shun Chan
022     */
023    public class DocumentTypeImpl implements DocumentType {
024    
025            public DocumentTypeImpl(org.dom4j.DocumentType documentType) {
026                    _documentType = documentType;
027            }
028    
029            public String getName() {
030                    return _documentType.getName();
031            }
032    
033            public String getPublicId() {
034                    if (_documentType == null) {
035                            return null;
036                    }
037    
038                    return _documentType.getPublicID();
039            }
040    
041            public String getSystemId() {
042                    if (_documentType == null) {
043                            return null;
044                    }
045    
046                    return _documentType.getSystemID();
047            }
048    
049            public org.dom4j.DocumentType getWrappedDocumentType() {
050                    return _documentType;
051            }
052    
053            @Override
054            public int hashCode() {
055                    if (_documentType == null) {
056                            return super.hashCode();
057                    }
058    
059                    return _documentType.hashCode();
060            }
061    
062            @Override
063            public String toString() {
064                    if (_documentType == null) {
065                            return StringPool.BLANK;
066                    }
067    
068                    return _documentType.toString();
069            }
070    
071            private org.dom4j.DocumentType _documentType;
072    
073    }