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/05 01:07:27 UTC
svn commit: r1728571 - in
/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl:
common/builder/ common/factory/ intf/
Author: veithen
Date: Fri Feb 5 00:07:26 2016
New Revision: 1728571
URL: http://svn.apache.org/viewvc?rev=1728571&view=rev
Log:
Use BuilderHandler for all leaf node types.
Modified:
webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuilderHandler.java
webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/PushOMBuilder.java
webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXOMBuilder.java
webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/OMFactoryImpl.java
webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/SAXOMBuilder.java
webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/OMFactoryEx.java
webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/TextContent.java
Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuilderHandler.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuilderHandler.java?rev=1728571&r1=1728570&r2=1728571&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuilderHandler.java (original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuilderHandler.java Fri Feb 5 00:07:26 2016
@@ -26,10 +26,15 @@ import org.apache.axiom.core.NodeFactory
import org.apache.axiom.om.OMContainer;
import org.apache.axiom.om.OMSerializable;
import org.apache.axiom.om.impl.common.AxiomSemantics;
+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;
import org.apache.axiom.om.impl.intf.AxiomDocument;
+import org.apache.axiom.om.impl.intf.AxiomEntityReference;
+import org.apache.axiom.om.impl.intf.AxiomProcessingInstruction;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -85,9 +90,46 @@ public final class BuilderHandler {
postProcessNode(node);
}
+ public void createDocumentTypeDeclaration(String rootName, String publicId, String systemId,
+ String internalSubset) {
+ AxiomDocType node = nodeFactory.createNode(AxiomDocType.class);
+ node.coreSetRootName(rootName);
+ node.coreSetPublicId(publicId);
+ node.coreSetSystemId(systemId);
+ node.coreSetInternalSubset(internalSubset);
+ addChild(node);
+ }
+
+ public void processCharacterData(Object data, boolean ignorable) {
+ AxiomCharacterDataNode node = nodeFactory.createNode(AxiomCharacterDataNode.class);
+ node.coreSetCharacterData(data);
+ node.coreSetIgnorable(ignorable);
+ addChild(node);
+ }
+
+ public void createProcessingInstruction(String piTarget, String piData) {
+ AxiomProcessingInstruction node = nodeFactory.createNode(AxiomProcessingInstruction.class);
+ node.coreSetTarget(piTarget);
+ node.coreSetCharacterData(piData, AxiomSemantics.INSTANCE);
+ addChild(node);
+ }
+
public void createComment(String content) {
AxiomComment node = nodeFactory.createNode(AxiomComment.class);
node.coreSetCharacterData(content, AxiomSemantics.INSTANCE);
addChild(node);
}
+
+ public void createCDATASection(String content) {
+ AxiomCDATASection node = nodeFactory.createNode(AxiomCDATASection.class);
+ node.coreSetCharacterData(content, AxiomSemantics.INSTANCE);
+ addChild(node);
+ }
+
+ public void createEntityReference(String name, String replacementText) {
+ AxiomEntityReference node = nodeFactory.createNode(AxiomEntityReference.class);
+ node.coreSetName(name);
+ node.coreSetReplacementText(replacementText);
+ addChild(node);
+ }
}
Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/PushOMBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/PushOMBuilder.java?rev=1728571&r1=1728570&r2=1728571&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/PushOMBuilder.java (original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/PushOMBuilder.java Fri Feb 5 00:07:26 2016
@@ -30,12 +30,11 @@ import org.apache.axiom.om.OMAttribute;
import org.apache.axiom.om.OMContainer;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.OMNode;
-import org.apache.axiom.om.OMText;
import org.apache.axiom.om.impl.intf.AxiomContainer;
import org.apache.axiom.om.impl.intf.AxiomElement;
import org.apache.axiom.om.impl.intf.AxiomSourcedElement;
import org.apache.axiom.om.impl.intf.OMFactoryEx;
+import org.apache.axiom.om.impl.intf.TextContent;
import org.apache.axiom.util.stax.AbstractXMLStreamWriter;
public class PushOMBuilder extends AbstractXMLStreamWriter implements DataHandlerWriter {
@@ -171,11 +170,11 @@ public class PushOMBuilder extends Abstr
}
protected void doWriteCharacters(String text) {
- factory.createOMText(handler.target, text, OMNode.TEXT_NODE, true);
+ handler.processCharacterData(text, false);
}
protected void doWriteCData(String data) {
- factory.createOMText(handler.target, data, OMNode.CDATA_SECTION_NODE, true);
+ handler.createCDATASection(data);
}
protected void doWriteComment(String data) {
@@ -183,11 +182,11 @@ public class PushOMBuilder extends Abstr
}
protected void doWriteEntityRef(String name) throws XMLStreamException {
- factory.createOMEntityReference(handler.target, name, null, true);
+ handler.createEntityReference(name, null);
}
protected void doWriteProcessingInstruction(String piTarget, String data) {
- factory.createOMProcessingInstruction(handler.target, piTarget, data, true);
+ handler.createProcessingInstruction(piTarget, data);
}
protected void doWriteProcessingInstruction(String target) {
@@ -204,15 +203,11 @@ public class PushOMBuilder extends Abstr
public void writeDataHandler(DataHandler dataHandler, String contentID, boolean optimize)
throws IOException, XMLStreamException {
- OMText child = factory.createOMText(dataHandler, optimize);
- if (contentID != null) {
- child.setContentID(contentID);
- }
- handler.target.addChild(child);
+ handler.processCharacterData(new TextContent(contentID, dataHandler, optimize), false);
}
public void writeDataHandler(DataHandlerProvider dataHandlerProvider, String contentID,
boolean optimize) throws IOException, XMLStreamException {
- handler.target.addChild(factory.createOMText(contentID, dataHandlerProvider, optimize));
+ handler.processCharacterData(new TextContent(contentID, dataHandlerProvider, optimize), false);
}
}
Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXOMBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXOMBuilder.java?rev=1728571&r1=1728570&r2=1728571&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXOMBuilder.java (original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXOMBuilder.java Fri Feb 5 00:07:26 2016
@@ -32,7 +32,6 @@ import org.apache.axiom.om.OMException;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.om.OMNode;
-import org.apache.axiom.om.OMText;
import org.apache.axiom.om.impl.builder.Builder;
import org.apache.axiom.om.impl.builder.CustomBuilder;
import org.apache.axiom.om.impl.builder.CustomBuilderSupport;
@@ -40,6 +39,7 @@ import org.apache.axiom.om.impl.builder.
import org.apache.axiom.om.impl.intf.AxiomContainer;
import org.apache.axiom.om.impl.intf.AxiomElement;
import org.apache.axiom.om.impl.intf.OMFactoryEx;
+import org.apache.axiom.om.impl.intf.TextContent;
import org.apache.axiom.util.stax.XMLEventUtils;
import org.apache.axiom.util.stax.XMLStreamReaderUtils;
import org.apache.axiom.util.xml.QNameMap;
@@ -211,31 +211,23 @@ public class StAXOMBuilder implements Bu
}
}
- /**
- * This method will check whether the text can be optimizable using IS_BINARY flag. If that is
- * set then we try to get the data handler.
- *
- * @param textType
- * @return omNode
- */
- private OMNode createOMText(int textType) {
- if (dataHandlerReader != null && dataHandlerReader.isBinary()) {
- Object dataHandlerObject;
+ private void createOMText(int textType) {
+ if (textType == XMLStreamConstants.CHARACTERS && dataHandlerReader != null && dataHandlerReader.isBinary()) {
+ TextContent data;
if (dataHandlerReader.isDeferred()) {
- dataHandlerObject = dataHandlerReader.getDataHandlerProvider();
+ data = new TextContent(dataHandlerReader.getContentID(),
+ dataHandlerReader.getDataHandlerProvider(),
+ dataHandlerReader.isOptimized());
} else {
try {
- dataHandlerObject = dataHandlerReader.getDataHandler();
+ data = new TextContent(dataHandlerReader.getContentID(),
+ dataHandlerReader.getDataHandler(),
+ dataHandlerReader.isOptimized());
} catch (XMLStreamException ex) {
throw new OMException(ex);
}
}
- OMText text = omfactory.createOMText(handler.target, dataHandlerObject, dataHandlerReader.isOptimized(), true);
- String contentID = dataHandlerReader.getContentID();
- if (contentID != null) {
- text.setContentID(contentID);
- }
- return text;
+ handler.processCharacterData(data, false);
} else {
// Some parsers (like Woodstox) parse text nodes lazily and may throw a
// RuntimeException in getText()
@@ -246,7 +238,19 @@ public class StAXOMBuilder implements Bu
parserException = ex;
throw ex;
}
- return omfactory.createOMText(handler.target, text, textType, true);
+ switch (textType) {
+ case XMLStreamConstants.CHARACTERS:
+ handler.processCharacterData(text, false);
+ break;
+ case XMLStreamConstants.SPACE:
+ handler.processCharacterData(text, true);
+ break;
+ case XMLStreamConstants.CDATA:
+ handler.createCDATASection(text);
+ break;
+ default:
+ throw new IllegalStateException();
+ }
}
}
@@ -592,57 +596,47 @@ public class StAXOMBuilder implements Bu
// Note: if autoClose is enabled, then the parser may be null at this point
- OMNode node;
switch (token) {
case XMLStreamConstants.START_ELEMENT: {
handler.elementLevel++;
- node = createNextOMElement();
+ OMNode node = createNextOMElement();
// If the node was created by a custom builder, then it will be complete;
// in this case, the target doesn't change
if (!node.isComplete()) {
handler.target = (AxiomContainer)node;
}
+ handler.postProcessNode(node);
break;
}
case XMLStreamConstants.CHARACTERS:
- node = createOMText(XMLStreamConstants.CHARACTERS);
- break;
case XMLStreamConstants.CDATA:
- node = createOMText(XMLStreamConstants.CDATA);
+ case XMLStreamConstants.SPACE:
+ createOMText(token);
break;
case XMLStreamConstants.END_ELEMENT:
handler.elementLevel--;
endElement();
- node = null;
break;
case XMLStreamConstants.END_DOCUMENT:
handler.done = true;
((AxiomContainer) this.handler.document).setComplete(true);
handler.target = null;
- node = null;
- break;
- case XMLStreamConstants.SPACE:
- node = createOMText(XMLStreamConstants.SPACE);
break;
case XMLStreamConstants.COMMENT:
handler.createComment(parser.getText());
- node = null;
break;
case XMLStreamConstants.DTD:
- node = createDTD();
+ createDTD();
break;
case XMLStreamConstants.PROCESSING_INSTRUCTION:
- node = createPI();
+ handler.createProcessingInstruction(parser.getPITarget(), parser.getPIData());
break;
case XMLStreamConstants.ENTITY_REFERENCE:
- node = createEntityReference();
+ handler.createEntityReference(parser.getLocalName(), parser.getText());
break;
default :
throw new OMException();
}
- if (node != null) {
- handler.postProcessNode(node);
- }
if (handler.target == null && !handler.done) {
// We get here if the document has been discarded (by getDocumentElement(true)
@@ -763,13 +757,7 @@ public class StAXOMBuilder implements Bu
return node;
}
- /**
- * Method createDTD.
- *
- * @return Returns OMNode.
- * @throws OMException
- */
- private OMNode createDTD() throws OMException {
+ private void createDTD() throws OMException {
DTDReader dtdReader;
try {
dtdReader = (DTDReader)parser.getProperty(DTDReader.PROPERTY);
@@ -784,8 +772,8 @@ public class StAXOMBuilder implements Bu
if (internalSubset != null && internalSubset.length() == 0) {
internalSubset = null;
}
- return omfactory.createOMDocType(handler.target, dtdReader.getRootName(), dtdReader.getPublicId(),
- dtdReader.getSystemId(), internalSubset, true);
+ handler.createDocumentTypeDeclaration(dtdReader.getRootName(), dtdReader.getPublicId(),
+ dtdReader.getSystemId(), internalSubset);
}
/**
@@ -820,20 +808,6 @@ public class StAXOMBuilder implements Bu
return text;
}
- /**
- * Method createPI.
- *
- * @return Returns OMNode.
- * @throws OMException
- */
- private OMNode createPI() throws OMException {
- return omfactory.createOMProcessingInstruction(handler.target, parser.getPITarget(), parser.getPIData(), true);
- }
-
- private OMNode createEntityReference() {
- return omfactory.createOMEntityReference(handler.target, parser.getLocalName(), parser.getText(), true);
- }
-
private void endElement() {
handler.target.setComplete(true);
if (handler.elementLevel == 0) {
Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/OMFactoryImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/OMFactoryImpl.java?rev=1728571&r1=1728570&r2=1728571&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/OMFactoryImpl.java (original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/OMFactoryImpl.java Fri Feb 5 00:07:26 2016
@@ -91,23 +91,18 @@ public class OMFactoryImpl implements OM
public final OMDocType createOMDocType(OMContainer parent, String rootName,
String publicId, String systemId, String internalSubset) {
- return createOMDocType(parent, rootName, publicId, systemId, internalSubset, false);
- }
-
- public final OMDocType createOMDocType(OMContainer parent, String rootName,
- String publicId, String systemId, String internalSubset, boolean fromBuilder) {
AxiomDocType node = createNode(AxiomDocType.class);
node.coreSetRootName(rootName);
node.coreSetPublicId(publicId);
node.coreSetSystemId(systemId);
node.coreSetInternalSubset(internalSubset);
if (parent != null) {
- ((AxiomContainer)parent).addChild(node, fromBuilder);
+ ((AxiomContainer)parent).addChild(node, false);
}
return node;
}
- private AxiomText createAxiomText(OMContainer parent, Object content, int type, boolean fromBuilder) {
+ private AxiomText createAxiomText(OMContainer parent, Object content, int type) {
AxiomText node;
switch (type) {
case OMNode.TEXT_NODE: {
@@ -128,34 +123,30 @@ public class OMFactoryImpl implements OM
throw new IllegalArgumentException("Invalid node type");
}
if (parent != null) {
- ((AxiomContainer)parent).addChild(node, fromBuilder);
+ ((AxiomContainer)parent).addChild(node, false);
}
node.coreSetCharacterData(content, AxiomSemantics.INSTANCE);
return node;
}
- public final OMText createOMText(OMContainer parent, String text, int type, boolean fromBuilder) {
- return createAxiomText(parent, text, type, fromBuilder);
- }
-
public final OMText createOMText(String s, int type) {
- return createAxiomText(null, s, type, false);
+ return createAxiomText(null, s, type);
}
public final OMText createOMText(String s) {
- return createAxiomText(null, s, OMNode.TEXT_NODE, false);
+ return createAxiomText(null, s, OMNode.TEXT_NODE);
}
public final OMText createOMText(OMContainer parent, String text, int type) {
- return createAxiomText(parent, text, type, false);
+ return createAxiomText(parent, text, type);
}
public final OMText createOMText(OMContainer parent, String text) {
- return createAxiomText(parent, text, OMNode.TEXT_NODE, false);
+ return createAxiomText(parent, text, OMNode.TEXT_NODE);
}
public final OMText createOMText(OMContainer parent, char[] charArray, int type) {
- return createAxiomText(parent, new String(charArray), type, false);
+ return createAxiomText(parent, new String(charArray), type);
}
public final OMText createOMText(OMContainer parent, QName text, int type) {
@@ -163,15 +154,15 @@ public class OMFactoryImpl implements OM
throw new IllegalArgumentException("QName text arg cannot be null!");
}
OMNamespace ns = ((AxiomElement)parent).handleNamespace(text.getNamespaceURI(), text.getPrefix());
- return createAxiomText(parent, ns == null ? text.getLocalPart() : ns.getPrefix() + ":" + text.getLocalPart(), type, false);
+ return createAxiomText(parent, ns == null ? text.getLocalPart() : ns.getPrefix() + ":" + text.getLocalPart(), type);
}
public final OMText createOMText(OMContainer parent, QName text) {
- return createAxiomText(parent, text, OMNode.TEXT_NODE, false);
+ return createAxiomText(parent, text, OMNode.TEXT_NODE);
}
public final OMText createOMText(OMContainer parent, String s, String mimeType, boolean optimize) {
- return createAxiomText(parent, new TextContent(s, mimeType, optimize), OMNode.TEXT_NODE, false);
+ return createAxiomText(parent, new TextContent(s, mimeType, optimize), OMNode.TEXT_NODE);
}
public final OMText createOMText(String s, String mimeType, boolean optimize) {
@@ -184,43 +175,29 @@ public class OMFactoryImpl implements OM
}
public final OMText createOMText(Object dataHandler, boolean optimize) {
- return createOMText(null, dataHandler, optimize, false);
- }
-
- public final OMText createOMText(OMContainer parent, Object dataHandler, boolean optimize, boolean fromBuilder) {
- return createAxiomText(parent, new TextContent(dataHandler, optimize), OMNode.TEXT_NODE, fromBuilder);
+ return createAxiomText(null, new TextContent(null, dataHandler, optimize), OMNode.TEXT_NODE);
}
public final OMText createOMText(String contentID, DataHandlerProvider dataHandlerProvider, boolean optimize) {
- return createAxiomText(null, new TextContent(contentID, dataHandlerProvider, optimize), OMNode.TEXT_NODE, false);
+ return createAxiomText(null, new TextContent(contentID, dataHandlerProvider, optimize), OMNode.TEXT_NODE);
}
public final OMProcessingInstruction createOMProcessingInstruction(
OMContainer parent, String piTarget, String piData) {
- return createOMProcessingInstruction(parent, piTarget, piData, false);
- }
-
- public final OMProcessingInstruction createOMProcessingInstruction(
- OMContainer parent, String piTarget, String piData, boolean fromBuilder) {
AxiomProcessingInstruction node = createNode(AxiomProcessingInstruction.class);
node.coreSetTarget(piTarget);
node.coreSetCharacterData(piData, AxiomSemantics.INSTANCE);
if (parent != null) {
- ((AxiomContainer)parent).addChild(node, fromBuilder);
+ ((AxiomContainer)parent).addChild(node, false);
}
return node;
}
public final OMEntityReference createOMEntityReference(OMContainer parent, String name) {
- return createOMEntityReference(parent, name, null, false);
- }
-
- public final OMEntityReference createOMEntityReference(OMContainer parent, String name, String replacementText, boolean fromBuilder) {
AxiomEntityReference node = createNode(AxiomEntityReference.class);
node.coreSetName(name);
- node.coreSetReplacementText(replacementText);
if (parent != null) {
- ((AxiomContainer)parent).addChild(node, fromBuilder);
+ ((AxiomContainer)parent).addChild(node, false);
}
return node;
}
Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/SAXOMBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/SAXOMBuilder.java?rev=1728571&r1=1728570&r2=1728571&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/SAXOMBuilder.java (original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/SAXOMBuilder.java Fri Feb 5 00:07:26 2016
@@ -38,6 +38,7 @@ import org.xml.sax.XMLReader;
import java.io.IOException;
+import javax.xml.stream.XMLStreamConstants;
import javax.xml.transform.sax.SAXSource;
public class SAXOMBuilder extends OMContentHandler implements OMXMLParserWrapper {
@@ -143,7 +144,7 @@ public class SAXOMBuilder extends OMCont
protected void createOMDocType(String rootName, String publicId,
String systemId, String internalSubset) {
- factory.createOMDocType(handler.target, rootName, publicId, systemId, internalSubset, true);
+ handler.createDocumentTypeDeclaration(rootName, publicId, systemId, internalSubset);
}
protected OMElement createOMElement(String localName,
@@ -163,11 +164,23 @@ public class SAXOMBuilder extends OMCont
}
protected void createOMText(String text, int type) {
- factory.createOMText(handler.target, text, type, true);
+ switch (type) {
+ case XMLStreamConstants.CHARACTERS:
+ handler.processCharacterData(text, false);
+ break;
+ case XMLStreamConstants.SPACE:
+ handler.processCharacterData(text, true);
+ break;
+ case XMLStreamConstants.CDATA:
+ handler.createCDATASection(text);
+ break;
+ default:
+ throw new IllegalArgumentException();
+ }
}
protected void createOMProcessingInstruction(String piTarget, String piData) {
- factory.createOMProcessingInstruction(handler.target, piTarget, piData, true);
+ handler.createProcessingInstruction(piTarget, piData);
}
protected void createOMComment(String content) {
@@ -175,7 +188,7 @@ public class SAXOMBuilder extends OMCont
}
protected void createOMEntityReference(String name, String replacementText) {
- factory.createOMEntityReference(handler.target, name, replacementText, true);
+ handler.createEntityReference(name, replacementText);
}
public void detach() {
Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/OMFactoryEx.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/OMFactoryEx.java?rev=1728571&r1=1728570&r2=1728571&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/OMFactoryEx.java (original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/OMFactoryEx.java Fri Feb 5 00:07:26 2016
@@ -19,12 +19,8 @@
package org.apache.axiom.om.impl.intf;
import org.apache.axiom.om.OMContainer;
-import org.apache.axiom.om.OMDocType;
-import org.apache.axiom.om.OMEntityReference;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNode;
-import org.apache.axiom.om.OMProcessingInstruction;
-import org.apache.axiom.om.OMText;
import org.apache.axiom.om.OMXMLParserWrapper;
/**
@@ -36,18 +32,6 @@ public interface OMFactoryEx extends OMF
<T extends AxiomElement> T createAxiomElement(Class<T> type, String localName,
OMContainer parent, OMXMLParserWrapper builder);
- OMText createOMText(OMContainer parent, Object dataHandler, boolean optimize, boolean fromBuilder);
-
- OMText createOMText(OMContainer parent, String text, int type, boolean fromBuilder);
-
- OMDocType createOMDocType(OMContainer parent, String rootName, String publicId, String systemId,
- String internalSubset, boolean fromBuilder);
-
- OMProcessingInstruction createOMProcessingInstruction(OMContainer parent,
- String piTarget, String piData, boolean fromBuilder);
-
- OMEntityReference createOMEntityReference(OMContainer parent, String name, String replacementText, boolean fromBuilder);
-
/**
* This method is intended only to be used by Axiom intenrals when merging nodes from different
* Axiom implementations.
Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/TextContent.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/TextContent.java?rev=1728571&r1=1728570&r2=1728571&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/TextContent.java (original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/TextContent.java Fri Feb 5 00:07:26 2016
@@ -60,21 +60,14 @@ public final class TextContent implement
this.optimize = optimize;
}
- public TextContent(Object dataHandlerObject, boolean optimize) {
+ public TextContent(String contentID, Object dataHandlerObject, boolean optimize) {
this.value = null;
mimeType = null;
+ this.contentID = contentID;
this.dataHandlerObject = dataHandlerObject;
binary = true;
this.optimize = optimize;
}
-
- public TextContent(String contentID, DataHandlerProvider dataHandlerProvider, boolean optimize) {
- this.value = null;
- mimeType = null;
- dataHandlerObject = dataHandlerProvider;
- binary = true;
- this.optimize = optimize;
- }
private TextContent(TextContent other) {
this.value = other.value;