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 2016/02/28 10:50:07 UTC
svn commit: r1732707 [2/2] - in
/webservices/axiom/branches/maven-site-plugin-3.5: ./
aspects/core-aspects/src/main/java/org/apache/axiom/core/
aspects/core-aspects/src/main/java/org/apache/axiom/core/builder/
aspects/core-aspects/src/main/java/org/apa...
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/Context.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/Context.java?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/Context.java (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/Context.java Sun Feb 28 09:50:05 2016
@@ -18,15 +18,19 @@
*/
package org.apache.axiom.om.impl.common.builder;
+import org.apache.axiom.core.Builder;
+import org.apache.axiom.core.CoreCDATASection;
import org.apache.axiom.core.CoreCharacterDataNode;
+import org.apache.axiom.core.CoreChildNode;
import org.apache.axiom.core.CoreParentNode;
+import org.apache.axiom.core.InputContext;
+import org.apache.axiom.core.stream.StreamException;
+import org.apache.axiom.core.stream.XmlHandler;
import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.om.impl.common.AxiomSemantics;
import org.apache.axiom.om.impl.common.OMNamespaceImpl;
import org.apache.axiom.om.impl.intf.AxiomAttribute;
-import org.apache.axiom.om.impl.intf.AxiomCDATASection;
import org.apache.axiom.om.impl.intf.AxiomCharacterDataNode;
-import org.apache.axiom.om.impl.intf.AxiomChildNode;
import org.apache.axiom.om.impl.intf.AxiomComment;
import org.apache.axiom.om.impl.intf.AxiomContainer;
import org.apache.axiom.om.impl.intf.AxiomDocType;
@@ -35,7 +39,7 @@ import org.apache.axiom.om.impl.intf.Axi
import org.apache.axiom.om.impl.intf.AxiomNamespaceDeclaration;
import org.apache.axiom.om.impl.intf.AxiomProcessingInstruction;
-public final class Context {
+public final class Context implements InputContext {
private static final OMNamespace DEFAULT_NS = new OMNamespaceImpl("", "");
private final BuilderHandler builderHandler;
@@ -43,25 +47,74 @@ public final class Context {
private final int depth;
private Context nestedContext;
- public AxiomContainer target;
+ public CoreParentNode target;
private Object pendingCharacterData;
+ /**
+ * The {@link XmlHandler} object to send events to if pass-through is enabled. See
+ * {@link InputContext#setPassThroughHandler(XmlHandler)} for more details.
+ */
+ private XmlHandler passThroughHandler;
+
+ /**
+ * Tracks the nesting depth when pass-through is enabled.
+ */
+ private int passThroughDepth;
+
public Context(BuilderHandler builderHandler, Context parentContext, int depth) {
this.builderHandler = builderHandler;
this.parentContext = parentContext;
this.depth = depth;
}
- private Context newContext(AxiomContainer target) {
+ @Override
+ public Builder getBuilder() {
+ return builderHandler.builder;
+ }
+
+ public void setPassThroughHandler(XmlHandler passThroughHandler) {
+ if (this.passThroughHandler != null) {
+ throw new IllegalStateException("A pass-through handler has already been set for this context");
+ }
+ target.coreSetState(CoreParentNode.DISCARDED);
+ this.passThroughHandler = passThroughHandler;
+ }
+
+ private Context newContext(CoreParentNode target) {
if (nestedContext == null) {
nestedContext = new Context(builderHandler, this, depth+1);
}
nestedContext.target = target;
+ target.coreSetInputContext(nestedContext);
return nestedContext;
}
- private void addChild(AxiomChildNode node) {
+ private Context endContext() {
+ target.coreSetState(CoreParentNode.COMPLETE);
+ target.coreSetInputContext(null);
+ if (pendingCharacterData != null) {
+ target.coreSetCharacterData(pendingCharacterData, null);
+ pendingCharacterData = null;
+ }
+ target = null;
+ return parentContext;
+ }
+
+ private Context decrementPassThroughDepth() {
+ if (passThroughDepth == 0) {
+ target.coreSetInputContext(null);
+ target.coreSetState(CoreParentNode.DISCARDED);
+ passThroughHandler = null;
+ target = null;
+ return parentContext;
+ } else {
+ passThroughDepth--;
+ return this;
+ }
+ }
+
+ private void addChild(CoreChildNode node) {
if (pendingCharacterData != null) {
AxiomCharacterDataNode cdataNode = builderHandler.nodeFactory.createNode(AxiomCharacterDataNode.class);
cdataNode.coreSetCharacterData(pendingCharacterData);
@@ -75,70 +128,94 @@ public final class Context {
}
public void processDocumentTypeDeclaration(String rootName, String publicId, String systemId,
- String internalSubset) {
- AxiomDocType node = builderHandler.nodeFactory.createNode(AxiomDocType.class);
- node.coreSetRootName(rootName);
- node.coreSetPublicId(publicId);
- node.coreSetSystemId(systemId);
- node.coreSetInternalSubset(internalSubset);
- addChild(node);
- }
-
- public Context startElement(String namespaceURI, String localName, String prefix) {
- AxiomElement element;
- OMNamespace ns = builderHandler.nsCache.getOMNamespace(namespaceURI, prefix);
- if (depth == 0 && builderHandler.root != null) {
- builderHandler.root.validateName(prefix, localName, namespaceURI);
- builderHandler.root.initName(localName, ns, false);
- element = builderHandler.root;
- } else {
- element = builderHandler.nodeFactory.createNode(builderHandler.model.determineElementType(
- target, depth+1, namespaceURI, localName));
- element.coreSetBuilder(builderHandler.builder);
- element.coreSetState(CoreParentNode.ATTRIBUTES_PENDING);
- element.initName(localName, ns, false);
- addChild(element);
+ String internalSubset) throws StreamException {
+ if (passThroughHandler != null) {
+ passThroughHandler.processDocumentTypeDeclaration(rootName, publicId, systemId, internalSubset);
+ } else {
+ AxiomDocType node = builderHandler.nodeFactory.createNode(AxiomDocType.class);
+ node.coreSetRootName(rootName);
+ node.coreSetPublicId(publicId);
+ node.coreSetSystemId(systemId);
+ node.coreSetInternalSubset(internalSubset);
+ addChild(node);
}
- return newContext(element);
}
- public Context endElement() {
- target.setComplete(true);
- if (pendingCharacterData != null) {
- target.coreSetCharacterData(pendingCharacterData, null);
- pendingCharacterData = null;
+ public Context startElement(String namespaceURI, String localName, String prefix) throws StreamException {
+ if (passThroughHandler != null) {
+ passThroughDepth++;
+ passThroughHandler.startElement(namespaceURI, localName, prefix);
+ return this;
+ } else {
+ AxiomElement element;
+ OMNamespace ns = builderHandler.nsCache.getOMNamespace(namespaceURI, prefix);
+ if (depth == 0 && builderHandler.root != null) {
+ builderHandler.root.validateName(prefix, localName, namespaceURI);
+ builderHandler.root.initName(localName, ns, false);
+ builderHandler.root.coreSetInputContext(this);
+ builderHandler.root.coreSetState(CoreParentNode.ATTRIBUTES_PENDING);
+ element = builderHandler.root;
+ } else {
+ element = builderHandler.nodeFactory.createNode(builderHandler.model.determineElementType(
+ (AxiomContainer)target, depth+1, namespaceURI, localName));
+ element.coreSetState(CoreParentNode.ATTRIBUTES_PENDING);
+ element.initName(localName, ns, false);
+ addChild(element);
+ }
+ return newContext(element);
+ }
+ }
+
+ public Context endElement() throws StreamException {
+ if (passThroughHandler != null) {
+ passThroughHandler.endElement();
+ return decrementPassThroughDepth();
+ } else {
+ return endContext();
}
- target = null;
- return parentContext;
}
- public void processAttribute(String namespaceURI, String localName, String prefix, String value, String type, boolean specified) {
- OMNamespace ns = builderHandler.nsCache.getOMNamespace(namespaceURI, prefix);
- AxiomAttribute attr = builderHandler.nodeFactory.createNode(AxiomAttribute.class);
- attr.internalSetLocalName(localName);
- attr.coreSetCharacterData(value, AxiomSemantics.INSTANCE);
- attr.internalSetNamespace(ns);
- attr.coreSetType(type);
- attr.coreSetSpecified(specified);
- ((AxiomElement)target).coreAppendAttribute(attr);
+ public void processAttribute(String namespaceURI, String localName, String prefix, String value, String type, boolean specified) throws StreamException {
+ if (passThroughHandler != null) {
+ passThroughHandler.processAttribute(namespaceURI, localName, prefix, value, type, specified);
+ } else {
+ OMNamespace ns = builderHandler.nsCache.getOMNamespace(namespaceURI, prefix);
+ AxiomAttribute attr = builderHandler.nodeFactory.createNode(AxiomAttribute.class);
+ attr.internalSetLocalName(localName);
+ attr.coreSetCharacterData(value, AxiomSemantics.INSTANCE);
+ attr.internalSetNamespace(ns);
+ attr.coreSetType(type);
+ attr.coreSetSpecified(specified);
+ ((AxiomElement)target).coreAppendAttribute(attr);
+ }
}
- public void processNamespaceDeclaration(String prefix, String namespaceURI) {
- OMNamespace ns = builderHandler.nsCache.getOMNamespace(namespaceURI, prefix);
- if (ns == null) {
- ns = DEFAULT_NS;
+ public void processNamespaceDeclaration(String prefix, String namespaceURI) throws StreamException {
+ if (passThroughHandler != null) {
+ passThroughHandler.processNamespaceDeclaration(prefix, namespaceURI);
+ } else {
+ OMNamespace ns = builderHandler.nsCache.getOMNamespace(namespaceURI, prefix);
+ if (ns == null) {
+ ns = DEFAULT_NS;
+ }
+ AxiomNamespaceDeclaration decl = builderHandler.nodeFactory.createNode(AxiomNamespaceDeclaration.class);
+ decl.setDeclaredNamespace(ns);
+ ((AxiomElement)target).coreAppendAttribute(decl);
}
- AxiomNamespaceDeclaration decl = builderHandler.nodeFactory.createNode(AxiomNamespaceDeclaration.class);
- decl.setDeclaredNamespace(ns);
- ((AxiomElement)target).coreAppendAttribute(decl);
}
- public void attributesCompleted() {
- target.coreSetState(CoreParentNode.INCOMPLETE);
+ public void attributesCompleted() throws StreamException {
+ if (passThroughHandler != null) {
+ passThroughHandler.attributesCompleted();
+ } else {
+ target.coreSetState(CoreParentNode.INCOMPLETE);
+ }
}
- public void processCharacterData(Object data, boolean ignorable) {
- if (!ignorable && pendingCharacterData == null && target.coreGetFirstChildIfAvailable() == null) {
+ public void processCharacterData(Object data, boolean ignorable) throws StreamException {
+ if (passThroughHandler != null) {
+ passThroughHandler.processCharacterData(data, ignorable);
+ } else if (!ignorable && pendingCharacterData == null && target.coreGetFirstChildIfAvailable() == null) {
pendingCharacterData = data;
} else {
AxiomCharacterDataNode node = builderHandler.nodeFactory.createNode(AxiomCharacterDataNode.class);
@@ -148,39 +225,97 @@ public final class Context {
}
}
- public void processProcessingInstruction(String piTarget, String piData) {
- AxiomProcessingInstruction node = builderHandler.nodeFactory.createNode(AxiomProcessingInstruction.class);
- node.coreSetTarget(piTarget);
- node.coreSetCharacterData(piData, AxiomSemantics.INSTANCE);
- addChild(node);
+ public Context startProcessingInstruction(String piTarget) throws StreamException {
+ if (passThroughHandler != null) {
+ passThroughDepth++;
+ passThroughHandler.startProcessingInstruction(piTarget);
+ return this;
+ } else {
+ AxiomProcessingInstruction node = builderHandler.nodeFactory.createNode(AxiomProcessingInstruction.class);
+ node.coreSetTarget(piTarget);
+ addChild(node);
+ return newContext(node);
+ }
}
- public void processComment(String content) {
- AxiomComment node = builderHandler.nodeFactory.createNode(AxiomComment.class);
- node.coreSetCharacterData(content, AxiomSemantics.INSTANCE);
- addChild(node);
+ public Context endProcessingInstruction() throws StreamException {
+ if (passThroughHandler != null) {
+ passThroughHandler.endProcessingInstruction();
+ return decrementPassThroughDepth();
+ } else {
+ return endContext();
+ }
+ }
+
+ public Context startComment() throws StreamException {
+ if (passThroughHandler != null) {
+ passThroughDepth++;
+ passThroughHandler.startComment();
+ return this;
+ } else {
+ AxiomComment node = builderHandler.nodeFactory.createNode(AxiomComment.class);
+ addChild(node);
+ return newContext(node);
+ }
}
- public void processCDATASection(String content) {
- AxiomCDATASection node = builderHandler.nodeFactory.createNode(AxiomCDATASection.class);
- node.coreSetCharacterData(content, AxiomSemantics.INSTANCE);
- addChild(node);
+ public Context endComment() throws StreamException {
+ if (passThroughHandler != null) {
+ passThroughHandler.endComment();
+ return decrementPassThroughDepth();
+ } else {
+ return endContext();
+ }
}
- public void processEntityReference(String name, String replacementText) {
- AxiomEntityReference node = builderHandler.nodeFactory.createNode(AxiomEntityReference.class);
- node.coreSetName(name);
- node.coreSetReplacementText(replacementText);
- addChild(node);
+ public Context startCDATASection() throws StreamException {
+ if (passThroughHandler != null) {
+ passThroughDepth++;
+ passThroughHandler.startCDATASection();
+ return this;
+ } else {
+ CoreCDATASection node = builderHandler.nodeFactory.createNode(CoreCDATASection.class);
+ addChild(node);
+ return newContext(node);
+ }
}
- public void endDocument() {
- if (depth != 0) {
- throw new IllegalStateException();
+ public Context endCDATASection() throws StreamException {
+ if (passThroughHandler != null) {
+ passThroughHandler.endCDATASection();
+ return decrementPassThroughDepth();
+ } else {
+ return endContext();
}
- if (target != null) {
- target.setComplete(true);
+ }
+
+ public void processEntityReference(String name, String replacementText) throws StreamException {
+ if (passThroughHandler != null) {
+ passThroughHandler.processEntityReference(name, replacementText);
+ } else {
+ AxiomEntityReference node = builderHandler.nodeFactory.createNode(AxiomEntityReference.class);
+ node.coreSetName(name);
+ node.coreSetReplacementText(replacementText);
+ addChild(node);
+ }
+ }
+
+ public void endDocument() throws StreamException {
+ if (passThroughHandler != null) {
+ // TODO: hack
+ if (passThroughDepth > 0) {
+ passThroughHandler.endDocument();
+ }
+ decrementPassThroughDepth();
+ } else {
+ if (depth != 0) {
+ throw new IllegalStateException();
+ }
+ if (target != null) {
+ target.coreSetState(CoreParentNode.COMPLETE);
+ target.coreSetInputContext(null);
+ }
+ target = null;
}
- target = null;
}
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/PushBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/PushBuilder.java?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/PushBuilder.java (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/PushBuilder.java Sun Feb 28 09:50:05 2016
@@ -61,10 +61,6 @@ public final class PushBuilder extends A
throw new UnsupportedOperationException();
}
- public final Object getParser() {
- throw new UnsupportedOperationException();
- }
-
public final OMElement getDocumentElement() {
return getDocument().getOMDocumentElement();
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXHelper.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXHelper.java?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXHelper.java (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXHelper.java Sun Feb 28 09:50:05 2016
@@ -21,6 +21,7 @@ package org.apache.axiom.om.impl.common.
import org.apache.axiom.core.stream.StreamException;
import org.apache.axiom.core.stream.XmlHandler;
+import org.apache.axiom.core.stream.XmlReader;
import org.apache.axiom.ext.stax.DTDReader;
import org.apache.axiom.ext.stax.datahandler.DataHandlerReader;
import org.apache.axiom.om.DeferredParsingException;
@@ -67,7 +68,7 @@ import java.io.Closeable;
* To avoid this, the builder remembers exceptions thrown by the parser and rethrows
* them during a call to next().
*/
-public class StAXHelper {
+public class StAXHelper implements XmlReader {
private static final Log log = LogFactory.getLog(StAXHelper.class);
/** Field parser */
@@ -151,7 +152,9 @@ public class StAXHelper {
handler.processCharacterData(text, true);
break;
case XMLStreamConstants.CDATA:
- handler.processCDATASection(text);
+ handler.startCDATASection();
+ handler.processCharacterData(text, false);
+ handler.endCDATASection();
break;
default:
throw new IllegalStateException();
@@ -194,6 +197,11 @@ public class StAXHelper {
return _isClosed;
}
+ @Override
+ public boolean proceed() throws StreamException {
+ return next() == XMLStreamReader.END_DOCUMENT;
+ }
+
/**
* Forwards the parser one step further, if parser is not completed yet. If this is called after
* parser is done, then throw an OMException. If the cache is set to false, then returns the
@@ -229,13 +237,17 @@ public class StAXHelper {
handler.endDocument();
break;
case XMLStreamConstants.COMMENT:
- handler.processComment(parser.getText());
+ handler.startComment();
+ handler.processCharacterData(parser.getText(), false);
+ handler.endComment();
break;
case XMLStreamConstants.DTD:
processDTD();
break;
case XMLStreamConstants.PROCESSING_INSTRUCTION:
- handler.processProcessingInstruction(parser.getPITarget(), parser.getPIData());
+ handler.startProcessingInstruction(parser.getPITarget());
+ handler.processCharacterData(parser.getPIData(), false);
+ handler.endProcessingInstruction();
break;
case XMLStreamConstants.ENTITY_REFERENCE:
handler.processEntityReference(parser.getLocalName(), parser.getText());
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXOMBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXOMBuilder.java?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXOMBuilder.java (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXOMBuilder.java Sun Feb 28 09:50:05 2016
@@ -21,10 +21,8 @@ package org.apache.axiom.om.impl.common.
import org.apache.axiom.core.CoreParentNode;
import org.apache.axiom.core.NodeFactory;
-import org.apache.axiom.om.OMContainer;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.ds.custombuilder.CustomBuilder;
import org.apache.axiom.om.ds.custombuilder.CustomBuilderSupport;
import org.apache.axiom.om.ds.custombuilder.CustomBuilder.Selector;
@@ -187,50 +185,6 @@ public class StAXOMBuilder extends Abstr
return helper.parser.getPrefix();
}
- /**
- * Get the underlying {@link XMLStreamReader} used by this builder. Note that for this type of
- * builder, accessing the underlying parser implies that can no longer be used, and any attempt
- * to call {@link #next()} will result in an exception.
- *
- * @return The {@link XMLStreamReader} object used by this builder. Note that the constraints
- * described in the Javadoc of the <code>reader</code> parameter of the
- * {@link CustomBuilder#create(String, String, OMContainer, XMLStreamReader, OMFactory)}
- * method also apply to the stream reader returned by this method, i.e.:
- * <ul>
- * <li>The caller should use
- * {@link org.apache.axiom.util.stax.xop.XOPUtils#getXOPEncodedStream(XMLStreamReader)}
- * to get an XOP encoded stream from the return value.
- * <li>To get access to the bare StAX parser implementation, the caller should use
- * {@link org.apache.axiom.util.stax.XMLStreamReaderUtils#getOriginalXMLStreamReader(XMLStreamReader)}.
- * </ul>
- * @throws IllegalStateException
- * if the parser has already been accessed
- */
- public final Object getParser() {
- if (parserAccessed) {
- throw new IllegalStateException(
- "Parser already accessed!");
- }
- if (!builderHandler.cache) {
- parserAccessed = true;
- // Mark all containers in the hierarchy as discarded because they can no longer be built
- Context current = builderHandler.context;
- while (builderHandler.depth > 0) {
- discarded(current.target);
- current = current.parentContext;
- builderHandler.depth--;
- }
- if (current != null && current.target == builderHandler.document) {
- discarded(current.target);
- }
- builderHandler.context = null;
- return helper.parser;
- } else {
- throw new IllegalStateException(
- "cache must be switched off to access the parser");
- }
- }
-
public final XMLStreamReader disableCaching() {
builderHandler.cache = false;
// Always advance to the event right after the current node; this also takes
@@ -396,8 +350,4 @@ public class StAXOMBuilder extends Abstr
public final int lookahead() {
return helper.lookahead();
}
-
- public final AxiomContainer getTarget() {
- return builderHandler.context.target;
- }
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/serializer/push/sax/XMLReaderImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/serializer/push/sax/XMLReaderImpl.java?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/serializer/push/sax/XMLReaderImpl.java (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/serializer/push/sax/XMLReaderImpl.java Sun Feb 28 09:50:05 2016
@@ -21,6 +21,7 @@ package org.apache.axiom.om.impl.common.
import java.io.IOException;
import org.apache.axiom.core.CoreElement;
+import org.apache.axiom.core.CoreModelException;
import org.apache.axiom.core.stream.StreamException;
import org.apache.axiom.core.stream.XmlHandler;
import org.apache.axiom.core.stream.sax.ContentHandlerXmlHandler;
@@ -55,6 +56,8 @@ public class XMLReaderImpl extends Abstr
}
try {
root.internalSerialize(handler, cache);
+ } catch (CoreModelException ex) {
+ throw new SAXException(ex);
} catch (StreamException ex) {
throw (SAXException)ex.getCause();
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/serializer/push/stax/StAXSerializer.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/serializer/push/stax/StAXSerializer.java?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/serializer/push/stax/StAXSerializer.java (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/serializer/push/stax/StAXSerializer.java Sun Feb 28 09:50:05 2016
@@ -22,6 +22,7 @@ import java.io.IOException;
import org.apache.axiom.core.stream.StreamException;
import org.apache.axiom.core.stream.XmlHandler;
+import org.apache.axiom.core.stream.util.CharacterDataAccumulator;
import org.apache.axiom.ext.stax.datahandler.DataHandlerProvider;
import org.apache.axiom.ext.stax.datahandler.DataHandlerWriter;
import org.apache.axiom.om.impl.intf.TextContent;
@@ -33,6 +34,9 @@ import javax.xml.stream.XMLStreamWriter;
public class StAXSerializer implements XmlHandler {
private final XMLStreamWriter writer;
private DataHandlerWriter dataHandlerWriter;
+ private final CharacterDataAccumulator buffer = new CharacterDataAccumulator();
+ private boolean buffering;
+ private String piTarget;
public StAXSerializer(XMLStreamWriter writer) {
this.writer = writer;
@@ -42,6 +46,13 @@ public class StAXSerializer implements X
return writer;
}
+ private String stopBuffering() {
+ String content = buffer.toString();
+ buffer.clear();
+ buffering = false;
+ return content;
+ }
+
@Override
public void startDocument(String inputEncoding, String xmlVersion, String xmlEncoding,
boolean standalone) throws StreamException {
@@ -105,6 +116,10 @@ public class StAXSerializer implements X
}
public void processCharacterData(Object data, boolean ignorable) throws StreamException {
+ if (buffering) {
+ buffer.append(data);
+ return;
+ }
try {
if (data instanceof TextContent) {
TextContent textContent = (TextContent)data;
@@ -127,25 +142,44 @@ public class StAXSerializer implements X
}
@Override
- public void processCDATASection(String content) throws StreamException {
+ public void startCDATASection() throws StreamException {
+ buffering = true;
+ }
+
+ @Override
+ public void endCDATASection() throws StreamException {
try {
- writer.writeCData(content);
+ writer.writeCData(stopBuffering());
} catch (XMLStreamException ex) {
throw new StreamException(ex);
}
}
- public void processComment(String data) throws StreamException {
+ @Override
+ public void startComment() throws StreamException {
+ buffering = true;
+ }
+
+ @Override
+ public void endComment() throws StreamException {
try {
- writer.writeComment(data);
+ writer.writeComment(stopBuffering());
} catch (XMLStreamException ex) {
throw new StreamException(ex);
}
}
- public void processProcessingInstruction(String target, String data) throws StreamException {
+ @Override
+ public void startProcessingInstruction(String target) throws StreamException {
+ buffering = true;
+ piTarget = target;
+ }
+
+ @Override
+ public void endProcessingInstruction() throws StreamException {
try {
- writer.writeProcessingInstruction(target, data);
+ writer.writeProcessingInstruction(piTarget, stopBuffering());
+ piTarget = null;
} catch (XMLStreamException ex) {
throw new StreamException(ex);
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/AxiomDocument.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/AxiomDocument.java?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/AxiomDocument.java (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/AxiomDocument.java Sun Feb 28 09:50:05 2016
@@ -19,9 +19,8 @@
package org.apache.axiom.om.impl.intf;
import org.apache.axiom.core.CoreDocument;
-import org.apache.axiom.core.DeferringParentNode;
import org.apache.axiom.om.OMDocument;
-public interface AxiomDocument extends OMDocument, AxiomContainer, CoreDocument, DeferringParentNode {
+public interface AxiomDocument extends OMDocument, AxiomContainer, CoreDocument {
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/AxiomElement.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/AxiomElement.java?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/AxiomElement.java (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/AxiomElement.java Sun Feb 28 09:50:05 2016
@@ -19,11 +19,10 @@
package org.apache.axiom.om.impl.intf;
import org.apache.axiom.core.CoreNSAwareElement;
-import org.apache.axiom.core.DeferringParentNode;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMNamespace;
-public interface AxiomElement extends OMElement, AxiomContainer, AxiomChildNode, AxiomNamedInformationItem, CoreNSAwareElement, DeferringParentNode {
+public interface AxiomElement extends OMElement, AxiomContainer, AxiomChildNode, AxiomNamedInformationItem, CoreNSAwareElement {
/**
* Adds a namespace declaration without doing any additional checks. This method is used
* internally by the builder (which can safely assume that the data received from the parser is
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/AxiomSerializable.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/AxiomSerializable.java?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/AxiomSerializable.java (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/AxiomSerializable.java Sun Feb 28 09:50:05 2016
@@ -18,19 +18,8 @@
*/
package org.apache.axiom.om.impl.intf;
-import org.apache.axiom.core.stream.StreamException;
-import org.apache.axiom.core.stream.XmlHandler;
import org.apache.axiom.om.OMSerializable;
public interface AxiomSerializable extends OMSerializable, AxiomInformationItem {
void setComplete(boolean state);
-
- /**
- * Serializes the node.
- *
- * @param serializer
- * @param cache indicates if caching should be enabled
- * @throws StreamException
- */
- void internalSerialize(XmlHandler handler, boolean cache) throws StreamException;
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/TextContent.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/TextContent.java?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/TextContent.java (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/TextContent.java Sun Feb 28 09:50:05 2016
@@ -30,6 +30,7 @@ import org.apache.axiom.ext.stax.datahan
import org.apache.axiom.om.OMCloneOptions;
import org.apache.axiom.om.OMException;
import org.apache.axiom.util.UIDGenerator;
+import org.apache.axiom.util.base64.Base64EncodingStringBufferOutputStream;
import org.apache.axiom.util.base64.Base64EncodingWriterOutputStream;
import org.apache.axiom.util.base64.Base64Utils;
@@ -175,4 +176,19 @@ public final class TextContent implement
writer.write(value);
}
}
+
+ @Override
+ public void appendTo(StringBuilder buffer) {
+ if (binary) {
+ Base64EncodingStringBufferOutputStream out = new Base64EncodingStringBufferOutputStream(buffer);
+ try {
+ getDataHandler().writeTo(out);
+ out.complete();
+ } catch (IOException ex) {
+ throw new OMException(ex);
+ }
+ } else {
+ buffer.append(value);
+ }
+ }
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomAttributeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomAttributeSupport.aj?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomAttributeSupport.aj (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomAttributeSupport.aj Sun Feb 28 09:50:05 2016
@@ -62,4 +62,8 @@ public aspect AxiomAttributeSupport {
public final void AxiomAttribute.setAttributeType(String type) {
coreSetType(type);
}
+
+ public final void AxiomAttribute.build() {
+ // TODO
+ }
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomCDATASectionSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomCDATASectionSupport.aj?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomCDATASectionSupport.aj (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomCDATASectionSupport.aj Sun Feb 28 09:50:05 2016
@@ -22,8 +22,6 @@ import javax.xml.stream.XMLStreamExcepti
import javax.xml.stream.XMLStreamWriter;
import org.apache.axiom.core.CoreModelException;
-import org.apache.axiom.core.stream.StreamException;
-import org.apache.axiom.core.stream.XmlHandler;
import org.apache.axiom.om.OMNode;
import org.apache.axiom.om.impl.common.AxiomExceptionTranslator;
import org.apache.axiom.om.impl.intf.AxiomCDATASection;
@@ -33,14 +31,6 @@ public aspect AxiomCDATASectionSupport {
return OMNode.CDATA_SECTION_NODE;
}
- public final void AxiomCDATASection.internalSerialize(XmlHandler handler, boolean cache) throws StreamException {
- try {
- handler.processCDATASection(coreGetCharacterData().toString());
- } catch (CoreModelException ex) {
- throw AxiomExceptionTranslator.translate(ex);
- }
- }
-
public final void AxiomCDATASection.serialize(XMLStreamWriter writer, boolean cache) throws XMLStreamException {
try {
writer.writeCData(coreGetCharacterData().toString());
@@ -48,4 +38,8 @@ public aspect AxiomCDATASectionSupport {
throw AxiomExceptionTranslator.translate(ex);
}
}
+
+ public final void AxiomCDATASection.build() {
+ // TODO
+ }
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomCharacterDataNodeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomCharacterDataNodeSupport.aj?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomCharacterDataNodeSupport.aj (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomCharacterDataNodeSupport.aj Sun Feb 28 09:50:05 2016
@@ -21,8 +21,6 @@ package org.apache.axiom.om.impl.mixin;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
-import org.apache.axiom.core.stream.StreamException;
-import org.apache.axiom.core.stream.XmlHandler;
import org.apache.axiom.om.OMNode;
import org.apache.axiom.om.impl.intf.AxiomCharacterDataNode;
@@ -31,10 +29,6 @@ public aspect AxiomCharacterDataNodeSupp
return coreIsIgnorable() ? OMNode.SPACE_NODE : OMNode.TEXT_NODE;
}
- public final void AxiomCharacterDataNode.internalSerialize(XmlHandler handler, boolean cache) throws StreamException {
- handler.processCharacterData(coreGetCharacterData(), coreIsIgnorable());
- }
-
public final void AxiomCharacterDataNode.serialize(XMLStreamWriter writer, boolean cache) throws XMLStreamException {
writer.writeCharacters(coreGetCharacterData().toString());
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomCommentSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomCommentSupport.aj?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomCommentSupport.aj (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomCommentSupport.aj Sun Feb 28 09:50:05 2016
@@ -22,8 +22,6 @@ import javax.xml.stream.XMLStreamExcepti
import javax.xml.stream.XMLStreamWriter;
import org.apache.axiom.core.CoreModelException;
-import org.apache.axiom.core.stream.StreamException;
-import org.apache.axiom.core.stream.XmlHandler;
import org.apache.axiom.om.OMNode;
import org.apache.axiom.om.impl.common.AxiomExceptionTranslator;
import org.apache.axiom.om.impl.common.AxiomSemantics;
@@ -45,14 +43,6 @@ public aspect AxiomCommentSupport {
public void AxiomComment.setValue(String text) {
coreSetCharacterData(text, AxiomSemantics.INSTANCE);
}
-
- public final void AxiomComment.internalSerialize(XmlHandler handler, boolean cache) throws StreamException {
- try {
- handler.processComment(coreGetCharacterData().toString());
- } catch (CoreModelException ex) {
- throw AxiomExceptionTranslator.translate(ex);
- }
- }
public final void AxiomComment.serialize(XMLStreamWriter writer, boolean cache) throws XMLStreamException {
try {
@@ -64,4 +54,8 @@ public aspect AxiomCommentSupport {
public final void AxiomComment.buildWithAttachments() {
}
+
+ public final void AxiomComment.build() {
+ // TODO
+ }
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomContainerSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomContainerSupport.aj?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomContainerSupport.aj (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomContainerSupport.aj Sun Feb 28 09:50:05 2016
@@ -58,7 +58,6 @@ import org.apache.axiom.om.impl.common.A
import org.apache.axiom.om.impl.common.NamespaceURIInterningXMLStreamReaderWrapper;
import org.apache.axiom.om.impl.common.OMChildrenQNameIterator;
import org.apache.axiom.om.impl.common.SAXResultContentHandler;
-import org.apache.axiom.om.impl.common.builder.StAXHelper;
import org.apache.axiom.om.impl.common.serializer.pull.OMXMLStreamReaderExAdapter;
import org.apache.axiom.om.impl.common.serializer.pull.PullSerializer;
import org.apache.axiom.om.impl.common.serializer.push.XmlDeclarationRewriterHandler;
@@ -289,6 +288,8 @@ public aspect AxiomContainerSupport {
new MTOMXMLStreamWriter(xmlWriter);
try {
internalSerialize(createSerializer(writer, true), cache);
+ } catch (CoreModelException ex) {
+ throw AxiomExceptionTranslator.translate(ex);
} catch (StreamException ex) {
throw AxiomExceptionTranslator.toXMLStreamException(ex);
}
@@ -299,6 +300,8 @@ public aspect AxiomContainerSupport {
try {
try {
internalSerialize(createSerializer(writer, false), cache);
+ } catch (CoreModelException ex) {
+ throw AxiomExceptionTranslator.translate(ex);
} catch (StreamException ex) {
throw AxiomExceptionTranslator.toXMLStreamException(ex);
}
@@ -351,69 +354,6 @@ public aspect AxiomContainerSupport {
serialize(writer, format, false);
}
- final void AxiomContainer.serializeChildren(XmlHandler handler, boolean cache) throws StreamException {
- if (getState() == AxiomContainer.DISCARDED) {
- Builder builder = coreGetBuilder();
- if (builder != null) {
- builder.debugDiscarded(this);
- }
- throw new NodeUnavailableException();
- }
- if (cache) {
- AxiomChildNode child = (AxiomChildNode)getFirstOMChild();
- while (child != null) {
- child.internalSerialize(handler, true);
- child = (AxiomChildNode)child.getNextOMSibling();
- }
- } else {
- // First, recursively serialize all child nodes that have already been created
- AxiomChildNode child = (AxiomChildNode)coreGetFirstChildIfAvailable();
- while (child != null) {
- child.internalSerialize(handler, cache);
- child = (AxiomChildNode)child.coreGetNextSiblingIfAvailable();
- }
- // Next, if the container is incomplete, disable caching (temporarily)
- // and serialize the nodes that have not been built yet by copying the
- // events from the underlying XMLStreamReader.
- if (!isComplete() && coreGetBuilder() != null) {
- Builder builder = coreGetBuilder();
- XMLStreamReader reader = builder.disableCaching();
- // The reader is null in the very special case where this is an OMDocument and
- // the current event is END_DOCUMENT (which means that auto-close is triggered
- // and the parser is released, resulting in a null value).
- if (reader != null) {
- StAXHelper helper = new StAXHelper(reader, handler);
- int depth = 0;
- loop: while (true) {
- switch (helper.lookahead()) {
- case XMLStreamReader.START_ELEMENT:
- depth++;
- break;
- case XMLStreamReader.END_ELEMENT:
- if (depth == 0) {
- break loop;
- } else {
- depth--;
- }
- break;
- case XMLStreamReader.END_DOCUMENT:
- if (depth != 0) {
- // If we get here, then we have seen a START_ELEMENT event without
- // a matching END_ELEMENT
- throw new IllegalStateException();
- }
- break loop;
- }
- // Note that we don't copy the final END_ELEMENT/END_DOCUMENT event for
- // the container. This is the responsibility of the caller.
- helper.next();
- }
- }
- builder.reenableCaching(this);
- }
- }
- }
-
public final void AxiomContainer.notifyChildComplete() {
if (getState() == INCOMPLETE && coreGetBuilder() == null) {
for (Iterator<OMNode> iterator = getChildren(); iterator.hasNext(); ) {
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomDocTypeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomDocTypeSupport.aj?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomDocTypeSupport.aj (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomDocTypeSupport.aj Sun Feb 28 09:50:05 2016
@@ -22,7 +22,6 @@ import javax.xml.stream.XMLStreamExcepti
import javax.xml.stream.XMLStreamWriter;
import org.apache.axiom.core.stream.StreamException;
-import org.apache.axiom.core.stream.XmlHandler;
import org.apache.axiom.om.impl.common.AxiomExceptionTranslator;
import org.apache.axiom.om.impl.common.serializer.push.stax.StAXSerializer;
import org.apache.axiom.om.impl.intf.AxiomDocType;
@@ -36,10 +35,6 @@ public aspect AxiomDocTypeSupport {
return coreGetRootName();
}
- public final void AxiomDocType.internalSerialize(XmlHandler handler, boolean cache) throws StreamException {
- handler.processDocumentTypeDeclaration(coreGetRootName(), coreGetPublicId(), coreGetSystemId(), coreGetInternalSubset());
- }
-
public final void AxiomDocType.serialize(XMLStreamWriter writer, boolean cache) throws XMLStreamException {
try {
internalSerialize(new StAXSerializer(writer), cache);
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomDocumentSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomDocumentSupport.aj?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomDocumentSupport.aj (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomDocumentSupport.aj Sun Feb 28 09:50:05 2016
@@ -20,8 +20,6 @@ package org.apache.axiom.om.impl.mixin;
import org.apache.axiom.core.CoreElement;
import org.apache.axiom.core.CoreModelException;
-import org.apache.axiom.core.stream.StreamException;
-import org.apache.axiom.core.stream.XmlHandler;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMException;
import org.apache.axiom.om.OMNode;
@@ -55,12 +53,6 @@ public aspect AxiomDocumentSupport {
}
}
- public final void AxiomDocument.internalSerialize(XmlHandler handler, boolean cache) throws StreamException {
- handler.startDocument(coreGetInputEncoding(), coreGetXmlVersion(), coreGetXmlEncoding(), coreIsStandalone());
- serializeChildren(handler, cache);
- handler.endDocument();
- }
-
public final String AxiomDocument.getCharsetEncoding() {
String inputEncoding = coreGetInputEncoding();
return inputEncoding == null ? "UTF-8" : inputEncoding;
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomElementSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomElementSupport.aj?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomElementSupport.aj (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomElementSupport.aj Sun Feb 28 09:50:05 2016
@@ -43,8 +43,6 @@ import org.apache.axiom.core.CoreParentN
import org.apache.axiom.core.ElementAction;
import org.apache.axiom.core.ElementMatcher;
import org.apache.axiom.core.Mapper;
-import org.apache.axiom.core.stream.StreamException;
-import org.apache.axiom.core.stream.XmlHandler;
import org.apache.axiom.om.OMAttribute;
import org.apache.axiom.om.OMConstants;
import org.apache.axiom.om.OMContainer;
@@ -528,20 +526,6 @@ public aspect AxiomElementSupport {
return findNamespaceURI("");
}
- public void AxiomElement.internalSerialize(XmlHandler handler, boolean cache) throws StreamException {
- defaultInternalSerialize(handler, cache);
- }
-
- public final void AxiomElement.defaultInternalSerialize(XmlHandler handler, boolean cache) throws StreamException {
- try {
- coreSerializeStartPart(handler);
- } catch (CoreModelException ex) {
- throw new StreamException(ex);
- }
- serializeChildren(handler, cache);
- handler.endElement();
- }
-
public final String AxiomElement.toStringWithConsume() throws XMLStreamException {
StringWriter sw = new StringWriter();
serializeAndConsume(sw);
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomEntityReferenceSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomEntityReferenceSupport.aj?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomEntityReferenceSupport.aj (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomEntityReferenceSupport.aj Sun Feb 28 09:50:05 2016
@@ -21,8 +21,6 @@ package org.apache.axiom.om.impl.mixin;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
-import org.apache.axiom.core.stream.StreamException;
-import org.apache.axiom.core.stream.XmlHandler;
import org.apache.axiom.om.OMNode;
import org.apache.axiom.om.impl.intf.AxiomEntityReference;
@@ -31,10 +29,6 @@ public aspect AxiomEntityReferenceSuppor
return OMNode.ENTITY_REFERENCE_NODE;
}
- public final void AxiomEntityReference.internalSerialize(XmlHandler handler, boolean cache) throws StreamException {
- handler.processEntityReference(coreGetName(), coreGetReplacementText());
- }
-
public final void AxiomEntityReference.serialize(XMLStreamWriter writer, boolean cache) throws XMLStreamException {
writer.writeEntityRef(coreGetName());
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomNamespaceDeclarationSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomNamespaceDeclarationSupport.aj?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomNamespaceDeclarationSupport.aj (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomNamespaceDeclarationSupport.aj Sun Feb 28 09:50:05 2016
@@ -52,4 +52,8 @@ public aspect AxiomNamespaceDeclarationS
this.declaredNamespace = declaredNamespace;
coreSetCharacterData(declaredNamespace.getNamespaceURI(), AxiomSemantics.INSTANCE);
}
+
+ public final void AxiomNamespaceDeclaration.build() {
+ // TODO
+ }
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomProcessingInstructionSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomProcessingInstructionSupport.aj?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomProcessingInstructionSupport.aj (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomProcessingInstructionSupport.aj Sun Feb 28 09:50:05 2016
@@ -22,8 +22,6 @@ import javax.xml.stream.XMLStreamExcepti
import javax.xml.stream.XMLStreamWriter;
import org.apache.axiom.core.CoreModelException;
-import org.apache.axiom.core.stream.StreamException;
-import org.apache.axiom.core.stream.XmlHandler;
import org.apache.axiom.om.impl.common.AxiomExceptionTranslator;
import org.apache.axiom.om.impl.common.AxiomSemantics;
import org.apache.axiom.om.impl.intf.AxiomProcessingInstruction;
@@ -48,14 +46,6 @@ public aspect AxiomProcessingInstruction
public final void AxiomProcessingInstruction.setValue(String value) {
coreSetCharacterData(value, AxiomSemantics.INSTANCE);
}
-
- public final void AxiomProcessingInstruction.internalSerialize(XmlHandler handler, boolean cache) throws StreamException {
- try {
- handler.processProcessingInstruction(coreGetTarget() + " ", coreGetCharacterData().toString());
- } catch (CoreModelException ex) {
- throw AxiomExceptionTranslator.translate(ex);
- }
- }
public final void AxiomProcessingInstruction.serialize(XMLStreamWriter writer, boolean cache) throws XMLStreamException {
try {
@@ -67,4 +57,8 @@ public aspect AxiomProcessingInstruction
public final void AxiomProcessingInstruction.buildWithAttachments() {
}
+
+ public final void AxiomProcessingInstruction.build() {
+ // TODO
+ }
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj Sun Feb 28 09:50:05 2016
@@ -23,9 +23,7 @@ import org.apache.axiom.core.ClonePolicy
import org.apache.axiom.core.CoreElement;
import org.apache.axiom.core.CoreNode;
import org.apache.axiom.core.stream.StreamException;
-import org.apache.axiom.core.stream.XmlHandler;
-import org.apache.axiom.core.stream.XmlHandlerWrapper;
-import org.apache.axiom.om.DeferredParsingException;
+import org.apache.axiom.core.stream.XmlInput;
import org.apache.axiom.om.OMCloneOptions;
import org.apache.axiom.om.OMDataSource;
import org.apache.axiom.om.OMDataSourceExt;
@@ -38,12 +36,11 @@ import org.apache.axiom.om.impl.common.D
import org.apache.axiom.om.impl.common.OMNamespaceImpl;
import org.apache.axiom.om.impl.common.builder.PlainXMLModel;
import org.apache.axiom.om.impl.common.builder.PushBuilder;
-import org.apache.axiom.om.impl.common.builder.PushOMDataSourceInput;
-import org.apache.axiom.om.impl.common.builder.StAXHelper;
import org.apache.axiom.om.impl.common.builder.StAXOMBuilder;
-import org.apache.axiom.om.impl.common.serializer.push.stax.StAXSerializer;
import org.apache.axiom.om.impl.common.util.OMDataSourceUtil;
import org.apache.axiom.om.impl.intf.AxiomSourcedElement;
+import org.apache.axiom.om.impl.stream.ds.PushOMDataSourceInput;
+import org.apache.axiom.om.impl.stream.stax.StAXPullInput;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -235,7 +232,6 @@ public aspect AxiomSourcedElementSupport
builder = new StAXOMBuilder(coreGetNodeFactory(), readerFromDS, this);
}
isExpanded = true;
- coreSetBuilder(builder);
coreSetState(ATTRIBUTES_PENDING);
do {
builder.next();
@@ -407,50 +403,20 @@ public aspect AxiomSourcedElementSupport
}
}
- public void AxiomSourcedElement.internalSerialize(XmlHandler handler, boolean cache)
- throws StreamException {
- if (isExpanded()) {
- defaultInternalSerialize(handler, cache);
- } else if (cache&& OMDataSourceUtil.isDestructiveWrite(dataSource)) {
- forceExpand();
- defaultInternalSerialize(handler, true);
+ public final XmlInput AxiomSourcedElement.getXmlInput(boolean cache) throws StreamException {
+ if (isExpanded() || (cache && OMDataSourceUtil.isDestructiveWrite(dataSource))) {
+ return null;
+ }
// Note: if we can't determine the type (push/pull) of the OMDataSource, we
// default to push
- // TODO: the serializer ignores namespaceURI and localName
- } else if (OMDataSourceUtil.isPullDataSource(dataSource)) {
+ if (OMDataSourceUtil.isPullDataSource(dataSource)) {
try {
- XMLStreamReader reader = dataSource.getReader();
- StAXHelper helper = new StAXHelper(reader, handler);
- while (helper.lookahead() != XMLStreamReader.START_ELEMENT) {
- helper.parserNext();
- }
- int depth = 0;
- do {
- switch (helper.next()) {
- case XMLStreamReader.START_ELEMENT: depth++; break;
- case XMLStreamReader.END_ELEMENT: depth--; break;
- }
- } while (depth > 0);
- reader.close();
+ return new StAXPullInput(dataSource.getReader());
} catch (XMLStreamException ex) {
- // XMLStreamExceptions occurring while _writing_ are wrapped in an OutputException.
- // Therefore, if we get here, there must have been a problem while _reading_.
- throw new DeferredParsingException(ex);
+ throw new StreamException(ex);
}
} else {
- XmlHandler unwrappedHandler = handler;
- while (unwrappedHandler instanceof XmlHandlerWrapper) {
- unwrappedHandler = ((XmlHandlerWrapper)unwrappedHandler).getParent();
- }
- if (unwrappedHandler instanceof StAXSerializer) {
- try {
- dataSource.serialize(((StAXSerializer)unwrappedHandler).getWriter());
- } catch (XMLStreamException ex) {
- throw new StreamException(ex);
- }
- } else {
- new PushOMDataSourceInput(this, dataSource).createReader(handler).proceed();
- }
+ return new PushOMDataSourceInput(this, dataSource);
}
}
@@ -484,7 +450,7 @@ public aspect AxiomSourcedElementSupport
this.dataSource = dataSource;
setComplete(false);
isExpanded = false;
- coreSetBuilder(null);
+ coreSetInputContext(null);
if (isLossyPrefix(dataSource)) {
// Create a deferred namespace that forces an expand to get the prefix
definedNamespace = new DeferredNamespace(this, definedNamespace.getNamespaceURI());
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/stream/stax/XmlHandlerStreamWriter.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/stream/stax/XmlHandlerStreamWriter.java?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/stream/stax/XmlHandlerStreamWriter.java (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/stream/stax/XmlHandlerStreamWriter.java Sun Feb 28 09:50:05 2016
@@ -180,7 +180,9 @@ public class XmlHandlerStreamWriter exte
protected void doWriteCData(String data) throws XMLStreamException {
finishStartElement();
try {
- handler.processCDATASection(data);
+ handler.startCDATASection();
+ handler.processCharacterData(data, false);
+ handler.endCDATASection();
} catch (StreamException ex) {
throw toXMLStreamException(ex);
}
@@ -189,7 +191,9 @@ public class XmlHandlerStreamWriter exte
protected void doWriteComment(String data) throws XMLStreamException {
finishStartElement();
try {
- handler.processComment(data);
+ handler.startComment();
+ handler.processCharacterData(data, false);
+ handler.endComment();
} catch (StreamException ex) {
throw toXMLStreamException(ex);
}
@@ -207,7 +211,9 @@ public class XmlHandlerStreamWriter exte
protected void doWriteProcessingInstruction(String piTarget, String data) throws XMLStreamException {
finishStartElement();
try {
- handler.processProcessingInstruction(piTarget, data);
+ handler.startProcessingInstruction(piTarget);
+ handler.processCharacterData(data, false);
+ handler.endProcessingInstruction();
} catch (StreamException ex) {
throw toXMLStreamException(ex);
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/mixin/AxiomSOAPBodySupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/mixin/AxiomSOAPBodySupport.aj?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/mixin/AxiomSOAPBodySupport.aj (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/mixin/AxiomSOAPBodySupport.aj Sun Feb 28 09:50:05 2016
@@ -21,6 +21,7 @@ package org.apache.axiom.soap.impl.mixin
import javax.xml.stream.XMLStreamReader;
import org.apache.axiom.core.CoreChildNode;
+import org.apache.axiom.core.InputContext;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMException;
import org.apache.axiom.om.OMNamespace;
@@ -36,8 +37,8 @@ public aspect AxiomSOAPBodySupport {
}
private boolean AxiomSOAPBody.hasLookahead() {
- StAXOMBuilder builder = (StAXOMBuilder)coreGetBuilder();
- if (builder != null && !builder.isCompleted() && builder.getTarget() == this) {
+ InputContext context = coreGetInputContext();
+ if (context != null) {
CoreChildNode child = coreGetFirstChildIfAvailable();
while (child != null) {
if (child instanceof OMElement) {
@@ -45,12 +46,13 @@ public aspect AxiomSOAPBodySupport {
}
child = child.coreGetNextSiblingIfAvailable();
}
+ StAXOMBuilder builder = (StAXOMBuilder)context.getBuilder();
do {
if (builder.lookahead() == XMLStreamReader.START_ELEMENT) {
return true;
}
builder.next();
- } while (builder.getTarget() == this);
+ } while (coreGetInputContext() != null);
}
return false;
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/axiom-api/src/main/java/org/apache/axiom/om/OMXMLParserWrapper.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/axiom-api/src/main/java/org/apache/axiom/om/OMXMLParserWrapper.java?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/axiom-api/src/main/java/org/apache/axiom/om/OMXMLParserWrapper.java (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/axiom-api/src/main/java/org/apache/axiom/om/OMXMLParserWrapper.java Sun Feb 28 09:50:05 2016
@@ -59,15 +59,6 @@ public interface OMXMLParserWrapper {
*/
boolean isCache();
- /**
- * Allows to access the underlying parser. Since the parser depends on the underlying
- * implementation, an Object is returned. However the implementations may have restrictions in
- * letting access to the parser.
- *
- * @return Returns Object.
- */
- Object getParser();
-
/** @return Returns the complete status. */
boolean isCompleted();
Modified: webservices/axiom/branches/maven-site-plugin-3.5/axiom-api/src/main/java/org/apache/axiom/util/stax/dialect/Woodstox4Dialect.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/axiom-api/src/main/java/org/apache/axiom/util/stax/dialect/Woodstox4Dialect.java?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/axiom-api/src/main/java/org/apache/axiom/util/stax/dialect/Woodstox4Dialect.java (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/axiom-api/src/main/java/org/apache/axiom/util/stax/dialect/Woodstox4Dialect.java Sun Feb 28 09:50:05 2016
@@ -40,8 +40,9 @@ class Woodstox4Dialect extends AbstractS
}
public XMLInputFactory enableCDataReporting(XMLInputFactory factory) {
- // For Woodstox, this is sufficient
factory.setProperty(XMLInputFactory.IS_COALESCING, Boolean.FALSE);
+ factory.setProperty("http://java.sun.com/xml/stream/properties/report-cdata-event", Boolean.TRUE);
+ factory.setProperty("com.ctc.wstx.minTextSegment", Integer.MAX_VALUE);
return factory;
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/axiom-compat/src/main/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/axiom-compat/src/main/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilder.java?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/axiom-compat/src/main/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilder.java (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/axiom-compat/src/main/java/org/apache/axiom/soap/impl/builder/StAXSOAPModelBuilder.java Sun Feb 28 09:50:05 2016
@@ -87,10 +87,6 @@ public class StAXSOAPModelBuilder implem
return target.isCache();
}
- public Object getParser() {
- return target.getParser();
- }
-
public boolean isCompleted() {
return target.isCompleted();
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java Sun Feb 28 09:50:05 2016
@@ -22,5 +22,7 @@ package org.apache.axiom.om.impl.dom;
import org.apache.axiom.dom.DOMDocumentFragment;
public class DocumentFragmentImpl extends ParentNode implements DOMDocumentFragment {
-
+ public final void build() {
+ // TODO
+ }
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSUnawareAttribute.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSUnawareAttribute.java?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSUnawareAttribute.java (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSUnawareAttribute.java Sun Feb 28 09:50:05 2016
@@ -21,5 +21,7 @@ package org.apache.axiom.om.impl.dom;
import org.apache.axiom.dom.DOMNSUnawareAttribute;
public class NSUnawareAttribute extends AttrImpl implements DOMNSUnawareAttribute {
-
+ public final void build() {
+ // TODO
+ }
}
Modified: webservices/axiom/branches/maven-site-plugin-3.5/src/site/markdown/release-notes/1.3.0.md
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/src/site/markdown/release-notes/1.3.0.md?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/src/site/markdown/release-notes/1.3.0.md (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/src/site/markdown/release-notes/1.3.0.md Sun Feb 28 09:50:05 2016
@@ -43,6 +43,10 @@ Changes in this release
should use the `OMXMLBuilderFactory` API to create builders. Code written for
Axiom 1.2.x that uses that API remains compatible with Axiom 1.3.x.
+* Several methods have been removed from the `OMXMLParserWrapper` interface.
+ This includes formerly deprecated methods as well as methods that would
+ allow manipulation of the state of the underlying parser.
+
* The `BuilderAwareReader` API introduced by [AXIOM-268][] has been removed
without replacement. There are multiple reasons for this:
@@ -134,3 +138,8 @@ Changes in this release
`SOAPMessage` and `SOAPEnvelope` now have the same behavior as any other
`OMDocument` and `OMElement`. The main implication is that the serialization
of a `SOAPEnvelope` no longer generates an XML declaration.
+
+* In Axiom 1.3.0, the `getBuilder` method always returns `null` for document
+ and elements that are (locally) complete, i.e. for which the end event has
+ been processed. That means that after completion, nodes created by a builder
+ will be indistinguishable from programmatically created nodes.
Modified: webservices/axiom/branches/maven-site-plugin-3.5/systests/old-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/systests/old-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/systests/old-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/systests/old-tests/src/test/java/org/apache/axiom/om/impl/mtom/MTOMStAXSOAPModelBuilderTest.java Sun Feb 28 09:50:05 2016
@@ -26,7 +26,6 @@ import org.apache.axiom.om.OMNode;
import org.apache.axiom.om.OMOutputFormat;
import org.apache.axiom.om.OMText;
import org.apache.axiom.om.OMXMLBuilderFactory;
-import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.om.OMXMLStreamReader;
import org.apache.axiom.soap.SOAPModelBuilder;
import org.apache.axiom.ts.soap.MTOMSample;
@@ -78,28 +77,6 @@ public class MTOMStAXSOAPModelBuilderTes
}
}
- public void testAccessToParser() throws Exception {
- OMElement root = createTestMTOMMessage();
- OMXMLParserWrapper builder = root.getBuilder();
- // Disable caching so that the reader can be accessed.
- builder.setCache(false);
- XMLStreamReader reader = (XMLStreamReader) builder.getParser();
-
- // For an MTOM message, the reader is actually an XOPDecodingStreamReader. This one
- // cannot be unwrapped by getOriginalXMLStreamReader
- assertSame(reader, XMLStreamReaderUtils.getOriginalXMLStreamReader(reader));
-
- // To get access to the original reader, we first need to unwrap the
- // XOPDecodingStreamReader using XOPUtils
- XMLStreamReader encodedReader = XOPUtils.getXOPEncodedStream(reader).getReader();
- assertTrue(encodedReader != reader);
-
- // Now we can get to the original parser
- XMLStreamReader original = XMLStreamReaderUtils.getOriginalXMLStreamReader(encodedReader);
-
- assertTrue(!original.getClass().getName().startsWith("org.apache.axiom."));
- }
-
public void testAccessToCachedParser() throws Exception {
OMElement root = createTestMTOMMessage();
XMLStreamReader reader = root.getXMLStreamReader(true);
Modified: webservices/axiom/branches/maven-site-plugin-3.5/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestSerializeAndConsumeWithOMSEInBody.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestSerializeAndConsumeWithOMSEInBody.java?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestSerializeAndConsumeWithOMSEInBody.java (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/envelope/TestSerializeAndConsumeWithOMSEInBody.java Sun Feb 28 09:50:05 2016
@@ -55,7 +55,6 @@ public class TestSerializeAndConsumeWith
OMElement payload = soapFactory.createOMElement(new DummySource(), "dummy", ns);
payload.setNamespace(ns); // This line will cause NoSuchElementException
body.addChild(payload);
- payload.getBuilder().setCache(false); // Or This line will cause NoSuchElementException
StringWriter writer = new StringWriter();
envelope.serializeAndConsume(writer);
// System.out.println(writer);
Modified: webservices/axiom/branches/maven-site-plugin-3.5/testing/xml-truth/src/main/java/org/apache/axiom/truth/xml/StAXXML.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/maven-site-plugin-3.5/testing/xml-truth/src/main/java/org/apache/axiom/truth/xml/StAXXML.java?rev=1732707&r1=1732706&r2=1732707&view=diff
==============================================================================
--- webservices/axiom/branches/maven-site-plugin-3.5/testing/xml-truth/src/main/java/org/apache/axiom/truth/xml/StAXXML.java (original)
+++ webservices/axiom/branches/maven-site-plugin-3.5/testing/xml-truth/src/main/java/org/apache/axiom/truth/xml/StAXXML.java Sun Feb 28 09:50:05 2016
@@ -26,6 +26,7 @@ import org.apache.axiom.truth.xml.spi.Tr
import org.apache.axiom.truth.xml.spi.TraverserException;
import org.apache.axiom.truth.xml.spi.XML;
+import com.ctc.wstx.api.WstxInputProperties;
import com.ctc.wstx.stax.WstxInputFactory;
abstract class StAXXML implements XML {
@@ -41,6 +42,7 @@ abstract class StAXXML implements XML {
factory.setProperty(WstxInputFactory.P_AUTO_CLOSE_INPUT, Boolean.TRUE);
factory.setProperty(WstxInputFactory.P_REPORT_PROLOG_WHITESPACE, Boolean.TRUE);
factory.setProperty(WstxInputFactory.P_REPORT_CDATA, Boolean.TRUE);
+ factory.setProperty(WstxInputProperties.P_MIN_TEXT_SEGMENT, Integer.MAX_VALUE);
try {
return new StAXTraverser(createXMLStreamReader(factory));
} catch (XMLStreamException ex) {