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/14 12:32:26 UTC
svn commit: r1361519 - in /webservices/axiom/branches/AXIOM-435: ./
modules/axiom-api/src/main/java/org/apache/axiom/om/impl/
modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/
modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/
Author: veithen
Date: Sat Jul 14 10:32:25 2012
New Revision: 1361519
URL: http://svn.apache.org/viewvc?rev=1361519&view=rev
Log:
More unfinished code.
Modified:
webservices/axiom/branches/AXIOM-435/ (props changed)
webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MTOMXMLStreamWriter.java
webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/OMFactoryEx.java
webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/PushOMBuilder.java
Propchange: webservices/axiom/branches/AXIOM-435/
------------------------------------------------------------------------------
Merged /webservices/commons/trunk/modules/axiom:r1361507-1361516
Modified: webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MTOMXMLStreamWriter.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MTOMXMLStreamWriter.java?rev=1361519&r1=1361518&r2=1361519&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MTOMXMLStreamWriter.java (original)
+++ webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MTOMXMLStreamWriter.java Sat Jul 14 10:32:25 2012
@@ -36,7 +36,6 @@ import org.apache.axiom.attachments.life
import org.apache.axiom.ext.stax.datahandler.DataHandlerProvider;
import org.apache.axiom.ext.stax.datahandler.DataHandlerWriter;
import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMNode;
import org.apache.axiom.om.OMOutputFormat;
import org.apache.axiom.om.OMText;
import org.apache.axiom.om.util.CommonUtils;
@@ -49,7 +48,6 @@ import org.apache.axiom.util.stax.xop.XO
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
/**
* MTOMXMLStreamWriter is an XML + Attachments stream writer.
*
@@ -577,23 +575,6 @@ public class MTOMXMLStreamWriter impleme
return os;
}
- /**
- * Writes the relevant output.
- *
- * @param writer
- * @throws XMLStreamException
- */
- private void writeOutput(OMText textNode) throws XMLStreamException {
- int type = textNode.getType();
- if (type == OMNode.TEXT_NODE || type == OMNode.SPACE_NODE) {
- writeCharacters(textNode.getText());
- } else if (type == OMNode.CDATA_SECTION_NODE) {
- writeCData(textNode.getText());
- } else if (type == OMNode.ENTITY_REFERENCE_NODE) {
- writeEntityRef(textNode.getText());
- }
- }
-
public void setFilter(XMLStreamWriterFilter filter) {
if (filter != null) {
if (log.isDebugEnabled()) {
Modified: webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/OMFactoryEx.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/OMFactoryEx.java?rev=1361519&r1=1361518&r2=1361519&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/OMFactoryEx.java (original)
+++ webservices/axiom/branches/AXIOM-435/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/OMFactoryEx.java Sat Jul 14 10:32:25 2012
@@ -23,6 +23,7 @@ import org.apache.axiom.om.OMContainer;
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.OMFactory;
import org.apache.axiom.om.OMNode;
import org.apache.axiom.om.OMProcessingInstruction;
@@ -56,5 +57,7 @@ public interface OMFactoryEx extends OMF
OMProcessingInstruction createOMProcessingInstruction(OMContainer parent,
String piTarget, String piData, boolean fromBuilder);
+ OMEntityReference createOMEntityReference(OMContainer parent, String name, boolean fromBuilder);
+
OMNode importNode(OMNode child);
}
Modified: webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/PushOMBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/PushOMBuilder.java?rev=1361519&r1=1361518&r2=1361519&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/PushOMBuilder.java (original)
+++ webservices/axiom/branches/AXIOM-435/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/PushOMBuilder.java Sat Jul 14 10:32:25 2012
@@ -29,7 +29,6 @@ import org.apache.axiom.ext.stax.datahan
import org.apache.axiom.om.OMAttribute;
import org.apache.axiom.om.OMContainer;
import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.om.OMNode;
import org.apache.axiom.om.OMText;
@@ -39,12 +38,12 @@ import org.apache.axiom.util.stax.Abstra
public class PushOMBuilder extends AbstractXMLStreamWriter implements DataHandlerWriter {
private final OMSourcedElementImpl root;
- private final OMFactory factory;
+ private final OMFactoryEx factory;
private OMElement parent;
public PushOMBuilder(OMSourcedElementImpl root) throws XMLStreamException {
this.root = root;
- factory = root.getOMFactory();
+ factory = (OMFactoryEx)root.getOMFactory();
// Seed the namespace context with the namespace context from the parent
OMContainer parent = root.getParent();
if (parent instanceof OMElement) {
@@ -113,7 +112,7 @@ public class PushOMBuilder extends Abstr
} else {
// We use the createOMElement variant that takes a OMXMLParserWrapper parameter and
// don't pass the namespace. This avoids creation of a namespace declaration.
- parent = ((OMFactoryEx)factory).createOMElement(localName, parent, null);
+ parent = factory.createOMElement(localName, parent, null);
}
if (ns != null) {
parent.setNamespaceWithNoFindInCurrentScope(ns);
@@ -169,24 +168,23 @@ public class PushOMBuilder extends Abstr
}
protected void doWriteCharacters(String text) {
- factory.createOMText(parent, text);
+ factory.createOMText(parent, text, OMNode.TEXT_NODE, true);
}
protected void doWriteCData(String data) {
- factory.createOMText(parent, data, OMNode.CDATA_SECTION_NODE);
+ factory.createOMText(parent, data, OMNode.CDATA_SECTION_NODE, true);
}
protected void doWriteComment(String data) {
- factory.createOMComment(parent, data);
+ factory.createOMComment(parent, data, true);
}
protected void doWriteEntityRef(String name) throws XMLStreamException {
- // TODO: this is equivalent to what StAXOMBuilder does; however, it doesn't look correct
- factory.createOMText(parent, name, OMNode.ENTITY_REFERENCE_NODE);
+ factory.createOMEntityReference(parent, name, true);
}
protected void doWriteProcessingInstruction(String target, String data) {
- factory.createOMProcessingInstruction(parent, target, data);
+ factory.createOMProcessingInstruction(parent, target, data, true);
}
protected void doWriteProcessingInstruction(String target) {