You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2005/02/20 04:01:04 UTC
svn commit: r154468 [3/6] - in webservices/axis/trunk/java/modules/om/src:
java/org/apache/axis/om/ java/org/apache/axis/om/impl/llom/
java/org/apache/axis/om/impl/llom/builder/
java/org/apache/axis/om/impl/llom/exception/
java/org/apache/axis/om/impl/llom/factory/
java/org/apache/axis/om/impl/llom/serialize/
java/org/apache/axis/om/impl/llom/traverse/ test-resources/
test-resources/badsoap/ test-resources/soap/ test/org/apache/axis/om/
test/org/apache/axis/om/factory/ test/org/apache/axis/om/impl/builder/
test/org/apache/axis/om/impl/serializer/
test/org/apache/axis/om/impl/streamwrapper/
test/org/apache/axis/om/impl/traverse/
Modified: webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/SOAPBodyImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/SOAPBodyImpl.java?view=diff&r1=154467&r2=154468
==============================================================================
--- webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/SOAPBodyImpl.java (original)
+++ webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/SOAPBodyImpl.java Sat Feb 19 19:00:47 2005
@@ -1,19 +1,18 @@
/*
* Copyright 2004,2005 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.axis.om.impl.llom;
import org.apache.axis.om.OMConstants;
@@ -26,7 +25,14 @@
import javax.xml.namespace.QName;
import java.util.Iterator;
-public class SOAPBodyImpl extends OMElementImpl implements SOAPBody, OMConstants {
+/**
+ * Class SOAPBodyImpl
+ */
+public class SOAPBodyImpl extends OMElementImpl
+ implements SOAPBody, OMConstants {
+ /**
+ * Field hasSOAPFault
+ */
private boolean hasSOAPFault = false;
/**
@@ -38,16 +44,25 @@
this.localName = OMConstants.BODY_LOCAL_NAME;
}
+ /**
+ * Constructor SOAPBodyImpl
+ *
+ * @param envelope
+ * @param builder
+ */
public SOAPBodyImpl(SOAPEnvelope envelope, OMXMLParserWrapper builder) {
- super(OMConstants.BODY_LOCAL_NAME, envelope.getNamespace(), envelope, builder);
+ super(OMConstants.BODY_LOCAL_NAME, envelope.getNamespace(), envelope,
+ builder);
}
/**
* Creates a new <code>SOAPFault</code> object and adds it to
* this <code>SOAPBody</code> object.
*
+ * @param e
* @return the new <code>SOAPFault</code> object
* @throws org.apache.axis.om.OMException if there is a SOAP error
+ * @throws OMException
*/
public SOAPFault addFault(Exception e) throws OMException {
SOAPFault soapFault = new SOAPFaultImpl(this, e);
@@ -67,7 +82,9 @@
if (hasSOAPFault) {
return true;
} else {
- Iterator soapFaultChildren = getChildrenWithName(new QName(SOAPFAULT_NAMESPACE_URI, SOAPFAULT_LOCAL_NAME));
+ Iterator soapFaultChildren =
+ getChildrenWithName(new QName(SOAPFAULT_NAMESPACE_URI,
+ SOAPFAULT_LOCAL_NAME));
if (soapFaultChildren.hasNext()) {
hasSOAPFault = true;
return true;
@@ -84,14 +101,15 @@
* object
*/
public SOAPFault getFault() {
- Iterator soapFaultChildren = getChildrenWithName(new QName(SOAPFAULT_NAMESPACE_URI, SOAPFAULT_LOCAL_NAME));
+ Iterator soapFaultChildren =
+ getChildrenWithName(new QName(SOAPFAULT_NAMESPACE_URI,
+ SOAPFAULT_LOCAL_NAME));
while (soapFaultChildren.hasNext()) {
Object o = soapFaultChildren.next();
if (o instanceof SOAPFault) {
SOAPFault soapFault = (SOAPFault) o;
return soapFault;
}
-
}
return null;
}
@@ -99,15 +117,14 @@
/**
* @param soapFault
* @throws org.apache.axis.om.OMException
+ * @throws OMException
*/
public void addFault(SOAPFault soapFault) throws OMException {
if (hasSOAPFault) {
- throw new OMException("SOAP Body already has a SOAP Fault and there can not be more than one SOAP fault");
+ throw new OMException(
+ "SOAP Body already has a SOAP Fault and there can not be more than one SOAP fault");
}
addChild(soapFault);
hasSOAPFault = true;
-
}
-
-
}
Modified: webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/SOAPEnvelopeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/SOAPEnvelopeImpl.java?view=diff&r1=154467&r2=154468
==============================================================================
--- webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/SOAPEnvelopeImpl.java (original)
+++ webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/SOAPEnvelopeImpl.java Sat Feb 19 19:00:47 2005
@@ -1,19 +1,18 @@
/*
* Copyright 2004,2005 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.axis.om.impl.llom;
import org.apache.axis.om.OMConstants;
@@ -26,7 +25,11 @@
import org.apache.axis.om.SOAPEnvelope;
import org.apache.axis.om.SOAPHeader;
-public class SOAPEnvelopeImpl extends OMElementImpl implements SOAPEnvelope, OMConstants {
+/**
+ * Class SOAPEnvelopeImpl
+ */
+public class SOAPEnvelopeImpl extends OMElementImpl
+ implements SOAPEnvelope, OMConstants {
/**
* @param builder
*/
@@ -34,6 +37,12 @@
super(SOAPENVELOPE_LOCAL_NAME, null, null, builder);
}
+ /**
+ * Constructor SOAPEnvelopeImpl
+ *
+ * @param ns
+ * @param builder
+ */
public SOAPEnvelopeImpl(OMNamespace ns, OMXMLParserWrapper builder) {
super(SOAPENVELOPE_LOCAL_NAME, ns, null, builder);
}
@@ -46,28 +55,31 @@
}
/**
- * Returns the <CODE>SOAPHeader</CODE> object for this <CODE>
- * SOAPEnvelope</CODE> object.
- * <P> This SOAPHeader will just be a container for all the headers in the
- * <CODE>OMMessage</CODE>
- * </P>
- *
- * @return the <CODE>SOAPHeader</CODE> object or <CODE>
- * null</CODE> if there is none
- * @throws org.apache.axis.om.OMException if there is a problem
- * obtaining the <CODE>SOAPHeader</CODE> object
- */
+ * Returns the <CODE>SOAPHeader</CODE> object for this <CODE>
+ * SOAPEnvelope</CODE> object.
+ * <P> This SOAPHeader will just be a container for all the headers in the
+ * <CODE>OMMessage</CODE>
+ * </P>
+ *
+ * @return the <CODE>SOAPHeader</CODE> object or <CODE>
+ * null</CODE> if there is none
+ * @throws org.apache.axis.om.OMException if there is a problem
+ * obtaining the <CODE>SOAPHeader</CODE> object
+ * @throws OMException
+ */
public SOAPHeader getHeader() throws OMException {
- // if(builder != null){
- // while(header == null && body == null){
- // builder.next();
- // }
- // }
+
+ // if(builder != null){
+ // while(header == null && body == null){
+ // builder.next();
+ // }
+ // }
OMNode node = getFirstChild();
while (node != null) {
- if (node != null && node.getType() == OMNode.ELEMENT_NODE) {
+ if ((node != null) && (node.getType() == OMNode.ELEMENT_NODE)) {
OMElement element = (OMElement) node;
- if (OMConstants.HEADER_LOCAL_NAME.equals(element.getLocalName())) {
+ if (OMConstants.HEADER_LOCAL_NAME.equals(
+ element.getLocalName())) {
return (SOAPHeader) element;
}
}
@@ -79,7 +91,6 @@
/**
* Returns the <CODE>SOAPBody</CODE> object associated with
* this <CODE>SOAPEnvelope</CODE> object.
- * <p/>
* <P> This SOAPBody will just be a container for all the BodyElements in the
* <CODE>OMMessage</CODE>
* </P>
@@ -89,43 +100,29 @@
* is none
* @throws org.apache.axis.om.OMException if there is a problem
* obtaining the <CODE>SOAPBody</CODE> object
+ * @throws OMException
*/
public SOAPBody getBody() throws OMException {
- //Look at this . this code forces the OM to build the whole thing because
- //the iterator needs to stay <i>ahead</i> one node.We need to do this manually
- // if(builder != null){
- // while( body == null){
- // builder.next();
- // }
- //
- // }
-
- // return body;
-
OMNode node = getFirstChild();
while (node != null) {
- if (node != null && node.getType() == OMNode.ELEMENT_NODE) {
+ if ((node != null) && (node.getType() == OMNode.ELEMENT_NODE)) {
OMElement element = (OMElement) node;
- if (OMConstants.BODY_LOCAL_NAME.equals(element.getLocalName())) {
+ if (OMConstants.BODY_LOCAL_NAME.equals(
+ element.getLocalName())) {
return (SOAPBody) element;
}
}
node = node.getNextSibling();
}
return null;
- // Iterator bodyIterator = this.getChildrenWithName(new QName(OMConstants.BODY_NAMESPACE_URI, OMConstants.BODY_LOCAL_NAME));
- // SOAPBody soapBody = null;
- // if (bodyIterator.hasNext()) {
- // soapBody = (SOAPBody) bodyIterator.next();
- // }
- //
- // return soapBody;
}
+ /**
+ * Method detach
+ *
+ * @throws OMException
+ */
public void detach() throws OMException {
throw new OMException("Root Element can not be detached");
-
}
-
-
}
Modified: webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/SOAPFaultImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/SOAPFaultImpl.java?view=diff&r1=154467&r2=154468
==============================================================================
--- webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/SOAPFaultImpl.java (original)
+++ webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/SOAPFaultImpl.java Sat Feb 19 19:00:47 2005
@@ -1,19 +1,18 @@
/*
* Copyright 2004,2005 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.axis.om.impl.llom;
import org.apache.axis.om.OMConstants;
@@ -34,49 +33,105 @@
import java.io.StringWriter;
import java.util.Iterator;
-public class SOAPFaultImpl extends OMElementImpl implements SOAPFault, OMConstants {
+/**
+ * Class SOAPFaultImpl
+ */
+public class SOAPFaultImpl extends OMElementImpl
+ implements SOAPFault, OMConstants {
+ /**
+ * Field e
+ */
private Exception e;
+
+ /**
+ * Field faultCodeElement
+ */
private OMElementImpl faultCodeElement;
+
+ /**
+ * Field faultActorElement
+ */
private OMElementImpl faultActorElement;
+
+ /**
+ * Field faultStringElement
+ */
private OMElementImpl faultStringElement;
+
+ /**
+ * Field detailElement
+ */
private OMElementImpl detailElement;
+ /**
+ * Constructor SOAPFaultImpl
+ *
+ * @param parent
+ * @param e
+ */
public SOAPFaultImpl(OMElement parent, Exception e) {
super(SOAPFAULT_LOCAL_NAME,
- new OMNamespaceImpl(SOAPFAULT_NAMESPACE_URI, SOAPFAULT_NAMESPACE_PREFIX));
+ new OMNamespaceImpl(SOAPFAULT_NAMESPACE_URI,
+ SOAPFAULT_NAMESPACE_PREFIX));
this.parent = (OMElementImpl) parent;
this.e = e;
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));
- this.setDetailInformation(OMFactory.newInstance().createText(this, sw.getBuffer().toString()));
+ this.setDetailInformation(OMFactory.newInstance().createText(this,
+ sw.getBuffer().toString()));
}
- public SOAPFaultImpl(OMNamespace ns, OMElement parent, OMXMLParserWrapper builder) {
+ /**
+ * Constructor SOAPFaultImpl
+ *
+ * @param ns
+ * @param parent
+ * @param builder
+ */
+ public SOAPFaultImpl(OMNamespace ns, OMElement parent,
+ OMXMLParserWrapper builder) {
super(SOAPFAULT_LOCAL_NAME, ns, parent, builder);
}
+ /**
+ * Method setFaultCode
+ *
+ * @param faultCode
+ * @throws OMException
+ */
public void setFaultCode(QName faultCode) throws OMException {
if (faultCodeElement != null) {
faultCodeElement.detach();
}
- faultCodeElement = new OMElementImpl(OMConstants.SOAPFAULT_CODE_LOCAL_NAME, this.ns);
+ faultCodeElement =
+ new OMElementImpl(OMConstants.SOAPFAULT_CODE_LOCAL_NAME, this.ns);
this.addChild(faultCodeElement);
- faultCodeElement.addChild(new OMTextImpl(faultCodeElement, faultCode.getPrefix() + ':' + faultCode.getLocalPart()));
-
+ faultCodeElement.addChild(new OMTextImpl(faultCodeElement,
+ faultCode.getPrefix() + ':'
+ + faultCode.getLocalPart()));
}
+ /**
+ * Method getFaultCode
+ *
+ * @return
+ */
public QName getFaultCode() {
if (faultCodeElement != null) {
Iterator childrenIter = faultCodeElement.getChildren();
while (childrenIter.hasNext()) {
Object o = childrenIter.next();
- if (o instanceof OMText && !((OMText) o).getValue().trim().equals("")) {
+ if ((o instanceof OMText)
+ && !((OMText) o).getValue().trim().equals("")) {
String[] strings = ((OMText) o).getValue().split(":");
return new QName("", strings[1], strings[0]);
}
}
} else {
- faultCodeElement = (OMElementImpl) this.getChildWithName(new QName(this.ns.getName(), OMConstants.SOAPFAULT_CODE_LOCAL_NAME, this.ns.getPrefix()));
+ faultCodeElement = (OMElementImpl) this.getChildWithName(
+ new QName(
+ this.ns.getName(), OMConstants.SOAPFAULT_CODE_LOCAL_NAME,
+ this.ns.getPrefix()));
if (faultCodeElement != null) {
return this.getFaultCode();
}
@@ -84,27 +139,43 @@
return null;
}
+ /**
+ * Method setFaultActor
+ *
+ * @param faultActor
+ * @throws OMException
+ */
public void setFaultActor(String faultActor) throws OMException {
if (faultActorElement != null) {
faultActorElement.detach();
}
- faultActorElement = new OMElementImpl(OMConstants.SOAPFAULT_ACTOR_LOCAL_NAME, this.ns);
+ faultActorElement =
+ new OMElementImpl(OMConstants.SOAPFAULT_ACTOR_LOCAL_NAME, this.ns);
this.addChild(faultActorElement);
- faultActorElement.addChild(new OMTextImpl(faultActorElement, faultActor));
+ faultActorElement.addChild(new OMTextImpl(faultActorElement,
+ faultActor));
}
+ /**
+ * Method getFaultActor
+ *
+ * @return
+ */
public String getFaultActor() {
if (faultActorElement != null) {
Iterator childrenIter = faultActorElement.getChildren();
while (childrenIter.hasNext()) {
Object o = childrenIter.next();
- if (o instanceof OMText && !"".equals(((OMText) o).getValue())) {
+ if ((o instanceof OMText)
+ && !"".equals(((OMText) o).getValue())) {
return ((OMText) o).getValue();
}
}
-
} else {
- faultActorElement = (OMElementImpl) this.getChildWithName(new QName(this.ns.getName(), OMConstants.SOAPFAULT_ACTOR_LOCAL_NAME, this.ns.getPrefix()));
+ faultActorElement = (OMElementImpl) this.getChildWithName(
+ new QName(
+ this.ns.getName(), OMConstants.SOAPFAULT_ACTOR_LOCAL_NAME,
+ this.ns.getPrefix()));
if (faultActorElement != null) {
return this.getFaultString();
}
@@ -112,26 +183,43 @@
return null;
}
+ /**
+ * Method setFaultString
+ *
+ * @param faultString
+ * @throws OMException
+ */
public void setFaultString(String faultString) throws OMException {
if (faultStringElement != null) {
faultStringElement.detach();
}
- faultStringElement = new OMElementImpl(OMConstants.SOAPFAULT_STRING_LOCAL_NAME, this.ns);
+ faultStringElement =
+ new OMElementImpl(OMConstants.SOAPFAULT_STRING_LOCAL_NAME, this.ns);
this.addChild(faultStringElement);
- faultStringElement.addChild(new OMTextImpl(faultStringElement, faultString));
+ faultStringElement.addChild(new OMTextImpl(faultStringElement,
+ faultString));
}
+ /**
+ * Method getFaultString
+ *
+ * @return
+ */
public String getFaultString() {
if (faultStringElement != null) {
Iterator childrenIter = faultStringElement.getChildren();
while (childrenIter.hasNext()) {
Object o = childrenIter.next();
- if (o instanceof OMText && !"".equals(((OMText) o).getValue())) {
+ if ((o instanceof OMText)
+ && !"".equals(((OMText) o).getValue())) {
return ((OMText) o).getValue();
}
}
} else {
- faultStringElement = (OMElementImpl) this.getChildWithName(new QName(this.ns.getName(), OMConstants.SOAPFAULT_STRING_LOCAL_NAME, this.ns.getPrefix()));
+ faultStringElement = (OMElementImpl) this.getChildWithName(
+ new QName(
+ this.ns.getName(), OMConstants.SOAPFAULT_STRING_LOCAL_NAME,
+ this.ns.getPrefix()));
if (faultStringElement != null) {
return this.getFaultString();
}
@@ -139,26 +227,41 @@
return null;
}
+ /**
+ * Method setDetailInformation
+ *
+ * @param detail
+ */
public void setDetailInformation(OMNode detail) {
if (detailElement != null) {
detailElement.detach();
}
- detailElement = new OMElementImpl(OMConstants.SOAPFAULT_DETAIL_LOCAL_NAME, this.ns);
+ detailElement =
+ new OMElementImpl(OMConstants.SOAPFAULT_DETAIL_LOCAL_NAME, this.ns);
this.addChild(detailElement);
detailElement.addChild(detail);
}
+ /**
+ * Method getDetailInformation
+ *
+ * @return
+ */
public OMNode getDetailInformation() {
if (detailElement != null) {
Iterator childrenIter = detailElement.getChildren();
while (childrenIter.hasNext()) {
Object o = childrenIter.next();
- if (!(o instanceof OMText && "".equals(((OMText) o).getValue()))) {
+ if (!((o instanceof OMText)
+ && "".equals(((OMText) o).getValue()))) {
return (OMNode) o;
}
}
} else {
- detailElement = (OMElementImpl) this.getChildWithName(new QName(this.ns.getName(), OMConstants.SOAPFAULT_DETAIL_LOCAL_NAME, this.ns.getPrefix()));
+ detailElement = (OMElementImpl) this.getChildWithName(
+ new QName(
+ this.ns.getName(), OMConstants.SOAPFAULT_DETAIL_LOCAL_NAME,
+ this.ns.getPrefix()));
if (detailElement != null) {
return this.getDetailInformation();
}
@@ -166,23 +269,32 @@
return null;
}
+ /**
+ * Method getException
+ *
+ * @return
+ * @throws OMException
+ */
public Exception getException() throws OMException {
if (e == null) {
OMNode detailsInformationNode = this.getDetailInformation();
if (detailsInformationNode instanceof OMElement) {
try {
StringWriter sw = new StringWriter();
- XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(sw);
- ((OMElement) detailsInformationNode).serialize(writer, true);
+ XMLStreamWriter writer =
+ XMLOutputFactory.newInstance().createXMLStreamWriter(
+ sw);
+ ((OMElement) detailsInformationNode).serialize(writer,
+ true);
writer.flush();
return new Exception(sw.toString());
} catch (XMLStreamException e1) {
throw new OMException("Exception in StAX Writer", e1);
}
} else if (detailsInformationNode instanceof OMText) {
- return new Exception(((OMText) detailsInformationNode).getValue());
+ return new Exception(
+ ((OMText) detailsInformationNode).getValue());
}
-
} else {
return e;
}
Modified: webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/SOAPHeaderBlockImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/SOAPHeaderBlockImpl.java?view=diff&r1=154467&r2=154468
==============================================================================
--- webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/SOAPHeaderBlockImpl.java (original)
+++ webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/SOAPHeaderBlockImpl.java Sat Feb 19 19:00:47 2005
@@ -1,19 +1,18 @@
/*
* Copyright 2004,2005 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.axis.om.impl.llom;
import org.apache.axis.om.OMAttribute;
@@ -25,7 +24,11 @@
import javax.xml.namespace.QName;
-public class SOAPHeaderBlockImpl extends OMElementImpl implements SOAPHeaderBlock {
+/**
+ * Class SOAPHeaderBlockImpl
+ */
+public class SOAPHeaderBlockImpl extends OMElementImpl
+ implements SOAPHeaderBlock {
/**
* @param localName
* @param ns
@@ -34,7 +37,16 @@
super(localName, ns);
}
- public SOAPHeaderBlockImpl(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper builder) {
+ /**
+ * Constructor SOAPHeaderBlockImpl
+ *
+ * @param localName
+ * @param ns
+ * @param parent
+ * @param builder
+ */
+ public SOAPHeaderBlockImpl(String localName, OMNamespace ns,
+ OMElement parent, OMXMLParserWrapper builder) {
super(localName, ns, parent, builder);
}
@@ -59,11 +71,16 @@
* @param attrValue
*/
private void setAttribute(String attributeName, String attrValue) {
- OMAttribute omAttribute = this.getAttributeWithQName(new QName(OMConstants.SOAP_ENVELOPE_NAMESPACE_URI, attributeName));
+ OMAttribute omAttribute = this.getAttributeWithQName(
+ new QName(OMConstants.SOAP_ENVELOPE_NAMESPACE_URI, attributeName));
if (omAttribute != null) {
omAttribute.setValue(attrValue);
} else {
- OMAttribute attribute = new OMAttributeImpl(attributeName, new OMNamespaceImpl(OMConstants.SOAP_ENVELOPE_NAMESPACE_URI, OMConstants.SOAPENVELOPE_NAMESPACE_PREFIX), attrValue);
+ OMAttribute attribute = new OMAttributeImpl(
+ attributeName,
+ new OMNamespaceImpl(
+ OMConstants.SOAP_ENVELOPE_NAMESPACE_URI,
+ OMConstants.SOAPENVELOPE_NAMESPACE_PREFIX), attrValue);
this.insertAttribute(attribute);
}
}
@@ -80,29 +97,40 @@
return getAttribute(OMConstants.ATTR_ACTOR);
}
+ /**
+ * Method getAttribute
+ *
+ * @param attrName
+ * @return
+ */
private String getAttribute(String attrName) {
- OMAttribute omAttribute = this.getAttributeWithQName(new QName(OMConstants.SOAP_ENVELOPE_NAMESPACE_URI, attrName));
- return (omAttribute != null) ? omAttribute.getValue() : null;
+ OMAttribute omAttribute = this.getAttributeWithQName(
+ new QName(OMConstants.SOAP_ENVELOPE_NAMESPACE_URI, attrName));
+ return (omAttribute != null)
+ ? omAttribute.getValue()
+ : null;
}
/**
- * Sets the mustUnderstand attribute for this <CODE>
- * SOAPHeaderBlock</CODE> object to be on or off.
- * <P>If the mustUnderstand attribute is on, the actor who
- * receives the <CODE>SOAPHeaderBlock</CODE> must process it
- * correctly. This ensures, for example, that if the <CODE>
- * SOAPHeaderBlock</CODE> object modifies the message, that
- * the message is being modified correctly.</P>
- *
- * @param mustUnderstand <CODE>true</CODE> to
- * set the mustUnderstand attribute on; <CODE>false</CODE>
- * to turn if off
- * @throws IllegalArgumentException if
- * there is a problem in setting the actor.
- * @see #getMustUnderstand() getMustUnderstand()
- */
+ * Sets the mustUnderstand attribute for this <CODE>
+ * SOAPHeaderBlock</CODE> object to be on or off.
+ * <P>If the mustUnderstand attribute is on, the actor who
+ * receives the <CODE>SOAPHeaderBlock</CODE> must process it
+ * correctly. This ensures, for example, that if the <CODE>
+ * SOAPHeaderBlock</CODE> object modifies the message, that
+ * the message is being modified correctly.</P>
+ *
+ * @param mustUnderstand <CODE>true</CODE> to
+ * set the mustUnderstand attribute on; <CODE>false</CODE>
+ * to turn if off
+ * @throws IllegalArgumentException if
+ * there is a problem in setting the actor.
+ * @see #getMustUnderstand() getMustUnderstand()
+ */
public void setMustUnderstand(boolean mustUnderstand) {
- setAttribute(OMConstants.ATTR_MUSTUNDERSTAND, mustUnderstand ? "true" : "false");
+ setAttribute(OMConstants.ATTR_MUSTUNDERSTAND, mustUnderstand
+ ? "true"
+ : "false");
}
/**
@@ -115,7 +143,8 @@
*/
public boolean getMustUnderstand() {
String mustUnderstand = "";
- if ((mustUnderstand = getAttribute(OMConstants.ATTR_MUSTUNDERSTAND)) != null) {
+ if ((mustUnderstand = getAttribute(OMConstants.ATTR_MUSTUNDERSTAND))
+ != null) {
return mustUnderstand.equalsIgnoreCase("true");
}
return false;
Modified: webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/SOAPHeaderImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/SOAPHeaderImpl.java?view=diff&r1=154467&r2=154468
==============================================================================
--- webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/SOAPHeaderImpl.java (original)
+++ webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/SOAPHeaderImpl.java Sat Feb 19 19:00:47 2005
@@ -1,19 +1,18 @@
/*
* Copyright 2004,2005 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.axis.om.impl.llom;
import org.apache.axis.om.OMConstants;
@@ -28,20 +27,32 @@
import javax.xml.namespace.QName;
import java.util.Iterator;
+/**
+ * Class SOAPHeaderImpl
+ */
public class SOAPHeaderImpl extends OMElementImpl implements SOAPHeader {
/**
* @param envelope
*/
public SOAPHeaderImpl(SOAPEnvelope envelope) {
super(envelope);
- //set the namespaces
+
+ // set the namespaces
this.ns = envelope.getNamespace();
this.localName = OMConstants.HEADER_LOCAL_NAME;
-
}
+ /**
+ * Constructor SOAPHeaderImpl
+ *
+ * @param envelope
+ * @param builder
+ */
public SOAPHeaderImpl(SOAPEnvelope envelope, OMXMLParserWrapper builder) {
- super(OMConstants.HEADER_LOCAL_NAME, envelope == null ? null : envelope.getNamespace(), envelope, builder);
+ super(OMConstants.HEADER_LOCAL_NAME, (envelope == null)
+ ? null
+ : envelope.getNamespace(), envelope,
+ builder);
}
/**
@@ -49,13 +60,18 @@
* initialized with the specified name and adds it to this
* <CODE>SOAPHeader</CODE> object.
*
+ * @param localName
+ * @param ns
* @return the new <CODE>SOAPHeaderBlock</CODE> object that
* was inserted into this <CODE>SOAPHeader</CODE>
* object
* @throws org.apache.axis.om.OMException if a SOAP error occurs
+ * @throws OMException
*/
- public SOAPHeaderBlock addHeaderBlock(String localName, OMNamespace ns) throws OMException {
- SOAPHeaderBlock soapHeaderBlock = new SOAPHeaderBlockImpl(localName, ns);
+ public SOAPHeaderBlock addHeaderBlock(String localName, OMNamespace ns)
+ throws OMException {
+ SOAPHeaderBlock soapHeaderBlock = new SOAPHeaderBlockImpl(localName,
+ ns);
this.addChild(soapHeaderBlock);
soapHeaderBlock.setComplete(true);
return soapHeaderBlock;
@@ -72,8 +88,8 @@
* included in a <CODE>SOAPHeader</CODE> object, the message is
* sent to its ultimate destination.
*
- * @param actor a <CODE>String</CODE> giving the
- * URI of the actor for which to search
+ * @param paramActor a <CODE>String</CODE> giving the
+ * URI of the actor for which to search
* @return an <CODE>Iterator</CODE> object over all the <CODE>
* SOAPHeaderBlock</CODE> objects that contain the
* specified actor
@@ -86,8 +102,9 @@
if (o instanceof SOAPHeaderBlock) {
SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock) o;
String actor = soapHeaderBlock.getActor();
- if (actor != null && actor.equalsIgnoreCase(paramActor)) {
- // headerBlocksIter.
+ if ((actor != null) && actor.equalsIgnoreCase(paramActor)) {
+
+ // headerBlocksIter.
}
}
}
@@ -95,24 +112,28 @@
}
/**
- * Returns a list of all the <CODE>SOAPHeaderBlock</CODE>
- * objects in this <CODE>SOAPHeader</CODE> object that have
- * the the specified actor and detaches them from this <CODE>
- * SOAPHeader</CODE> object.
- * <P>This method allows an actor to process only the parts of
- * the <CODE>SOAPHeader</CODE> object that apply to it and to
- * remove them before passing the message on to the next
- * actor.
- *
- * @param actor a <CODE>String</CODE> giving the
- * URI of the actor for which to search
- * @return an <CODE>Iterator</CODE> object over all the <CODE>
- * SOAPHeaderBlock</CODE> objects that contain the
- * specified actor
- * @see #examineHeaderBlocks(String) examineHeaderBlocks(java.lang.String)
- */
+ * Returns a list of all the <CODE>SOAPHeaderBlock</CODE>
+ * objects in this <CODE>SOAPHeader</CODE> object that have
+ * the the specified actor and detaches them from this <CODE>
+ * SOAPHeader</CODE> object.
+ * <P>This method allows an actor to process only the parts of
+ * the <CODE>SOAPHeader</CODE> object that apply to it and to
+ * remove them before passing the message on to the next
+ * actor.
+ *
+ * @param actor a <CODE>String</CODE> giving the
+ * URI of the actor for which to search
+ * @return an <CODE>Iterator</CODE> object over all the <CODE>
+ * SOAPHeaderBlock</CODE> objects that contain the
+ * specified actor
+ * @see #examineHeaderBlocks(String) examineHeaderBlocks(java.lang.String)
+ */
public Iterator extractHeaderBlocks(String actor) {
- return new OMChildrenWithSpecificAttributeIterator(getFirstChild(), new QName(OMConstants.SOAP_ENVELOPE_NAMESPACE_URI, OMConstants.ATTR_ACTOR), actor, true);
+ return new OMChildrenWithSpecificAttributeIterator(
+ getFirstChild(),
+ new QName(
+ OMConstants.SOAP_ENVELOPE_NAMESPACE_URI, OMConstants.ATTR_ACTOR),
+ actor, true);
}
/**
@@ -128,20 +149,23 @@
* specified actor and are marked as MustUnderstand
*/
public Iterator examineMustUnderstandHeaderBlocks(String actor) {
- return new OMChildrenWithSpecificAttributeIterator(getFirstChild(), new QName(OMConstants.SOAP_ENVELOPE_NAMESPACE_URI, OMConstants.ATTR_ACTOR), actor, false);
-
+ return new OMChildrenWithSpecificAttributeIterator(
+ getFirstChild(),
+ new QName(
+ OMConstants.SOAP_ENVELOPE_NAMESPACE_URI, OMConstants.ATTR_ACTOR),
+ actor, false);
}
/**
- * Returns an <code>Iterator</code> over all the
- * <code>SOAPHeaderBlock</code> objects in this <code>SOAPHeader</code>
- * object.
- * Not that this will return elements containing the QName (http://schemas.xmlsoap.org/soap/envelope/, Header)
- *
- * @return an <code>Iterator</code> object over all the
- * <code>SOAPHeaderBlock</code> objects contained by this
- * <code>SOAPHeader</code>
- */
+ * Returns an <code>Iterator</code> over all the
+ * <code>SOAPHeaderBlock</code> objects in this <code>SOAPHeader</code>
+ * object.
+ * Not that this will return elements containing the QName (http://schemas.xmlsoap.org/soap/envelope/, Header)
+ *
+ * @return an <code>Iterator</code> object over all the
+ * <code>SOAPHeaderBlock</code> objects contained by this
+ * <code>SOAPHeader</code>
+ */
public Iterator examineAllHeaderBlocks() {
return this.getChildrenWithName(null);
}
@@ -156,6 +180,6 @@
* <code>SOAPHeader</code>
*/
public Iterator extractAllHeaderBlocks() {
- throw new UnsupportedOperationException(); //TODO implement this
+ throw new UnsupportedOperationException(); // TODO implement this
}
}
Modified: webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/builder/StAXBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/builder/StAXBuilder.java?view=diff&r1=154467&r2=154468
==============================================================================
--- webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/builder/StAXBuilder.java (original)
+++ webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/builder/StAXBuilder.java Sat Feb 19 19:00:47 2005
@@ -1,19 +1,18 @@
/*
* Copyright 2004,2005 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.axis.om.impl.llom.builder;
import org.apache.axis.om.OMConstants;
@@ -34,58 +33,123 @@
* or just an XML model. This class will give some common functionality of OM Building from StAX.
*/
public abstract class StAXBuilder implements OMXMLParserWrapper {
+ /**
+ * Field ombuilderFactory
+ */
protected OMFactory ombuilderFactory;
+
+ /**
+ * Field parser
+ */
protected XMLStreamReader parser;
+
+ /**
+ * Field omfactory
+ */
protected OMFactory omfactory;
+ /**
+ * Field lastNode
+ */
protected OMNode lastNode;
- //returns the state of completion
+
+ // returns the state of completion
+
+ /**
+ * Field done
+ */
protected boolean done = false;
- //keeps the state of the cache
+ // keeps the state of the cache
+
+ /**
+ * Field cache
+ */
protected boolean cache = true;
- //keeps the state of the parser access. if the parser is
- //accessed atleast once,this flag will be set
+ // keeps the state of the parser access. if the parser is
+ // accessed atleast once,this flag will be set
+
+ /**
+ * Field parserAccessed
+ */
protected boolean parserAccessed = false;
+ /**
+ * Constructor StAXBuilder
+ *
+ * @param ombuilderFactory
+ * @param parser
+ */
protected StAXBuilder(OMFactory ombuilderFactory, XMLStreamReader parser) {
this.ombuilderFactory = ombuilderFactory;
this.parser = parser;
omfactory = OMFactory.newInstance();
}
+ /**
+ * Constructor StAXBuilder
+ *
+ * @param parser
+ */
protected StAXBuilder(XMLStreamReader parser) {
this(OMFactory.newInstance(), parser);
omfactory = OMFactory.newInstance();
}
+ /**
+ * Method setOmbuilderFactory
+ *
+ * @param ombuilderFactory
+ */
public void setOmbuilderFactory(OMFactory ombuilderFactory) {
this.ombuilderFactory = ombuilderFactory;
}
- protected abstract void processNamespaceData(OMElement node, boolean isSOAPElement);
- //since the behaviors are different when it comes to namespaces
- //this must be implemented differently
+ /**
+ * Method processNamespaceData
+ *
+ * @param node
+ * @param isSOAPElement
+ */
+ protected abstract void processNamespaceData(OMElement node,
+ boolean isSOAPElement);
+
+ // since the behaviors are different when it comes to namespaces
+ // this must be implemented differently
+ /**
+ * Method processAttributes
+ *
+ * @param node
+ */
protected void processAttributes(OMElement node) {
int attribCount = parser.getAttributeCount();
for (int i = 0; i < attribCount; i++) {
OMNamespace ns = null;
String uri = parser.getAttributeNamespace(i);
- if (uri.hashCode() != 0)
- ns = node.findInScopeNamespace(uri, parser.getAttributePrefix(i));
-
- //todo if the attributes are supposed to namespace qualified all the time
- //todo then this should throw an exception here
+ if (uri.hashCode() != 0) {
+ ns = node.findInScopeNamespace(uri,
+ parser.getAttributePrefix(i));
+ }
- node.insertAttribute(parser.getAttributeLocalName(i), parser.getAttributeValue(i), ns);
+ // todo if the attributes are supposed to namespace qualified all the time
+ // todo then this should throw an exception here
+ node.insertAttribute(parser.getAttributeLocalName(i),
+ parser.getAttributeValue(i), ns);
}
}
+ /**
+ * Method createOMText
+ *
+ * @return
+ * @throws OMException
+ */
protected OMNode createOMText() throws OMException {
- if (lastNode == null)
+ if (lastNode == null) {
throw new OMException();
+ }
OMNode node;
if (lastNode.isComplete()) {
node = omfactory.createText(lastNode.getParent(), parser.getText());
@@ -99,10 +163,22 @@
return node;
}
+ /**
+ * Method reset
+ *
+ * @param node
+ * @throws OMException
+ */
public void reset(OMNode node) throws OMException {
lastNode = null;
}
+ /**
+ * Method discard
+ *
+ * @param el
+ * @throws OMException
+ */
public void discard(OMElement el) throws OMException {
OMElementImpl elementImpl = null;
if (el instanceof OMElementImpl) {
@@ -110,21 +186,24 @@
} else {
throw new OMException();
}
- if (elementImpl.isComplete() || !cache)
+ if (elementImpl.isComplete() || !cache) {
throw new OMException();
+ }
try {
cache = false;
do {
while (parser.next() != XMLStreamConstants.END_ELEMENT) ;
- // TODO:
+
+ // TODO:
} while (!parser.getName().equals(elementImpl.getQName()));
lastNode = (OMNodeImpl) elementImpl.getPreviousSibling();
- if (lastNode != null)
+ if (lastNode != null) {
lastNode.setNextSibling(null);
- else {
+ } else {
OMElement parent = elementImpl.getParent();
- if (parent == null)
+ if (parent == null) {
throw new OMException();
+ }
parent.setFirstChild(null);
lastNode = parent;
}
@@ -136,14 +215,32 @@
}
}
+ /**
+ * Method getText
+ *
+ * @return
+ * @throws OMException
+ */
public String getText() throws OMException {
return parser.getText();
}
+ /**
+ * Method getNamespace
+ *
+ * @return
+ * @throws OMException
+ */
public String getNamespace() throws OMException {
return parser.getNamespaceURI();
}
+ /**
+ * Method getNamespaceCount
+ *
+ * @return
+ * @throws OMException
+ */
public int getNamespaceCount() throws OMException {
try {
return parser.getNamespaceCount();
@@ -152,6 +249,13 @@
}
}
+ /**
+ * Method getNamespacePrefix
+ *
+ * @param index
+ * @return
+ * @throws OMException
+ */
public String getNamespacePrefix(int index) throws OMException {
try {
return parser.getNamespacePrefix(index);
@@ -160,6 +264,13 @@
}
}
+ /**
+ * Method getNamespaceUri
+ *
+ * @param index
+ * @return
+ * @throws OMException
+ */
public String getNamespaceUri(int index) throws OMException {
try {
return parser.getNamespaceURI(index);
@@ -168,45 +279,102 @@
}
}
+ /**
+ * Method setCache
+ *
+ * @param b
+ */
public void setCache(boolean b) {
- if (parserAccessed && b)
- throw new UnsupportedOperationException("parser accessed. cannot set cache");
+ if (parserAccessed && b) {
+ throw new UnsupportedOperationException(
+ "parser accessed. cannot set cache");
+ }
cache = b;
}
+ /**
+ * Method getName
+ *
+ * @return
+ * @throws OMException
+ */
public String getName() throws OMException {
return parser.getLocalName();
}
+ /**
+ * Method getPrefix
+ *
+ * @return
+ * @throws OMException
+ */
public String getPrefix() throws OMException {
return parser.getPrefix();
}
+ /**
+ * Method getAttributeCount
+ *
+ * @return
+ * @throws OMException
+ */
public int getAttributeCount() throws OMException {
return parser.getAttributeCount();
}
+ /**
+ * Method getAttributeNamespace
+ *
+ * @param arg
+ * @return
+ * @throws OMException
+ */
public String getAttributeNamespace(int arg) throws OMException {
return parser.getAttributeNamespace(arg);
}
+ /**
+ * Method getAttributeName
+ *
+ * @param arg
+ * @return
+ * @throws OMException
+ */
public String getAttributeName(int arg) throws OMException {
return parser.getAttributeNamespace(arg);
}
+ /**
+ * Method getAttributePrefix
+ *
+ * @param arg
+ * @return
+ * @throws OMException
+ */
public String getAttributePrefix(int arg) throws OMException {
return parser.getAttributeNamespace(arg);
}
+ /**
+ * Method getParser
+ *
+ * @return
+ */
public Object getParser() {
if (!cache) {
parserAccessed = true;
return parser;
} else {
- throw new UnsupportedOperationException("cache must be switched off to access the parser");
+ throw new UnsupportedOperationException(
+ "cache must be switched off to access the parser");
}
}
+ /**
+ * Method isCompleted
+ *
+ * @return
+ */
public boolean isCompleted() {
return done;
}
@@ -220,15 +388,15 @@
protected abstract OMNode createOMElement() throws OMException;
/**
- * This should proceed the parser one step further, if parser is not completed yet.
- * If this has been called whist parser is done, then throw an OMException.
- * If the cache is set to false, then should be return the event, *without* building the OM tree.
- * If the cache is set to true, then this should handle all the events within this, and should build
- * the object structure appropriately and return the event.
- *
- * @return
- * @throws OMException
- */
+ * This should proceed the parser one step further, if parser is not completed yet.
+ * If this has been called whist parser is done, then throw an OMException.
+ * If the cache is set to false, then should be return the event, *without* building the OM tree.
+ * If the cache is set to true, then this should handle all the events within this, and should build
+ * the object structure appropriately and return the event.
+ *
+ * @return
+ * @throws OMException
+ */
public abstract int next() throws OMException;
/**
@@ -238,13 +406,21 @@
return OMConstants.PULL_TYPE_BUILDER;
}
+ /**
+ * Method registerExternalContentHandler
+ *
+ * @param obj
+ */
public void registerExternalContentHandler(Object obj) {
throw new UnsupportedOperationException();
}
+ /**
+ * Method getRegisteredContentHandler
+ *
+ * @return
+ */
public Object getRegisteredContentHandler() {
throw new UnsupportedOperationException();
}
-
-
}
Modified: webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/builder/StAXOMBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/builder/StAXOMBuilder.java?view=diff&r1=154467&r2=154468
==============================================================================
--- webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/builder/StAXOMBuilder.java (original)
+++ webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/builder/StAXOMBuilder.java Sat Feb 19 19:00:47 2005
@@ -1,19 +1,18 @@
/*
* Copyright 2004,2005 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.axis.om.impl.llom.builder;
import org.apache.axis.om.OMElement;
@@ -33,21 +32,45 @@
* And this will habe the Document concept also.
*/
public class StAXOMBuilder extends StAXBuilder implements OMXMLParserWrapper {
+ /**
+ * Field document
+ */
protected OMDocument document;
+
+ /**
+ * Field omFactory
+ */
protected OMFactory omFactory;
+ /**
+ * Constructor StAXOMBuilder
+ *
+ * @param ombuilderFactory
+ * @param parser
+ */
public StAXOMBuilder(OMFactory ombuilderFactory, XMLStreamReader parser) {
super(ombuilderFactory, parser);
document = new OMDocument(this);
omfactory = OMFactory.newInstance();
}
+ /**
+ * Constructor StAXOMBuilder
+ *
+ * @param parser
+ */
public StAXOMBuilder(XMLStreamReader parser) {
super(parser);
document = new OMDocument(this);
omfactory = OMFactory.newInstance();
}
+ /**
+ * Method createOMElement
+ *
+ * @return
+ * @throws OMException
+ */
protected OMNode createOMElement() throws OMException {
OMElement node;
String elementName = parser.getLocalName();
@@ -55,31 +78,46 @@
node = omfactory.createOMElement(elementName, null, null, this);
document.setRootElement(node);
} else if (lastNode.isComplete()) {
- node = omfactory.createOMElement(elementName, null, lastNode.getParent(), this);
+ node = omfactory.createOMElement(elementName, null,
+ lastNode.getParent(), this);
lastNode.setNextSibling(node);
node.setPreviousSibling(lastNode);
} else {
OMElement e = (OMElement) lastNode;
- node = omfactory.createOMElement(elementName, null, (OMElement) lastNode, this);
+ node = omfactory.createOMElement(elementName, null,
+ (OMElement) lastNode, this);
e.setFirstChild(node);
}
- //create the namespaces
+ // create the namespaces
processNamespaceData(node, false);
- //fill in the attributes
+ // fill in the attributes
processAttributes(node);
return node;
}
+ /**
+ * Method getOMEnvelope
+ *
+ * @return
+ * @throws OMException
+ */
public SOAPEnvelope getOMEnvelope() throws OMException {
- throw new UnsupportedOperationException(); //TODO implement this
+ throw new UnsupportedOperationException(); // TODO implement this
}
+ /**
+ * Method next
+ *
+ * @return
+ * @throws OMException
+ */
public int next() throws OMException {
try {
- if (done)
+ if (done) {
throw new OMException();
+ }
int token = parser.next();
if (!cache) {
return token;
@@ -121,18 +159,32 @@
}
}
+ /**
+ * Method getDocumentElement
+ *
+ * @return
+ */
public OMElement getDocumentElement() {
return document.getRootElement();
}
+ /**
+ * Method processNamespaceData
+ *
+ * @param node
+ * @param isSOAPElement
+ */
protected void processNamespaceData(OMElement node, boolean isSOAPElement) {
int namespaceCount = parser.getNamespaceCount();
for (int i = 0; i < namespaceCount; i++) {
- node.declareNamespace(parser.getNamespaceURI(i), parser.getNamespacePrefix(i));
+ node.declareNamespace(parser.getNamespaceURI(i),
+ parser.getNamespacePrefix(i));
}
- //set the own namespace
- OMNamespace namespace = node.findInScopeNamespace(parser.getNamespaceURI(), parser.getPrefix());
+ // set the own namespace
+ OMNamespace namespace =
+ node.findInScopeNamespace(parser.getNamespaceURI(),
+ parser.getPrefix());
node.setNamespace(namespace);
}
}
Modified: webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/builder/StAXSOAPModelBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/builder/StAXSOAPModelBuilder.java?view=diff&r1=154467&r2=154468
==============================================================================
--- webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/builder/StAXSOAPModelBuilder.java (original)
+++ webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/builder/StAXSOAPModelBuilder.java Sat Feb 19 19:00:47 2005
@@ -1,19 +1,18 @@
/*
* Copyright 2004,2005 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.axis.om.impl.llom.builder;
import org.apache.axis.om.OMConstants;
@@ -33,10 +32,28 @@
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamReader;
+/**
+ * Class StAXSOAPModelBuilder
+ */
public class StAXSOAPModelBuilder extends StAXBuilder {
+ /**
+ * Field envelope
+ */
private SOAPEnvelopeImpl envelope;
+
+ /**
+ * Field headerPresent
+ */
private boolean headerPresent = false;
+
+ /**
+ * Field bodyPresent
+ */
private boolean bodyPresent = false;
+
+ /**
+ * Field log
+ */
private Log log = LogFactory.getLog(getClass());
/**
@@ -46,21 +63,45 @@
*/
private int elementLevel = 0;
- public StAXSOAPModelBuilder(OMFactory ombuilderFactory, XMLStreamReader parser) {
+ /**
+ * Constructor StAXSOAPModelBuilder
+ *
+ * @param ombuilderFactory
+ * @param parser
+ */
+ public StAXSOAPModelBuilder(OMFactory ombuilderFactory,
+ XMLStreamReader parser) {
super(ombuilderFactory, parser);
}
+ /**
+ * Constructor StAXSOAPModelBuilder
+ *
+ * @param parser
+ */
public StAXSOAPModelBuilder(XMLStreamReader parser) {
super(parser);
}
+ /**
+ * Method getSOAPEnvelope
+ *
+ * @return
+ * @throws OMException
+ */
public SOAPEnvelope getSOAPEnvelope() throws OMException {
- while (envelope == null && !done) {
+ while ((envelope == null) && !done) {
next();
}
return envelope;
}
+ /**
+ * Method createOMElement
+ *
+ * @return
+ * @throws OMException
+ */
protected OMNode createOMElement() throws OMException {
OMElement node;
String elementName = parser.getLocalName();
@@ -76,71 +117,108 @@
e.setFirstChild(node);
}
-
-
- //fill in the attributes
+ // fill in the attributes
processAttributes(node);
- log.info("Build the OMElelment {" + node.getNamespaceName() + '}' + node.getLocalName() + "By the StaxSOAPModelBuilder");
+ log.info("Build the OMElelment {" + node.getNamespaceName() + '}'
+ + node.getLocalName() + "By the StaxSOAPModelBuilder");
return node;
}
- private OMElement constructNode(OMElement parent, String elementName, boolean isEnvelope) {
+ /**
+ * Method constructNode
+ *
+ * @param parent
+ * @param elementName
+ * @param isEnvelope
+ * @return
+ */
+ private OMElement constructNode(OMElement parent, String elementName,
+ boolean isEnvelope) {
OMElement element = null;
if (isEnvelope) {
- if (!elementName.equalsIgnoreCase(OMConstants.SOAPENVELOPE_LOCAL_NAME)) {
- throw new OMException("First Element must contain the local name, " + OMConstants.SOAPENVELOPE_LOCAL_NAME);
+ if (!elementName.equalsIgnoreCase(
+ OMConstants.SOAPENVELOPE_LOCAL_NAME)) {
+ throw new OMException(
+ "First Element must contain the local name, "
+ + OMConstants.SOAPENVELOPE_LOCAL_NAME);
}
- envelope = (SOAPEnvelopeImpl) ombuilderFactory.createSOAPEnvelope(null, this);
+ envelope =
+ (SOAPEnvelopeImpl) ombuilderFactory.createSOAPEnvelope(null,
+ this);
element = (OMElementImpl) envelope;
processNamespaceData(element, true);
-
} else if (elementLevel == 2) {
+
// this is either a header or a body
if (elementName.equals(OMConstants.HEADER_LOCAL_NAME)) {
if (headerPresent) {
- throw new OMBuilderException("Multiple headers encountered!");
+ throw new OMBuilderException(
+ "Multiple headers encountered!");
}
if (bodyPresent) {
throw new OMBuilderException("Header Body wrong order!");
}
headerPresent = true;
- element = ombuilderFactory.createSOAPHeader((SOAPEnvelope) parent, this);
- //envelope.setHeader((SOAPHeader)element);
+ element =
+ ombuilderFactory.createSOAPHeader((SOAPEnvelope) parent,
+ this);
+
+ // envelope.setHeader((SOAPHeader)element);
processNamespaceData(element, true);
} else if (elementName.equals(OMConstants.BODY_LOCAL_NAME)) {
if (bodyPresent) {
- throw new OMBuilderException("Multiple body elements encountered");
+ throw new OMBuilderException(
+ "Multiple body elements encountered");
}
bodyPresent = true;
- element = ombuilderFactory.createSOAPBody((SOAPEnvelope) parent, this);
- //envelope.setBody((SOAPBody)element);
+ element =
+ ombuilderFactory.createSOAPBody((SOAPEnvelope) parent,
+ this);
+
+ // envelope.setBody((SOAPBody)element);
processNamespaceData(element, true);
} else {
- throw new OMBuilderException(elementName + " is not supported here. Envelope can not have elements other than Header and Body.");
+ throw new OMBuilderException(
+ elementName
+ + " is not supported here. Envelope can not have elements other than Header and Body.");
}
+ } else if ((elementLevel == 3)
+ && parent.getLocalName().equalsIgnoreCase(
+ OMConstants.HEADER_LOCAL_NAME)) {
- } else if (elementLevel == 3 && parent.getLocalName().equalsIgnoreCase(OMConstants.HEADER_LOCAL_NAME)) {
// this is a headerblock
- element = ombuilderFactory.createSOAPHeaderBlock(elementName, null, parent, this);
+ element = ombuilderFactory.createSOAPHeaderBlock(elementName, null,
+ parent, this);
processNamespaceData(element, false);
+ } else if ((elementLevel == 3) && parent.getLocalName().equalsIgnoreCase(
+ OMConstants.BODY_LOCAL_NAME) && elementName.equalsIgnoreCase(
+ OMConstants.BODY_FAULT_LOCAL_NAME)) {
- } else if (elementLevel == 3 && parent.getLocalName().equalsIgnoreCase(OMConstants.BODY_LOCAL_NAME) && elementName.equalsIgnoreCase(OMConstants.BODY_FAULT_LOCAL_NAME)) {
// this is a headerblock
- element = ombuilderFactory.createSOAPFault(null, (SOAPBody) parent, this);
+ element = ombuilderFactory.createSOAPFault(null, (SOAPBody) parent,
+ this);
processNamespaceData(element, false);
-
} else {
+
// this is neither of above. Just create an element
- element = ombuilderFactory.createOMElement(elementName, null, parent, this);
+ element = ombuilderFactory.createOMElement(elementName, null,
+ parent, this);
processNamespaceData(element, false);
}
return element;
}
+ /**
+ * Method next
+ *
+ * @return
+ * @throws OMException
+ */
public int next() throws OMException {
try {
- if (done)
+ if (done) {
throw new OMException();
+ }
int token = parser.next();
if (!cache) {
return token;
@@ -181,29 +259,44 @@
}
}
+ /**
+ * Method getDocumentElement
+ *
+ * @return
+ */
public OMElement getDocumentElement() {
return getSOAPEnvelope();
}
+ /**
+ * Method processNamespaceData
+ *
+ * @param node
+ * @param isSOAPElement
+ */
protected void processNamespaceData(OMElement node, boolean isSOAPElement) {
int namespaceCount = parser.getNamespaceCount();
for (int i = 0; i < namespaceCount; i++) {
- node.declareNamespace(parser.getNamespaceURI(i), parser.getNamespacePrefix(i));
+ node.declareNamespace(parser.getNamespaceURI(i),
+ parser.getNamespacePrefix(i));
}
- //set the own namespace
- OMNamespace namespace = node.findInScopeNamespace(parser.getNamespaceURI(), parser.getPrefix());
- //TODO we got to have this to make sure OM reject mesagess that are not sname space qualified
- //But got to comment this to interop with Axis.1.x
- // if (namespace == null) {
- // throw new OMException("All elements must be namespace qualified!");
- // }
-
+ // set the own namespace
+ OMNamespace namespace =
+ node.findInScopeNamespace(parser.getNamespaceURI(),
+ parser.getPrefix());
+
+ // TODO we got to have this to make sure OM reject mesagess that are not sname space qualified
+ // But got to comment this to interop with Axis.1.x
+ // if (namespace == null) {
+ // throw new OMException("All elements must be namespace qualified!");
+ // }
if (isSOAPElement) {
- if (!namespace.getName().equals(OMConstants.SOAP_ENVELOPE_NAMESPACE_URI))
+ if (!namespace.getName().equals(
+ OMConstants.SOAP_ENVELOPE_NAMESPACE_URI)) {
throw new OMBuilderException("invalid SOAP namespace URI");
+ }
}
node.setNamespace(namespace);
}
-
}
Modified: webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/exception/OMBuilderException.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/exception/OMBuilderException.java?view=diff&r1=154467&r2=154468
==============================================================================
--- webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/exception/OMBuilderException.java (original)
+++ webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/exception/OMBuilderException.java Sat Feb 19 19:00:47 2005
@@ -1,24 +1,31 @@
/*
* Copyright 2004,2005 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.axis.om.impl.llom.exception;
import org.apache.axis.om.OMException;
+/**
+ * Class OMBuilderException
+ */
public class OMBuilderException extends OMException {
+ /**
+ * Constructor OMBuilderException
+ *
+ * @param s
+ */
public OMBuilderException(String s) {
super(s);
}
Modified: webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/exception/OMStreamingException.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/exception/OMStreamingException.java?view=diff&r1=154467&r2=154468
==============================================================================
--- webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/exception/OMStreamingException.java (original)
+++ webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/exception/OMStreamingException.java Sat Feb 19 19:00:47 2005
@@ -1,35 +1,56 @@
/*
* Copyright 2004,2005 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.axis.om.impl.llom.exception;
import org.apache.axis.om.OMException;
+/**
+ * Class OMStreamingException
+ */
public class OMStreamingException extends OMException {
+ /**
+ * Constructor OMStreamingException
+ */
public OMStreamingException() {
}
+ /**
+ * Constructor OMStreamingException
+ *
+ * @param message
+ */
public OMStreamingException(String message) {
super(message);
}
+ /**
+ * Constructor OMStreamingException
+ *
+ * @param message
+ * @param cause
+ */
public OMStreamingException(String message, Throwable cause) {
super(message, cause);
}
+ /**
+ * Constructor OMStreamingException
+ *
+ * @param cause
+ */
public OMStreamingException(Throwable cause) {
super(cause);
}
Modified: webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/factory/OMLinkedListImplFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/factory/OMLinkedListImplFactory.java?view=diff&r1=154467&r2=154468
==============================================================================
--- webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/factory/OMLinkedListImplFactory.java (original)
+++ webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/factory/OMLinkedListImplFactory.java Sat Feb 19 19:00:47 2005
@@ -1,19 +1,18 @@
/*
* Copyright 2004,2005 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.axis.om.impl.llom.factory;
import org.apache.axis.om.OMConstants;
@@ -39,94 +38,241 @@
import javax.xml.namespace.QName;
+/**
+ * Class OMLinkedListImplFactory
+ */
public class OMLinkedListImplFactory extends OMFactory {
+ /**
+ * Field MAX_TO_POOL
+ */
public static final int MAX_TO_POOL = 100;
+ /**
+ * Method createOMElement
+ *
+ * @param localName
+ * @param ns
+ * @return
+ */
public OMElement createOMElement(String localName, OMNamespace ns) {
OMElementImpl element = new OMElementImpl(localName, ns);
return element;
}
- public OMElement createOMElement(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper builder) {
- OMElementImpl element = new OMElementImpl(localName, ns, parent, builder);
+ /**
+ * Method createOMElement
+ *
+ * @param localName
+ * @param ns
+ * @param parent
+ * @param builder
+ * @return
+ */
+ public OMElement createOMElement(String localName, OMNamespace ns,
+ OMElement parent,
+ OMXMLParserWrapper builder) {
+ OMElementImpl element = new OMElementImpl(localName, ns, parent,
+ builder);
return element;
}
- public OMElement createOMElement(String localName, String namespaceURI, String namespacePrefix) {
- return this.createOMElement(localName, this.createOMNamespace(namespaceURI, namespacePrefix));
- }
-
- public OMElement createOMElement(QName qname, OMElement parent) throws OMException {
+ /**
+ * Method createOMElement
+ *
+ * @param localName
+ * @param namespaceURI
+ * @param namespacePrefix
+ * @return
+ */
+ public OMElement createOMElement(String localName, String namespaceURI,
+ String namespacePrefix) {
+ return this.createOMElement(localName,
+ this.createOMNamespace(namespaceURI,
+ namespacePrefix));
+ }
+
+ /**
+ * Method createOMElement
+ *
+ * @param qname
+ * @param parent
+ * @return
+ * @throws OMException
+ */
+ public OMElement createOMElement(QName qname, OMElement parent)
+ throws OMException {
return new OMElementImpl(qname, parent);
}
+ /**
+ * Method createOMNamespace
+ *
+ * @param uri
+ * @param prefix
+ * @return
+ */
public OMNamespace createOMNamespace(String uri, String prefix) {
return new OMNamespaceImpl(uri, prefix);
}
+ /**
+ * Method createText
+ *
+ * @param parent
+ * @param text
+ * @return
+ */
public OMText createText(OMElement parent, String text) {
OMTextImpl textNode = new OMTextImpl(parent, text);
return textNode;
}
+ /**
+ * Method createText
+ *
+ * @param s
+ * @return
+ */
public OMText createText(String s) {
OMTextImpl textNode = new OMTextImpl(s);
;
return textNode;
}
+ /**
+ * Method createSOAPBody
+ *
+ * @param envelope
+ * @return
+ */
public SOAPBody createSOAPBody(SOAPEnvelope envelope) {
SOAPBody soapBody = new SOAPBodyImpl(envelope);
return soapBody;
}
- public SOAPBody createSOAPBody(SOAPEnvelope envelope, OMXMLParserWrapper builder) {
+ /**
+ * Method createSOAPBody
+ *
+ * @param envelope
+ * @param builder
+ * @return
+ */
+ public SOAPBody createSOAPBody(SOAPEnvelope envelope,
+ OMXMLParserWrapper builder) {
return new SOAPBodyImpl(envelope, builder);
}
- public SOAPEnvelope createSOAPEnvelope(OMNamespace ns, OMXMLParserWrapper builder) {
+ /**
+ * Method createSOAPEnvelope
+ *
+ * @param ns
+ * @param builder
+ * @return
+ */
+ public SOAPEnvelope createSOAPEnvelope(OMNamespace ns,
+ OMXMLParserWrapper builder) {
return new SOAPEnvelopeImpl(ns, builder);
}
+ /**
+ * Method createSOAPEnvelope
+ *
+ * @param ns
+ * @return
+ */
public SOAPEnvelope createSOAPEnvelope(OMNamespace ns) {
return new SOAPEnvelopeImpl(ns);
}
+ /**
+ * Method createSOAPHeader
+ *
+ * @param envelope
+ * @return
+ */
public SOAPHeader createSOAPHeader(SOAPEnvelope envelope) {
return new SOAPHeaderImpl(envelope);
}
- public SOAPHeader createSOAPHeader(SOAPEnvelope envelope, OMXMLParserWrapper builder) {
+ /**
+ * Method createSOAPHeader
+ *
+ * @param envelope
+ * @param builder
+ * @return
+ */
+ public SOAPHeader createSOAPHeader(SOAPEnvelope envelope,
+ OMXMLParserWrapper builder) {
return new SOAPHeaderImpl(envelope, builder);
}
- public SOAPHeaderBlock createSOAPHeaderBlock(String localName, OMNamespace ns) {
+ /**
+ * Method createSOAPHeaderBlock
+ *
+ * @param localName
+ * @param ns
+ * @return
+ */
+ public SOAPHeaderBlock createSOAPHeaderBlock(String localName,
+ OMNamespace ns) {
return new SOAPHeaderBlockImpl(localName, ns);
}
- public SOAPHeaderBlock createSOAPHeaderBlock(String localName, OMNamespace ns, OMElement parent, OMXMLParserWrapper builder) {
+ /**
+ * Method createSOAPHeaderBlock
+ *
+ * @param localName
+ * @param ns
+ * @param parent
+ * @param builder
+ * @return
+ */
+ public SOAPHeaderBlock createSOAPHeaderBlock(String localName,
+ OMNamespace ns, OMElement parent, OMXMLParserWrapper builder) {
return new SOAPHeaderBlockImpl(localName, ns, parent, builder);
}
+ /**
+ * Method createSOAPFault
+ *
+ * @param parent
+ * @param e
+ * @return
+ */
public SOAPFault createSOAPFault(SOAPBody parent, Exception e) {
return new SOAPFaultImpl(parent, e);
}
- public SOAPFault createSOAPFault(OMNamespace ns, SOAPBody parent, OMXMLParserWrapper builder) {
+ /**
+ * Method createSOAPFault
+ *
+ * @param ns
+ * @param parent
+ * @param builder
+ * @return
+ */
+ public SOAPFault createSOAPFault(OMNamespace ns, SOAPBody parent,
+ OMXMLParserWrapper builder) {
return new SOAPFaultImpl(ns, parent, builder);
}
+ /**
+ * Method getDefaultEnvelope
+ *
+ * @return
+ */
public SOAPEnvelope getDefaultEnvelope() {
- //Create an envelop
- OMNamespace ns = new OMNamespaceImpl(OMConstants.SOAP_ENVELOPE_NAMESPACE_URI, OMConstants.SOAPENVELOPE_NAMESPACE_PREFIX);
+ // Create an envelope
+ OMNamespace ns =
+ new OMNamespaceImpl(OMConstants.SOAP_ENVELOPE_NAMESPACE_URI,
+ OMConstants.SOAPENVELOPE_NAMESPACE_PREFIX);
SOAPEnvelopeImpl env = new SOAPEnvelopeImpl(ns);
SOAPBodyImpl bodyImpl = new SOAPBodyImpl(env);
env.addChild(bodyImpl);
- //env.setBody(bodyImpl);
+
SOAPHeaderImpl headerImpl = new SOAPHeaderImpl(env);
headerImpl.setComplete(true);
env.addChild(headerImpl);
- //env.setHeader(headerImpl);
return env;
}
}
Modified: webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/factory/OMXMLBuilderFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/factory/OMXMLBuilderFactory.java?view=diff&r1=154467&r2=154468
==============================================================================
--- webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/factory/OMXMLBuilderFactory.java (original)
+++ webservices/axis/trunk/java/modules/om/src/java/org/apache/axis/om/impl/llom/factory/OMXMLBuilderFactory.java Sat Feb 19 19:00:47 2005
@@ -1,19 +1,18 @@
/*
* Copyright 2004,2005 The Apache Software Foundation.
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.axis.om.impl.llom.factory;
import org.apache.axis.om.OMFactory;
@@ -22,19 +21,51 @@
import javax.xml.stream.XMLStreamReader;
+/**
+ * Class OMXMLBuilderFactory
+ */
public class OMXMLBuilderFactory {
+ /**
+ * Field PARSER_XPP
+ */
public static final String PARSER_XPP = "XPP";
+
+ /**
+ * Field PARSER_STAX
+ */
public static final String PARSER_STAX = "StAX";
+ /**
+ * Field MODEL_SOAP_SPECIFIC
+ */
public static final String MODEL_SOAP_SPECIFIC = "SOAP_SPECIFIC";
+
+ /**
+ * Field MODEL_OM
+ */
public static final String MODEL_OM = "OM_ONLY";
- public static StAXSOAPModelBuilder createStAXSOAPModelBuilder(OMFactory ombuilderFactory, XMLStreamReader parser) {
+ /**
+ * Method createStAXSOAPModelBuilder
+ *
+ * @param ombuilderFactory
+ * @param parser
+ * @return
+ */
+ public static StAXSOAPModelBuilder createStAXSOAPModelBuilder(
+ OMFactory ombuilderFactory, XMLStreamReader parser) {
return new StAXSOAPModelBuilder(ombuilderFactory, parser);
}
- public static StAXOMBuilder createStAXOMBuilder(OMFactory ombuilderFactory, XMLStreamReader parser) {
+ /**
+ * Method createStAXOMBuilder
+ *
+ * @param ombuilderFactory
+ * @param parser
+ * @return
+ */
+ public static StAXOMBuilder createStAXOMBuilder(OMFactory ombuilderFactory,
+ XMLStreamReader parser) {
return new StAXOMBuilder(ombuilderFactory, parser);
}
-
}