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 2012/07/15 10:24:43 UTC
svn commit: r1361655 - in /webservices/axiom/branches/AXIOM-435/modules:
axiom-api/src/test/java/org/apache/axiom/om/
axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/factory/
axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/ axiom...
Author: veithen
Date: Sun Jul 15 08:24:42 2012
New Revision: 1361655
URL: http://svn.apache.org/viewvc?rev=1361655&view=rev
Log:
More unfinished code.
Added:
webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMEntityReferenceImpl.java (with props)
Modified:
webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/test/java/org/apache/axiom/om/AbstractTestCase.java
webservices/axiom/branches/AXIOM-435/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/factory/DOMXMLStreamReader.java
webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java
webservices/axiom/branches/AXIOM-435/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromDOMSource.java
Modified: webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/test/java/org/apache/axiom/om/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/test/java/org/apache/axiom/om/AbstractTestCase.java?rev=1361655&r1=1361654&r2=1361655&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/test/java/org/apache/axiom/om/AbstractTestCase.java (original)
+++ webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/test/java/org/apache/axiom/om/AbstractTestCase.java Sun Jul 15 08:24:42 2012
@@ -78,7 +78,10 @@ public abstract class AbstractTestCase
}
public static Document toDocumentWithoutDTD(InputStream in) throws Exception {
- Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(in);
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setNamespaceAware(true);
+ factory.setExpandEntityReferences(false);
+ Document doc = factory.newDocumentBuilder().parse(in);
DocumentType docType = doc.getDoctype();
if (docType != null) {
doc.removeChild(docType);
Modified: webservices/axiom/branches/AXIOM-435/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/factory/DOMXMLStreamReader.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-435/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/factory/DOMXMLStreamReader.java?rev=1361655&r1=1361654&r2=1361655&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-435/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/factory/DOMXMLStreamReader.java (original)
+++ webservices/axiom/branches/AXIOM-435/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/factory/DOMXMLStreamReader.java Sun Jul 15 08:24:42 2012
@@ -99,6 +99,9 @@ class DOMXMLStreamReader extends Abstrac
case Node.PROCESSING_INSTRUCTION_NODE:
event = PROCESSING_INSTRUCTION;
break;
+ case Node.ENTITY_REFERENCE_NODE:
+ event = ENTITY_REFERENCE;
+ break;
default:
throw new IllegalStateException("Unexpected node type " + node.getNodeType());
}
@@ -127,7 +130,15 @@ class DOMXMLStreamReader extends Abstrac
}
public String getLocalName() {
- return node.getLocalName();
+ switch (event) {
+ case START_ELEMENT:
+ case END_ELEMENT:
+ return node.getLocalName();
+ case ENTITY_REFERENCE:
+ return node.getNodeName();
+ default:
+ throw new IllegalStateException();
+ }
}
public String getNamespaceURI() {
Added: webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMEntityReferenceImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMEntityReferenceImpl.java?rev=1361655&view=auto
==============================================================================
--- webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMEntityReferenceImpl.java (added)
+++ webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMEntityReferenceImpl.java Sun Jul 15 08:24:42 2012
@@ -0,0 +1,56 @@
+/*
+ * 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.llom;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.axiom.om.OMCloneOptions;
+import org.apache.axiom.om.OMContainer;
+import org.apache.axiom.om.OMEntityReference;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNode;
+
+public class OMEntityReferenceImpl extends OMLeafNode implements OMEntityReference {
+ private final String name;
+
+ public OMEntityReferenceImpl(OMContainer parent, String name, OMFactory factory, boolean fromBuilder) {
+ super(parent, factory, fromBuilder);
+ this.name = name;
+ }
+
+ public int getType() {
+ // TODO
+ throw new UnsupportedOperationException();
+ }
+
+ public void internalSerialize(XMLStreamWriter writer, boolean cache) throws XMLStreamException {
+ writer.writeEntityRef(name);
+ }
+
+ public String getName() {
+ // TODO
+ throw new UnsupportedOperationException();
+ }
+
+ OMNode clone(OMCloneOptions options, OMContainer targetParent) {
+ // TODO
+ throw new UnsupportedOperationException();
+ }
+}
Propchange: webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMEntityReferenceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java?rev=1361655&r1=1361654&r2=1361655&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java (original)
+++ webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java Sun Jul 15 08:24:42 2012
@@ -27,6 +27,7 @@ import org.apache.axiom.om.OMDataSource;
import org.apache.axiom.om.OMDocType;
import org.apache.axiom.om.OMDocument;
import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMEntityReference;
import org.apache.axiom.om.OMException;
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.om.OMNamespace;
@@ -43,6 +44,7 @@ import org.apache.axiom.om.impl.llom.OMC
import org.apache.axiom.om.impl.llom.OMDocTypeImpl;
import org.apache.axiom.om.impl.llom.OMDocumentImpl;
import org.apache.axiom.om.impl.llom.OMElementImpl;
+import org.apache.axiom.om.impl.llom.OMEntityReferenceImpl;
import org.apache.axiom.om.impl.llom.OMProcessingInstructionImpl;
import org.apache.axiom.om.impl.llom.OMSourcedElementImpl;
import org.apache.axiom.om.impl.llom.OMTextImpl;
@@ -356,6 +358,10 @@ public class OMLinkedListImplFactory imp
return new OMDocumentImpl(builder, this);
}
+ public OMEntityReference createOMEntityReference(OMContainer parent, String name, boolean fromBuilder) {
+ return new OMEntityReferenceImpl(parent, name, this, fromBuilder);
+ }
+
/**
* This method is intended only to be used by Axiom intenals when merging Objects from different
* Axiom implementations to the LLOM implementation.
Modified: webservices/axiom/branches/AXIOM-435/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromDOMSource.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-435/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromDOMSource.java?rev=1361655&r1=1361654&r2=1361655&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-435/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromDOMSource.java (original)
+++ webservices/axiom/branches/AXIOM-435/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromDOMSource.java Sun Jul 15 08:24:42 2012
@@ -42,6 +42,7 @@ public class TestCreateOMBuilderFromDOMS
protected void runTest() throws Throwable {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
+ factory.setExpandEntityReferences(false);
DocumentBuilder documentBuilder = factory.newDocumentBuilder();
InputStream in = getFileAsStream();
try {