You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2015/07/19 21:34:30 UTC

svn commit: r1691846 - in /webservices/axiom: experimental/dom/src/main/java/org/apache/axiom/dom/impl/ trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/ trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/ trunk/aspects/om-aspec...

Author: veithen
Date: Sun Jul 19 19:34:30 2015
New Revision: 1691846

URL: http://svn.apache.org/r1691846
Log:
Unify the document type declaration code.

Added:
    webservices/axiom/experimental/dom/src/main/java/org/apache/axiom/dom/impl/DocumentTypeImpl.java   (with props)
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclaration.java   (with props)
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclarationSupport.aj   (with props)
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocTypeSupport.aj   (with props)
    webservices/axiom/trunk/aspects/shared-aspects/src/main/java/org/apache/axiom/shared/DocumentTypeDeclarationSupport.aj   (with props)
    webservices/axiom/trunk/aspects/shared-aspects/src/main/java/org/apache/axiom/shared/IDocumentTypeDeclaration.java   (with props)
Modified:
    webservices/axiom/experimental/dom/src/main/java/org/apache/axiom/dom/impl/NodeFactoryImpl.java
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactory.java
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentType.java
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentTypeSupport.aj
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocType.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AxiomNodeFactorySupport.aj
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentTypeImpl.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
    webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocTypeImpl.java
    webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java

Added: webservices/axiom/experimental/dom/src/main/java/org/apache/axiom/dom/impl/DocumentTypeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/experimental/dom/src/main/java/org/apache/axiom/dom/impl/DocumentTypeImpl.java?rev=1691846&view=auto
==============================================================================
--- webservices/axiom/experimental/dom/src/main/java/org/apache/axiom/dom/impl/DocumentTypeImpl.java (added)
+++ webservices/axiom/experimental/dom/src/main/java/org/apache/axiom/dom/impl/DocumentTypeImpl.java Sun Jul 19 19:34:30 2015
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.dom.impl;
+
+import org.apache.axiom.dom.DOMDocumentType;
+
+final class DocumentTypeImpl extends LeafNode implements DOMDocumentType {
+
+}

Propchange: webservices/axiom/experimental/dom/src/main/java/org/apache/axiom/dom/impl/DocumentTypeImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axiom/experimental/dom/src/main/java/org/apache/axiom/dom/impl/NodeFactoryImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/experimental/dom/src/main/java/org/apache/axiom/dom/impl/NodeFactoryImpl.java?rev=1691846&r1=1691845&r2=1691846&view=diff
==============================================================================
--- webservices/axiom/experimental/dom/src/main/java/org/apache/axiom/dom/impl/NodeFactoryImpl.java (original)
+++ webservices/axiom/experimental/dom/src/main/java/org/apache/axiom/dom/impl/NodeFactoryImpl.java Sun Jul 19 19:34:30 2015
@@ -21,6 +21,7 @@ package org.apache.axiom.dom.impl;
 import org.apache.axiom.core.CoreCDATASection;
 import org.apache.axiom.core.CoreCharacterData;
 import org.apache.axiom.core.CoreDocument;
+import org.apache.axiom.core.CoreDocumentTypeDeclaration;
 import org.apache.axiom.core.CoreNSAwareAttribute;
 import org.apache.axiom.core.CoreNSUnawareAttribute;
 import org.apache.axiom.core.CoreNamespaceDeclaration;
@@ -37,6 +38,10 @@ final class NodeFactoryImpl implements D
         throw new UnsupportedOperationException();
     }
 
+    public CoreDocumentTypeDeclaration createDocumentTypeDeclaration() {
+        return new DocumentTypeImpl();
+    }
+
     public CoreCharacterData createCharacterData() {
         // TODO
         throw new UnsupportedOperationException();

Added: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclaration.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclaration.java?rev=1691846&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclaration.java (added)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclaration.java Sun Jul 19 19:34:30 2015
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.core;
+
+public interface CoreDocumentTypeDeclaration extends CoreChildNode {
+
+}

Propchange: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclaration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclarationSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclarationSupport.aj?rev=1691846&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclarationSupport.aj (added)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclarationSupport.aj Sun Jul 19 19:34:30 2015
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.core;
+
+public aspect CoreDocumentTypeDeclarationSupport {
+    private String CoreDocumentTypeDeclaration.rootName;
+    private String CoreDocumentTypeDeclaration.publicId;
+    private String CoreDocumentTypeDeclaration.systemId;
+    private String CoreDocumentTypeDeclaration.internalSubset;
+    
+    public final String CoreDocumentTypeDeclaration.coreGetRootName() {
+        return rootName;
+    }
+    
+    public final void CoreDocumentTypeDeclaration.coreSetRootName(String rootName) {
+        this.rootName = rootName;
+    }
+    
+    public final String CoreDocumentTypeDeclaration.coreGetPublicId() {
+        return publicId;
+    }
+    
+    public final void CoreDocumentTypeDeclaration.coreSetPublicId(String publicId) {
+        this.publicId = publicId;
+    }
+    
+    public final String CoreDocumentTypeDeclaration.coreGetSystemId() {
+        return systemId;
+    }
+    
+    public final void CoreDocumentTypeDeclaration.coreSetSystemId(String systemId) {
+        this.systemId = systemId;
+    }
+    
+    public final String CoreDocumentTypeDeclaration.coreGetInternalSubset() {
+        return internalSubset;
+    }
+    
+    public final void CoreDocumentTypeDeclaration.coreSetInternalSubset(String internalSubset) {
+        this.internalSubset = internalSubset;
+    }
+}

Propchange: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclarationSupport.aj
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactory.java?rev=1691846&r1=1691845&r2=1691846&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactory.java (original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactory.java Sun Jul 19 19:34:30 2015
@@ -20,6 +20,7 @@ package org.apache.axiom.core;
 
 public interface NodeFactory {
     CoreDocument createDocument();
+    CoreDocumentTypeDeclaration createDocumentTypeDeclaration();
     CoreCharacterData createCharacterData();
     CoreCDATASection createCDATASection();
     CoreNSUnawareAttribute createAttribute(CoreDocument document, String name, String value, String type);

Modified: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentType.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentType.java?rev=1691846&r1=1691845&r2=1691846&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentType.java (original)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentType.java Sun Jul 19 19:34:30 2015
@@ -18,8 +18,9 @@
  */
 package org.apache.axiom.dom;
 
+import org.apache.axiom.shared.IDocumentTypeDeclaration;
 import org.w3c.dom.DocumentType;
 
-public interface DOMDocumentType extends DOMLeafNode, DocumentType {
+public interface DOMDocumentType extends DOMLeafNode, DocumentType, IDocumentTypeDeclaration {
 
 }

Modified: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentTypeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentTypeSupport.aj?rev=1691846&r1=1691845&r2=1691846&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentTypeSupport.aj (original)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentTypeSupport.aj Sun Jul 19 19:34:30 2015
@@ -18,11 +18,33 @@
  */
 package org.apache.axiom.dom;
 
+import org.w3c.dom.NamedNodeMap;
+
 public aspect DOMDocumentTypeSupport {
+    public final short DOMDocumentType.getNodeType() {
+        return DOCUMENT_TYPE_NODE;
+    }
+
+    public final String DOMDocumentType.getNodeName() {
+        return getName();
+    }
+
     public final String DOMDocumentType.getNodeValue() {
         return null;
     }
 
     public final void DOMDocumentType.setNodeValue(String nodeValue) {
     }
+
+    public final String DOMDocumentType.getName() {
+        return coreGetRootName();
+    }
+
+    public final NamedNodeMap DOMDocumentType.getEntities() {
+        throw new UnsupportedOperationException();
+    }
+
+    public final NamedNodeMap DOMDocumentType.getNotations() {
+        throw new UnsupportedOperationException();
+    }
 }

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocType.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocType.java?rev=1691846&r1=1691845&r2=1691846&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocType.java (original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocType.java Sun Jul 19 19:34:30 2015
@@ -19,7 +19,8 @@
 package org.apache.axiom.om.impl.common;
 
 import org.apache.axiom.om.OMDocType;
+import org.apache.axiom.shared.IDocumentTypeDeclaration;
 
-public interface AxiomDocType extends OMDocType, AxiomLeafNode {
+public interface AxiomDocType extends OMDocType, AxiomLeafNode, IDocumentTypeDeclaration {
 
 }

Added: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocTypeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocTypeSupport.aj?rev=1691846&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocTypeSupport.aj (added)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocTypeSupport.aj Sun Jul 19 19:34:30 2015
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.om.impl.common;
+
+import org.apache.axiom.om.OMOutputFormat;
+import org.apache.axiom.om.impl.common.serializer.push.OutputException;
+import org.apache.axiom.om.impl.common.serializer.push.Serializer;
+
+public aspect AxiomDocTypeSupport {
+    public final int AxiomDocType.getType() {
+        return DTD_NODE;
+    }
+
+    public final String AxiomDocType.getRootName() {
+        return coreGetRootName();
+    }
+
+    public final void AxiomDocType.internalSerialize(Serializer serializer, OMOutputFormat format, boolean cache) throws OutputException {
+        serializer.writeDTD(coreGetRootName(), coreGetPublicId(), coreGetSystemId(), coreGetInternalSubset());
+    }
+}

Propchange: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocTypeSupport.aj
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AxiomNodeFactorySupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AxiomNodeFactorySupport.aj?rev=1691846&r1=1691845&r2=1691846&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AxiomNodeFactorySupport.aj (original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AxiomNodeFactorySupport.aj Sun Jul 19 19:34:30 2015
@@ -23,6 +23,7 @@ import javax.xml.namespace.QName;
 import org.apache.axiom.core.CoreParentNode;
 import org.apache.axiom.ext.stax.datahandler.DataHandlerProvider;
 import org.apache.axiom.om.OMContainer;
+import org.apache.axiom.om.OMDocType;
 import org.apache.axiom.om.OMDocument;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMNode;
@@ -32,6 +33,7 @@ import org.apache.axiom.om.OMXMLParserWr
 import org.apache.axiom.om.impl.OMContainerEx;
 import org.apache.axiom.om.impl.common.AxiomCDATASection;
 import org.apache.axiom.om.impl.common.AxiomCharacterData;
+import org.apache.axiom.om.impl.common.AxiomDocType;
 import org.apache.axiom.om.impl.common.AxiomDocument;
 import org.apache.axiom.om.impl.common.AxiomElement;
 import org.apache.axiom.om.impl.common.AxiomProcessingInstruction;
@@ -49,6 +51,24 @@ public aspect AxiomNodeFactorySupport {
         return document;
     }
 
+    public final OMDocType AxiomNodeFactory.createOMDocType(OMContainer parent, String rootName,
+            String publicId, String systemId, String internalSubset) {
+        return createOMDocType(parent, rootName, publicId, systemId, internalSubset, false);
+    }
+
+    public final OMDocType AxiomNodeFactory.createOMDocType(OMContainer parent, String rootName,
+            String publicId, String systemId, String internalSubset, boolean fromBuilder) {
+        AxiomDocType node = (AxiomDocType)createDocumentTypeDeclaration();
+        node.coreSetRootName(rootName);
+        node.coreSetPublicId(publicId);
+        node.coreSetSystemId(systemId);
+        node.coreSetInternalSubset(internalSubset);
+        if (parent != null) {
+            ((OMContainerEx)parent).addChild(node, fromBuilder);
+        }
+        return node;
+    }
+
     public void AxiomNodeFactory.validateOMTextParent(OMContainer parent) {
     }
     

Added: webservices/axiom/trunk/aspects/shared-aspects/src/main/java/org/apache/axiom/shared/DocumentTypeDeclarationSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/shared-aspects/src/main/java/org/apache/axiom/shared/DocumentTypeDeclarationSupport.aj?rev=1691846&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/shared-aspects/src/main/java/org/apache/axiom/shared/DocumentTypeDeclarationSupport.aj (added)
+++ webservices/axiom/trunk/aspects/shared-aspects/src/main/java/org/apache/axiom/shared/DocumentTypeDeclarationSupport.aj Sun Jul 19 19:34:30 2015
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.shared;
+
+public aspect DocumentTypeDeclarationSupport {
+    public final String IDocumentTypeDeclaration.getPublicId() {
+        return coreGetPublicId();
+    }
+
+    public final String IDocumentTypeDeclaration.getSystemId() {
+        return coreGetSystemId();
+    }
+
+    public final String IDocumentTypeDeclaration.getInternalSubset() {
+        return coreGetInternalSubset();
+    }
+}

Propchange: webservices/axiom/trunk/aspects/shared-aspects/src/main/java/org/apache/axiom/shared/DocumentTypeDeclarationSupport.aj
------------------------------------------------------------------------------
    svn:eol-style = native

Added: webservices/axiom/trunk/aspects/shared-aspects/src/main/java/org/apache/axiom/shared/IDocumentTypeDeclaration.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/shared-aspects/src/main/java/org/apache/axiom/shared/IDocumentTypeDeclaration.java?rev=1691846&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/shared-aspects/src/main/java/org/apache/axiom/shared/IDocumentTypeDeclaration.java (added)
+++ webservices/axiom/trunk/aspects/shared-aspects/src/main/java/org/apache/axiom/shared/IDocumentTypeDeclaration.java Sun Jul 19 19:34:30 2015
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.shared;
+
+import org.apache.axiom.core.CoreDocumentTypeDeclaration;
+
+public interface IDocumentTypeDeclaration extends CoreDocumentTypeDeclaration {
+
+}

Propchange: webservices/axiom/trunk/aspects/shared-aspects/src/main/java/org/apache/axiom/shared/IDocumentTypeDeclaration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentTypeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentTypeImpl.java?rev=1691846&r1=1691845&r2=1691846&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentTypeImpl.java (original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentTypeImpl.java Sun Jul 19 19:34:30 2015
@@ -21,72 +21,14 @@ package org.apache.axiom.om.impl.dom;
 
 import org.apache.axiom.dom.DOMDocumentType;
 import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMOutputFormat;
 import org.apache.axiom.om.impl.common.AxiomDocType;
-import org.apache.axiom.om.impl.common.serializer.push.OutputException;
-import org.apache.axiom.om.impl.common.serializer.push.Serializer;
-import org.w3c.dom.NamedNodeMap;
 
 public class DocumentTypeImpl extends LeafNode implements DOMDocumentType, AxiomDocType {
-    private final String rootName;
-    private final String publicId;
-    private final String systemId;
-    private final String internalSubset;
-    
-    public DocumentTypeImpl(String rootName, String publicId, String systemId,
-            String internalSubset, OMFactory factory) {
+    public DocumentTypeImpl(OMFactory factory) {
         super(factory);
-        this.rootName = rootName;
-        this.publicId = publicId;
-        this.systemId = systemId;
-        this.internalSubset = internalSubset;
-    }
-
-    public String getNodeName() {
-        return getName();
-    }
-
-    public short getNodeType() {
-        return DOCUMENT_TYPE_NODE;
-    }
-
-    public void internalSerialize(Serializer serializer, OMOutputFormat format, boolean cache) throws OutputException {
-        serializer.writeDTD(rootName, publicId, systemId, internalSubset);
-    }
-
-    public int getType() {
-        return DTD_NODE;
-    }
-
-    public NamedNodeMap getEntities() {
-        throw new UnsupportedOperationException();
-    }
-
-    public String getInternalSubset() {
-        return internalSubset;
-    }
-
-    public String getName() {
-        return rootName;
-    }
-
-    public String getRootName() {
-        return rootName;
-    }
-
-    public NamedNodeMap getNotations() {
-        throw new UnsupportedOperationException();
-    }
-
-    public String getPublicId() {
-        return publicId;
-    }
-
-    public String getSystemId() {
-        return systemId;
     }
 
     ChildNode createClone() {
-        return new DocumentTypeImpl(rootName, publicId, systemId, internalSubset, getOMFactory());
+        return (ChildNode)getOMFactory().createOMDocType(null, coreGetRootName(), coreGetPublicId(), coreGetSystemId(), coreGetInternalSubset());
     }
 }

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java?rev=1691846&r1=1691845&r2=1691846&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java (original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java Sun Jul 19 19:34:30 2015
@@ -22,6 +22,7 @@ package org.apache.axiom.om.impl.dom.fac
 import org.apache.axiom.core.CoreCDATASection;
 import org.apache.axiom.core.CoreCharacterData;
 import org.apache.axiom.core.CoreDocument;
+import org.apache.axiom.core.CoreDocumentTypeDeclaration;
 import org.apache.axiom.core.CoreNSAwareAttribute;
 import org.apache.axiom.core.CoreNSUnawareAttribute;
 import org.apache.axiom.core.CoreNamespaceDeclaration;
@@ -211,20 +212,6 @@ public class OMDOMFactory implements Axi
         return new NSAwareAttribute(null, localName, ns, value, this);
     }
 
-    public OMDocType createOMDocType(OMContainer parent, String rootName, String publicId,
-            String systemId, String internalSubset) {
-        return createOMDocType(parent, rootName, publicId, systemId, internalSubset, false);
-    }
-
-    public OMDocType createOMDocType(OMContainer parent, String rootName, String publicId,
-            String systemId, String internalSubset, boolean fromBuilder) {
-        DocumentTypeImpl docType = new DocumentTypeImpl(rootName, publicId, systemId, internalSubset, this);
-        if (parent != null) {
-            ((OMContainerEx)parent).addChild(docType, fromBuilder);
-        }
-        return docType;
-    }
-
     public OMComment createOMComment(OMContainer parent, String content) {
         return createOMComment(parent, content, false);
     }
@@ -311,6 +298,10 @@ public class OMDOMFactory implements Axi
         return new DocumentImpl(this);
     }
 
+    public final CoreDocumentTypeDeclaration createDocumentTypeDeclaration() {
+        return new DocumentTypeImpl(this);
+    }
+
     public final CoreCharacterData createCharacterData() {
         return new TextImpl(this);
     }

Modified: webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocTypeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocTypeImpl.java?rev=1691846&r1=1691845&r2=1691846&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocTypeImpl.java (original)
+++ webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocTypeImpl.java Sun Jul 19 19:34:30 2015
@@ -23,51 +23,14 @@ import org.apache.axiom.om.OMCloneOption
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNode;
-import org.apache.axiom.om.OMOutputFormat;
 import org.apache.axiom.om.impl.common.AxiomDocType;
-import org.apache.axiom.om.impl.common.serializer.push.OutputException;
-import org.apache.axiom.om.impl.common.serializer.push.Serializer;
 
 public class OMDocTypeImpl extends OMLeafNode implements AxiomDocType {
-    private final String rootName;
-    private final String publicId;
-    private final String systemId;
-    private final String internalSubset;
-
-    public OMDocTypeImpl(OMContainer parentNode, String rootName, String publicId, String systemId,
-            String internalSubset, OMFactory factory, boolean fromBuilder) {
-        super(parentNode, factory, fromBuilder);
-        this.rootName = rootName;
-        this.publicId = publicId;
-        this.systemId = systemId;
-        this.internalSubset = internalSubset;
-    }
-
-    public final int getType() {
-        return OMNode.DTD_NODE;
-    }
-
-    public void internalSerialize(Serializer serializer, OMOutputFormat format, boolean cache) throws OutputException {
-        serializer.writeDTD(rootName, publicId, systemId, internalSubset);
-    }
-
-    public String getRootName() {
-        return rootName;
-    }
-
-    public String getPublicId() {
-        return publicId;
-    }
-
-    public String getSystemId() {
-        return systemId;
-    }
-
-    public String getInternalSubset() {
-        return internalSubset;
+    public OMDocTypeImpl(OMFactory factory) {
+        super(factory);
     }
 
     OMNode clone(OMCloneOptions options, OMContainer targetParent) {
-        return getOMFactory().createOMDocType(targetParent, rootName, publicId, systemId, internalSubset);
+        return getOMFactory().createOMDocType(targetParent, coreGetRootName(), coreGetPublicId(), coreGetSystemId(), coreGetInternalSubset());
     }
 }

Modified: webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java?rev=1691846&r1=1691845&r2=1691846&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java (original)
+++ webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java Sun Jul 19 19:34:30 2015
@@ -22,6 +22,7 @@ package org.apache.axiom.om.impl.llom.fa
 import org.apache.axiom.core.CoreCDATASection;
 import org.apache.axiom.core.CoreCharacterData;
 import org.apache.axiom.core.CoreDocument;
+import org.apache.axiom.core.CoreDocumentTypeDeclaration;
 import org.apache.axiom.core.CoreNSAwareAttribute;
 import org.apache.axiom.core.CoreNSUnawareAttribute;
 import org.apache.axiom.core.CoreNamespaceDeclaration;
@@ -216,16 +217,6 @@ public class OMLinkedListImplFactory imp
         return new OMAttributeImpl(localName, ns, value, this);
     }
 
-    public OMDocType createOMDocType(OMContainer parent, String rootName, String publicId,
-            String systemId, String internalSubset) {
-        return createOMDocType(parent, rootName, publicId, systemId, internalSubset, false);
-    }
-
-    public OMDocType createOMDocType(OMContainer parent, String rootName, String publicId,
-            String systemId, String internalSubset, boolean fromBuilder) {
-        return new OMDocTypeImpl(parent, rootName, publicId, systemId, internalSubset, this, fromBuilder);
-    }
-
     /**
      * Creates a comment.
      *
@@ -309,6 +300,10 @@ public class OMLinkedListImplFactory imp
         return new OMDocumentImpl(this);
     }
 
+    public CoreDocumentTypeDeclaration createDocumentTypeDeclaration() {
+        return new OMDocTypeImpl(this);
+    }
+
     public CoreCharacterData createCharacterData() {
         return new CharacterDataImpl(this);
     }