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 gd...@apache.org on 2007/03/29 20:49:16 UTC
svn commit: r523794 [5/8] - in /webservices/axis2/trunk/java/modules:
adb/src/org/apache/axis2/databinding/
adb/src/org/apache/axis2/databinding/i18n/
adb/src/org/apache/axis2/databinding/typemapping/
adb/src/org/apache/axis2/databinding/types/ adb/src...
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/SimpleElementReaderStateMachine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/SimpleElementReaderStateMachine.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/SimpleElementReaderStateMachine.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/SimpleElementReaderStateMachine.java Thu Mar 29 11:49:12 2007
@@ -21,18 +21,16 @@
*/
/**
- * A state machine to read elements with simple content. Returns the text
- * of the element and the stream reader will be one event beyond the
- * end element at return
+ * A state machine to read elements with simple content. Returns the text of the element and the
+ * stream reader will be one event beyond the end element at return
*/
-public class SimpleElementReaderStateMachine implements States,Constants{
-
+public class SimpleElementReaderStateMachine implements States, Constants {
private QName elementNameToTest = null;
private int currentState = INIT_STATE;
private boolean nillable = false;
- private String text="";
+ private String text = "";
private String errorMessage = "";
private boolean elementSkipped = false;
@@ -47,14 +45,14 @@
return text;
}
- /**
- * sets the nillable flag
- */
- public void setNillable(){
+ /** sets the nillable flag */
+ public void setNillable() {
nillable = true;
}
+
/**
* the Qname of the element to be tested
+ *
* @param elementNameToTest
*/
public void setElementNameToTest(QName elementNameToTest) {
@@ -63,48 +61,50 @@
}
/**
- * Resets the state machine. Once the reset is called
- * the state machine is good enough for a fresh run
+ * Resets the state machine. Once the reset is called the state machine is good enough for a
+ * fresh run
*/
- public void reset(){
+ public void reset() {
elementNameToTest = null;
currentState = INIT_STATE;
nillable = false;
- text="";
+ text = "";
errorMessage = "";
}
+
/**
* public read method - reads a given reader to extract the text value
+ *
* @param reader
*/
public void read(XMLStreamReader reader) throws XMLStreamException {
- do{
+ do {
updateState(reader);
//test for the nillable attribute
- if (currentState==START_ELEMENT_FOUND_STATE &&
- nillable){
- if (TRUE.equals(reader.getAttributeValue(XSI_NAMESPACE,NIL))){
+ if (currentState == START_ELEMENT_FOUND_STATE &&
+ nillable) {
+ if (TRUE.equals(reader.getAttributeValue(XSI_NAMESPACE, NIL))) {
text = null;
//force the state to be null found
- currentState= NULLED_STATE;
+ currentState = NULLED_STATE;
}
}
- if (currentState==TEXT_FOUND_STATE){
+ if (currentState == TEXT_FOUND_STATE) {
//read the text value and store it
text = reader.getText();
}
- if (currentState!=FINISHED_STATE
- && currentState!= ILLEGAL_STATE){
+ if (currentState != FINISHED_STATE
+ && currentState != ILLEGAL_STATE) {
reader.next();
}
- }while(currentState!=FINISHED_STATE
- && currentState!= ILLEGAL_STATE);
+ } while (currentState != FINISHED_STATE
+ && currentState != ILLEGAL_STATE);
- if (currentState==ILLEGAL_STATE){
+ if (currentState == ILLEGAL_STATE) {
throw new RuntimeException("Illegal state!" + errorMessage);
}
@@ -113,65 +113,66 @@
/**
* Updates the state depending on the parser
+ *
* @param reader
*/
- private void updateState(XMLStreamReader reader) throws XMLStreamException{
+ private void updateState(XMLStreamReader reader) throws XMLStreamException {
int event = reader.getEventType();
- switch(currentState){
+ switch (currentState) {
case INIT_STATE:
- if (event==XMLStreamConstants.START_DOCUMENT){
+ if (event == XMLStreamConstants.START_DOCUMENT) {
currentState = STARTED_STATE;
//start element found at init
- }else if (event==XMLStreamConstants.START_ELEMENT){
- if (elementNameToTest.equals(reader.getName())){
+ } else if (event == XMLStreamConstants.START_ELEMENT) {
+ if (elementNameToTest.equals(reader.getName())) {
currentState = START_ELEMENT_FOUND_STATE;
- }else{
+ } else {
currentState = STARTED_STATE;
}
- }else if (event==XMLStreamConstants.END_ELEMENT){
+ } else if (event == XMLStreamConstants.END_ELEMENT) {
// an end element is found at the init state
// we should break the process here ?
- currentState = FINISHED_STATE ;
+ currentState = FINISHED_STATE;
elementSkipped = true;
}
break;
- case STARTED_STATE:
- if (event==XMLStreamConstants.START_ELEMENT ) {
- if (elementNameToTest.equals(reader.getName())){
+ case STARTED_STATE:
+ if (event == XMLStreamConstants.START_ELEMENT) {
+ if (elementNameToTest.equals(reader.getName())) {
currentState = START_ELEMENT_FOUND_STATE;
}
}
break;
- case START_ELEMENT_FOUND_STATE:
- if (event==XMLStreamConstants.CHARACTERS){
- currentState = TEXT_FOUND_STATE;
- }else if (event==XMLStreamConstants.END_ELEMENT){
+ case START_ELEMENT_FOUND_STATE:
+ if (event == XMLStreamConstants.CHARACTERS) {
+ currentState = TEXT_FOUND_STATE;
+ } else if (event == XMLStreamConstants.END_ELEMENT) {
//force the text to be empty!
text = "";
- if (elementNameToTest.equals(reader.getName())){
+ if (elementNameToTest.equals(reader.getName())) {
currentState = END_ELEMENT_FOUND_STATE;
- }else{
+ } else {
currentState = ILLEGAL_STATE;
- errorMessage = "Wrong element name " +reader.getName(); //todo I18n this
+ errorMessage = "Wrong element name " + reader.getName(); //todo I18n this
}
}
break;
- case TEXT_FOUND_STATE:
- if (event==XMLStreamConstants.END_ELEMENT){
- if (elementNameToTest.equals(reader.getName())){
+ case TEXT_FOUND_STATE:
+ if (event == XMLStreamConstants.END_ELEMENT) {
+ if (elementNameToTest.equals(reader.getName())) {
currentState = END_ELEMENT_FOUND_STATE;
- }else{
+ } else {
currentState = ILLEGAL_STATE;
//set the error message
- errorMessage = "Wrong element name " +reader.getName(); //todo I18n this
+ errorMessage = "Wrong element name " + reader.getName(); //todo I18n this
}
- }else if (event==XMLStreamConstants.CHARACTERS){
- text = text + reader.getText(); //append the text
+ } else if (event == XMLStreamConstants.CHARACTERS) {
+ text = text + reader.getText(); //append the text
//do not change the state
}
break;
@@ -186,32 +187,29 @@
//being forced. Hence we need to advance the parser upto the
// end element and set the state to be end element found
case NULLED_STATE:
- while (event!= XMLStreamConstants.END_ELEMENT){
- event=reader.next();
+ while (event != XMLStreamConstants.END_ELEMENT) {
+ event = reader.next();
}
currentState = END_ELEMENT_FOUND_STATE;
break;
default:
- if (event==XMLStreamConstants.CHARACTERS){
- if (reader.getText().trim().length()==0){
+ if (event == XMLStreamConstants.CHARACTERS) {
+ if (reader.getText().trim().length() == 0) {
//the text is empty - don't change the state
- }else{
+ } else {
//we do NOT handle mixed content
currentState = ILLEGAL_STATE;
- errorMessage = "Mixed Content " +reader.getText();
+ errorMessage = "Mixed Content " + reader.getText();
}
- }else{
+ } else {
currentState = ILLEGAL_STATE;
- errorMessage = "Current state is " + currentState ;
+ errorMessage = "Current state is " + currentState;
}
break;
}
}
-
-
-
}
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBDataHandlerStreamReader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBDataHandlerStreamReader.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBDataHandlerStreamReader.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBDataHandlerStreamReader.java Thu Mar 29 11:49:12 2007
@@ -1,12 +1,12 @@
package org.apache.axis2.databinding.utils.reader;
+import org.apache.axis2.databinding.utils.ConverterUtil;
+
import javax.activation.DataHandler;
import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;
import javax.xml.stream.Location;
import javax.xml.stream.XMLStreamException;
-
-import org.apache.axis2.databinding.utils.ConverterUtil;
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
@@ -50,17 +50,18 @@
/**
* Return the right properties for the optimization
+ *
* @param propKey
* @throws IllegalArgumentException
*/
public Object getProperty(String propKey) throws IllegalArgumentException {
- if (OPTIMIZATION_ENABLED.equals(propKey)){
+ if (OPTIMIZATION_ENABLED.equals(propKey)) {
return Boolean.TRUE;
}
- if (state==TEXT_STATE){
- if (IS_BINARY.equals(propKey)){
+ if (state == TEXT_STATE) {
+ if (IS_BINARY.equals(propKey)) {
return Boolean.TRUE;
- }else if (DATA_HANDLER.equals(propKey)){
+ } else if (DATA_HANDLER.equals(propKey)) {
return value;
}
}
@@ -71,9 +72,9 @@
public int next() throws XMLStreamException {
//no need to handle null here. it should have been handled
//already
- switch (state){
+ switch (state) {
case START_ELEMENT_STATE:
- state=TEXT_STATE;
+ state = TEXT_STATE;
return CHARACTERS;
case END_ELEMENT_STATE:
//oops, not supposed to happen!
@@ -91,14 +92,14 @@
}
public String getElementText() throws XMLStreamException {
- if (state==START_ELEMENT){
+ if (state == START_ELEMENT) {
//move to the end state and return the value
state = END_ELEMENT_STATE;
- if (convertedText==null){
+ if (convertedText == null) {
convertedText = ConverterUtil.getStringFromDatahandler(value);
}
return convertedText;
- }else{
+ } else {
throw new XMLStreamException();
}
@@ -109,7 +110,7 @@
}
public boolean hasNext() throws XMLStreamException {
- return (state!=END_ELEMENT_STATE);
+ return (state != END_ELEMENT_STATE);
}
public void close() throws XMLStreamException {
@@ -121,15 +122,15 @@
}
public boolean isStartElement() {
- return (state==START_ELEMENT_STATE);
+ return (state == START_ELEMENT_STATE);
}
public boolean isEndElement() {
- return (state==END_ELEMENT_STATE);
+ return (state == END_ELEMENT_STATE);
}
public boolean isCharacters() {
- return (state==TEXT_STATE);
+ return (state == TEXT_STATE);
}
public boolean isWhiteSpace() {
@@ -173,15 +174,15 @@
}
public int getNamespaceCount() {
- return (nsDeclared)?1:0;
+ return (nsDeclared) ? 1 : 0;
}
public String getNamespacePrefix(int i) {
- return (nsDeclared && i==0)?name.getPrefix():null;
+ return (nsDeclared && i == 0) ? name.getPrefix() : null;
}
public String getNamespaceURI(int i) {
- return (nsDeclared && i==0)?name.getNamespaceURI():null;
+ return (nsDeclared && i == 0) ? name.getNamespaceURI() : null;
}
public NamespaceContext getNamespaceContext() {
@@ -189,7 +190,7 @@
}
public int getEventType() {
- switch (state){
+ switch (state) {
case START_ELEMENT_STATE:
return START_ELEMENT;
case END_ELEMENT_STATE:
@@ -204,25 +205,25 @@
}
public String getText() {
- if (state==TEXT_STATE){
- if (convertedText==null){
+ if (state == TEXT_STATE) {
+ if (convertedText == null) {
convertedText =
ConverterUtil.getStringFromDatahandler(value);
}
return convertedText;
- }else{
+ } else {
throw new IllegalStateException();
}
}
public char[] getTextCharacters() {
- if (state==TEXT_STATE){
- if (convertedText==null){
+ if (state == TEXT_STATE) {
+ if (convertedText == null) {
convertedText =
ConverterUtil.getStringFromDatahandler(value);
}
return convertedText.toCharArray();
- }else{
+ } else {
throw new IllegalStateException();
}
}
@@ -233,22 +234,22 @@
}
public int getTextStart() {
- if (state==TEXT_STATE){
+ if (state == TEXT_STATE) {
return 0;
- }else{
+ } else {
throw new IllegalStateException();
}
}
public int getTextLength() {
- if (state==TEXT_STATE){
- if (convertedText==null){
+ if (state == TEXT_STATE) {
+ if (convertedText == null) {
convertedText =
ConverterUtil.getStringFromDatahandler(value);
}
return convertedText.length();
- }else{
- throw new IllegalStateException();
+ } else {
+ throw new IllegalStateException();
}
}
@@ -258,11 +259,11 @@
}
public boolean hasText() {
- return (state==TEXT_STATE);
+ return (state == TEXT_STATE);
}
public Location getLocation() {
- return new Location(){
+ return new Location() {
public int getLineNumber() {
return 0;
}
@@ -286,17 +287,17 @@
}
public QName getName() {
- if (state!=TEXT_STATE){
+ if (state != TEXT_STATE) {
return name;
- }else{
+ } else {
return null;
}
}
public String getLocalName() {
- if (state!=TEXT_STATE){
+ if (state != TEXT_STATE) {
return name.getLocalPart();
- }else{
+ } else {
return null;
}
}
@@ -307,18 +308,18 @@
}
public String getNamespaceURI() {
- if (state!=TEXT_STATE){
+ if (state != TEXT_STATE) {
return name.getNamespaceURI();
- }else{
+ } else {
return null;
}
}
public String getPrefix() {
- if (state!=TEXT_STATE){
+ if (state != TEXT_STATE) {
return name.getPrefix();
- }else{
+ } else {
return null;
}
}
@@ -348,7 +349,7 @@
}
public boolean isDone() {
- return (state==END_ELEMENT_STATE);
+ return (state == END_ELEMENT_STATE);
}
public void addNamespaceContext(NamespaceContext nsContext) {
@@ -358,10 +359,11 @@
public void init() {
//just add the current elements namespace and prefix to the this
//elements nscontext
- addToNsMap(name.getPrefix(),name.getNamespaceURI());
+ addToNsMap(name.getPrefix(), name.getNamespaceURI());
}
+
/**
* @param prefix
* @param uri
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBNamespaceContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBNamespaceContext.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBNamespaceContext.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBNamespaceContext.java Thu Mar 29 11:49:12 2007
@@ -3,8 +3,8 @@
import org.apache.axis2.util.ArrayStack;
import javax.xml.namespace.NamespaceContext;
-import java.util.Iterator;
import java.util.ArrayList;
+import java.util.Iterator;
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
@@ -42,29 +42,29 @@
/**
* Register a namespace in this context
+ *
* @param prefix
* @param uri
*/
- public void pushNamespace(String prefix,String uri){
+ public void pushNamespace(String prefix, String uri) {
prefixStack.push(prefix);
uriStack.push(uri);
}
- /**
- * Pop a namespace
- */
- public void popNamespace(){
+ /** Pop a namespace */
+ public void popNamespace() {
prefixStack.pop();
uriStack.pop();
}
+
public String getNamespaceURI(String prefix) {
//do the corrections as per the javadoc
- if (prefixStack.contains(prefix)){
+ if (prefixStack.contains(prefix)) {
int index = prefixStack.indexOf(prefix);
return (String)uriStack.get(index);
}
- if (parentNsContext!=null){
+ if (parentNsContext != null) {
return parentNsContext.getPrefix(prefix);
}
return null;
@@ -73,11 +73,11 @@
public String getPrefix(String uri) {
//do the corrections as per the javadoc
int index = uriStack.indexOf(uri);
- if (index != -1){
+ if (index != -1) {
return (String)prefixStack.get(index);
}
- if (parentNsContext!=null){
+ if (parentNsContext != null) {
return parentNsContext.getPrefix(uri);
}
return null;
@@ -88,7 +88,7 @@
String[] uris = (String[])uriStack.toArray(new String[uriStack.size()]);
ArrayList tempList = new ArrayList();
for (int i = 0; i < uris.length; i++) {
- if (uris[i].equals(uri)){
+ if (uris[i].equals(uri)) {
tempList.add(prefixStack.get(i));
//we assume that array conversion preserves the order
}
@@ -100,7 +100,7 @@
}
- private class WrappingIterator implements Iterator{
+ private class WrappingIterator implements Iterator {
private Iterator containedIterator = null;
@@ -117,8 +117,8 @@
}
/**
- * As per the contract on the API of Namespace context
- * the returned iterator should be immutable
+ * As per the contract on the API of Namespace context the returned iterator should be
+ * immutable
*/
public void remove() {
throw new UnsupportedOperationException();
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReader.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReader.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReader.java Thu Mar 29 11:49:12 2007
@@ -2,8 +2,8 @@
import org.apache.axis2.databinding.utils.Constants;
-import javax.xml.stream.XMLStreamReader;
import javax.xml.namespace.NamespaceContext;
+import javax.xml.stream.XMLStreamReader;
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
@@ -20,7 +20,7 @@
* limitations under the License.
*/
-public interface ADBXMLStreamReader extends XMLStreamReader,Constants {
+public interface ADBXMLStreamReader extends XMLStreamReader, Constants {
// this will help to handle Text within the current element.
// user should pass the element text to the property list as this
@@ -28,20 +28,15 @@
// so that it is not a valid XML name
static final String ELEMENT_TEXT = "Element Text";
- /**
- * Extra method to query the state of the pullparser
- */
- boolean isDone();
+ /** Extra method to query the state of the pullparser */
+ boolean isDone();
- /**
- * add the parent namespace context to this parser
- */
- void addNamespaceContext(NamespaceContext nsContext);
+ /** add the parent namespace context to this parser */
+ void addNamespaceContext(NamespaceContext nsContext);
/**
- * Initiate the parser - this will do whatever the needed
- * tasks to initiate the parser and must be called before
- * attempting any specific parsing using this parser
+ * Initiate the parser - this will do whatever the needed tasks to initiate the parser and must
+ * be called before attempting any specific parsing using this parser
*/
- void init();
+ void init();
}
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/ADBXMLStreamReaderImpl.java Thu Mar 29 11:49:12 2007
@@ -33,32 +33,24 @@
*/
/**
- * This is the new implementation of the ADBpullaparser. The approach here is simple
- * When the pull parser needs to generate events for a particular name-value(s) pair
- * it always handes over (delegates) the task to another pull parser which knows how
- * to deal with it
- * The common types of name value pairs we'll come across are
- * 1. String name/QName name - String value
- * 2. String name/QName name - String[] value
- * 3. OMElementkey - OMElement value
- * 4. QName name/String name - ADBBean value
- * 5. QName name/String name - Java bean
- * 5. QName name/String name - Datahandler
+ * This is the new implementation of the ADBpullaparser. The approach here is simple When the pull
+ * parser needs to generate events for a particular name-value(s) pair it always handes over
+ * (delegates) the task to another pull parser which knows how to deal with it The common types of
+ * name value pairs we'll come across are 1. String name/QName name - String value 2. String
+ * name/QName name - String[] value 3. OMElementkey - OMElement value 4. QName name/String name -
+ * ADBBean value 5. QName name/String name - Java bean 5. QName name/String name - Datahandler
* <p/>
- * As for the attributes, these are the possible combinations in the
- * array
- * 1. String name/QName name - String value
- * 2. OMAttributeKey - OMAttribute
+ * As for the attributes, these are the possible combinations in the array 1. String name/QName name
+ * - String value 2. OMAttributeKey - OMAttribute
* <p/>
- * Note that certain array methods have been deliberately removed to avoid
- * complications. The generated code will take the trouble to lay the
- * elements of the array in the correct order
+ * Note that certain array methods have been deliberately removed to avoid complications. The
+ * generated code will take the trouble to lay the elements of the array in the correct order
* <p/>
* <p/>
- * Hence there will be a parser impl that knows how to handle these types, and
- * this parent parser will always delegate these tasks to the child pullparasers
- * in effect this is one huge state machine that has only a few states and delegates
- * things down to the child parsers whenever possible
+ * Hence there will be a parser impl that knows how to handle these types, and this parent parser
+ * will always delegate these tasks to the child pullparasers in effect this is one huge state
+ * machine that has only a few states and delegates things down to the child parsers whenever
+ * possible
* <p/>
*/
public class ADBXMLStreamReaderImpl implements ADBXMLStreamReader {
@@ -120,9 +112,7 @@
this.typeTable = typeTable;
}
- /**
- * add the namespace context
- */
+ /** add the namespace context */
public void addNamespaceContext(NamespaceContext nsContext) {
// register the namespace context passed in to this
@@ -132,9 +122,8 @@
}
/**
- * we need to split out the calling to the populate namespaces
- * seperately since this needs to be done *after* setting the
- * parent namespace context. We cannot assume it will happen at
+ * we need to split out the calling to the populate namespaces seperately since this needs to be
+ * done *after* setting the parent namespace context. We cannot assume it will happen at
* construction!
*/
public void init() {
@@ -199,9 +188,7 @@
return 0;
}
- /**
- * @throws XMLStreamException
- */
+ /** @throws XMLStreamException */
public boolean hasNext() throws XMLStreamException {
if (state == DELEGATED_STATE) {
if (childReader.isDone()) {
@@ -292,12 +279,11 @@
public int getAttributeCount() {
return (state == DELEGATED_STATE) ?
childReader.getAttributeCount() :
- ((attributes != null) && (state == START_ELEMENT_STATE) ? attributes.length / 2 : 0);
+ ((attributes != null) && (state == START_ELEMENT_STATE) ? attributes.length / 2 :
+ 0);
}
- /**
- * @param i
- */
+ /** @param i */
public QName getAttributeName(int i) {
if (state == DELEGATED_STATE) {
return childReader.getAttributeName(i);
@@ -321,7 +307,7 @@
// sure
throw new UnsupportedOperationException();
}
- OMAttribute att = (OMAttribute) omAttribObj;
+ OMAttribute att = (OMAttribute)omAttribObj;
return att.getQName();
} else if (attribPointer instanceof OMAttribKey) {
Object omAttribObj = attributes[(i * 2) + 1];
@@ -332,13 +318,13 @@
// sure
throw new UnsupportedOperationException();
}
- OMAttribute att = (OMAttribute) omAttribObj;
+ OMAttribute att = (OMAttribute)omAttribObj;
return att.getQName();
//case two - attrib name is a plain string
} else if (attribPointer instanceof String) {
- return new QName((String) attribPointer);
+ return new QName((String)attribPointer);
} else if (attribPointer instanceof QName) {
- return (QName) attribPointer;
+ return (QName)attribPointer;
} else {
return null;
}
@@ -423,7 +409,7 @@
// sure
throw new UnsupportedOperationException();
}
- OMAttribute att = (OMAttribute) omAttribObj;
+ OMAttribute att = (OMAttribute)omAttribObj;
return att.getAttributeValue();
} else if (attribPointer instanceof OMAttribKey) {
if (omAttribObj == null ||
@@ -433,13 +419,13 @@
// sure
throw new UnsupportedOperationException();
}
- OMAttribute att = (OMAttribute) omAttribObj;
+ OMAttribute att = (OMAttribute)omAttribObj;
return att.getAttributeValue();
//case two - attrib name is a plain string
} else if (attribPointer instanceof String) {
- return (String) omAttribObj;
+ return (String)omAttribObj;
} else if (attribPointer instanceof QName) {
- return (String) omAttribObj;
+ return (String)omAttribObj;
} else {
return null;
}
@@ -471,9 +457,7 @@
}
}
- /**
- * @param i
- */
+ /** @param i */
public String getNamespacePrefix(int i) {
if (state == DELEGATED_STATE) {
return childReader.getNamespacePrefix(i);
@@ -492,12 +476,10 @@
}
- /**
- * Get the prefix list from the hastable and take that into an array
- */
+ /** Get the prefix list from the hastable and take that into an array */
private String[] makePrefixArray() {
String[] prefixes =
- (String[]) declaredNamespaceMap.keySet().
+ (String[])declaredNamespaceMap.keySet().
toArray(new String[declaredNamespaceMap.size()]);
Arrays.sort(prefixes);
return prefixes;
@@ -509,7 +491,7 @@
} else if (state != TEXT_STATE) {
String namespacePrefix = getNamespacePrefix(i);
return namespacePrefix == null ? null :
- (String) declaredNamespaceMap.get(namespacePrefix);
+ (String)declaredNamespaceMap.get(namespacePrefix);
} else {
throw new IllegalStateException();
}
@@ -545,7 +527,7 @@
if (state == DELEGATED_STATE) {
return childReader.getText();
} else if (state == TEXT_STATE) {
- return (String) properties[currentPropertyIndex - 1];
+ return (String)properties[currentPropertyIndex - 1];
} else {
throw new IllegalStateException();
}
@@ -556,7 +538,7 @@
return childReader.getTextCharacters();
} else if (state == TEXT_STATE) {
return properties[currentPropertyIndex - 1] == null ? new char[0] :
- ((String) properties[currentPropertyIndex - 1]).toCharArray();
+ ((String)properties[currentPropertyIndex - 1]).toCharArray();
} else {
throw new IllegalStateException();
}
@@ -605,9 +587,7 @@
}
}
- /**
- * check the validity of this implementation
- */
+ /** check the validity of this implementation */
public boolean hasText() {
if (state == DELEGATED_STATE) {
return childReader.hasText();
@@ -722,9 +702,7 @@
//////////////////////////////////////////////////////////////////////////
- /**
- * Populates a namespace context
- */
+ /** Populates a namespace context */
private void populateNamespaceContext() {
//first add the current element namespace to the namespace context
@@ -743,26 +721,26 @@
Object attribName = attributes[i];
if (attribName == null) {
//this should be the OMAttrib case!
- OMAttribute OMAttrib = (OMAttribute) attributes[i + 1];
+ OMAttribute OMAttrib = (OMAttribute)attributes[i + 1];
OMNamespace namespace = OMAttrib.getNamespace();
if (namespace != null) {
addToNsMap(namespace.getPrefix(),
- namespace.getNamespaceURI());
+ namespace.getNamespaceURI());
}
} else if (attribName instanceof OMAttribKey) {
//this is definitely the OMAttribute case
- OMAttribute OMAttrib = (OMAttribute) attributes[i + 1];
+ OMAttribute OMAttrib = (OMAttribute)attributes[i + 1];
OMNamespace namespace = OMAttrib.getNamespace();
if (namespace != null) {
addToNsMap(namespace.getPrefix(),
- namespace.getNamespaceURI());
+ namespace.getNamespaceURI());
}
} else if (attribName instanceof String) {
//ignore this case - Nothing to do
} else if (attribName instanceof QName) {
- QName attribQName = ((QName) attribName);
+ QName attribQName = ((QName)attribName);
addToNsMap(attribQName.getPrefix(),
- attribQName.getNamespaceURI());
+ attribQName.getNamespaceURI());
}
}
@@ -783,8 +761,8 @@
}
/**
- * By far this should be the most important method in this class
- * this method changes the state of the parser
+ * By far this should be the most important method in this class this method changes the state
+ * of the parser
*/
public int next() throws XMLStreamException {
int returnEvent = -1; //invalid state is the default state
@@ -860,10 +838,10 @@
if (ELEMENT_TEXT.equals(propPointer)) {
textFound = true;
} else {
- propertyQName = new QName((String) propPointer);
+ propertyQName = new QName((String)propPointer);
}
} else if (propPointer instanceof QName) {
- propertyQName = (QName) propPointer;
+ propertyQName = (QName)propPointer;
} else if (propPointer instanceof OMElementKey) {
// ah - in this case there's nothing to be done
//about the propertyQName in this case - we'll just leave
@@ -894,7 +872,7 @@
//we've a special pullparser for a datahandler!
} else if (propertyValue instanceof DataHandler) {
childReader = new ADBDataHandlerStreamReader(propertyQName,
- (DataHandler) propertyValue);
+ (DataHandler)propertyValue);
childReader.addNamespaceContext(this.namespaceContext);
childReader.init();
@@ -902,32 +880,32 @@
//strings are handled by the NameValuePairStreamReader
childReader =
new NameValuePairStreamReader(propertyQName,
- (String) propertyValue);
+ (String)propertyValue);
childReader.addNamespaceContext(this.namespaceContext);
childReader.init();
} else if (propertyValue instanceof String[]) {
//string[] are handled by the NameValueArrayStreamReader
//if the array is empty - skip it
- if (((String[]) propertyValue).length == 0) {
+ if (((String[])propertyValue).length == 0) {
//advance the index
currentPropertyIndex = currentPropertyIndex + 2;
return processProperties();
} else {
childReader =
new NameValueArrayStreamReader(propertyQName,
- (String[]) propertyValue);
+ (String[])propertyValue);
childReader.addNamespaceContext(this.namespaceContext);
childReader.init();
}
} else if (propertyValue instanceof ADBBean) {
//ADBbean has it's own method to get a reader
- XMLStreamReader reader = ((ADBBean) propertyValue).
+ XMLStreamReader reader = ((ADBBean)propertyValue).
getPullParser(propertyQName);
// we know for sure that this is an ADB XMLStreamreader.
// However we need to make sure that it is compatible
if (reader instanceof ADBXMLStreamReader) {
- childReader = (ADBXMLStreamReader) reader;
+ childReader = (ADBXMLStreamReader)reader;
childReader.addNamespaceContext(this.namespaceContext);
childReader.init();
} else {
@@ -939,7 +917,7 @@
//OMElements do not provide the kind of parser we need
//there is no other option than wrapping
childReader = new WrappingXMLStreamReader(
- ((OMElement) propertyValue).getXMLStreamReader());
+ ((OMElement)propertyValue).getXMLStreamReader());
//we cannot register the namespace context here!!
} else {
@@ -947,7 +925,7 @@
//the thing as a bean and try generating events from it
childReader = new WrappingXMLStreamReader
(BeanUtil.getPullParser(propertyValue,
- propertyQName, typeTable, qualified));
+ propertyQName, typeTable, qualified));
//we cannot register the namespace context here
}
@@ -959,9 +937,7 @@
return childReader.getEventType();
}
- /**
- * are we done ?
- */
+ /** are we done ? */
public boolean isDone() {
return (state == END_ELEMENT_STATE);
}
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NameValueArrayStreamReader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NameValueArrayStreamReader.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NameValueArrayStreamReader.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NameValueArrayStreamReader.java Thu Mar 29 11:49:12 2007
@@ -1,10 +1,9 @@
package org.apache.axis2.databinding.utils.reader;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.Location;
-import javax.xml.namespace.QName;
import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.Location;
+import javax.xml.stream.XMLStreamException;
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
@@ -29,7 +28,8 @@
private static final int FINAL_END_ELEMENT_STATE = 3;
private static final int START_ELEMENT_STATE_WITH_NULL = 4;
- private static final QName NIL_QNAME = new QName("http://www.w3.org/2001/XMLSchema-instance", "nil", "xsi");
+ private static final QName NIL_QNAME =
+ new QName("http://www.w3.org/2001/XMLSchema-instance", "nil", "xsi");
private static final String NIL_VALUE_TRUE = "true";
@@ -62,16 +62,14 @@
return null;
}
- /**
- * @throws XMLStreamException
- */
+ /** @throws XMLStreamException */
public int next() throws XMLStreamException {
switch (state) {
case START_ELEMENT_STATE:
- if (values.length>0){
+ if (values.length > 0) {
state = TEXT_STATE;
return CHARACTERS;
- }else{
+ } else {
state = FINAL_END_ELEMENT_STATE;
return END_ELEMENT;
}
@@ -155,7 +153,7 @@
}
public String getAttributeNamespace(int i) {
- if (state == START_ELEMENT_STATE_WITH_NULL && i == 0)
+ if (state == START_ELEMENT_STATE_WITH_NULL && i == 0)
return NIL_QNAME.getNamespaceURI();
if (state == START_ELEMENT_STATE) {
return null;
@@ -212,7 +210,7 @@
public String getNamespacePrefix(int i) {
if (state == START_ELEMENT_STATE_WITH_NULL
- && isXsiNamespacePresent() && i==0)
+ && isXsiNamespacePresent() && i == 0)
return NIL_QNAME.getPrefix();
else
return null;
@@ -220,7 +218,7 @@
public String getNamespaceURI(int i) {
if (state == START_ELEMENT_STATE_WITH_NULL
- && isXsiNamespacePresent() && i==0)
+ && isXsiNamespacePresent() && i == 0)
return NIL_QNAME.getNamespaceURI();
else
return null;
@@ -404,9 +402,7 @@
}
}
- /**
- * Test whether the xsi namespace is present
- */
+ /** Test whether the xsi namespace is present */
private boolean isXsiNamespacePresent() {
return (namespaceContext.getNamespaceURI(NIL_QNAME.getPrefix()) != null);
}
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NameValuePairStreamReader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NameValuePairStreamReader.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NameValuePairStreamReader.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NameValuePairStreamReader.java Thu Mar 29 11:49:12 2007
@@ -1,9 +1,9 @@
package org.apache.axis2.databinding.utils.reader;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.Location;
-import javax.xml.namespace.QName;
import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.Location;
+import javax.xml.stream.XMLStreamException;
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
@@ -47,15 +47,15 @@
public Object getProperty(String key) throws IllegalArgumentException {
//since optimization is a global property
//we've to implement it everywhere
- if (OPTIMIZATION_ENABLED.equals(key)){
+ if (OPTIMIZATION_ENABLED.equals(key)) {
return Boolean.TRUE;
- }else if (state==TEXT_STATE){
- if (IS_BINARY.equals(key)){
+ } else if (state == TEXT_STATE) {
+ if (IS_BINARY.equals(key)) {
return Boolean.FALSE;
- }else{
+ } else {
return null;
}
- }else{
+ } else {
return null;
}
}
@@ -63,9 +63,9 @@
public int next() throws XMLStreamException {
//no need to handle null here. it should have been handled
//already
- switch (state){
+ switch (state) {
case START_ELEMENT_STATE:
- state=TEXT_STATE;
+ state = TEXT_STATE;
return CHARACTERS;
case END_ELEMENT_STATE:
//oops, not supposed to happen!
@@ -83,11 +83,11 @@
}
public String getElementText() throws XMLStreamException {
- if (state==START_ELEMENT){
+ if (state == START_ELEMENT) {
//move to the end state and return the value
state = END_ELEMENT_STATE;
return value;
- }else{
+ } else {
throw new XMLStreamException();
}
@@ -98,7 +98,7 @@
}
public boolean hasNext() throws XMLStreamException {
- return (state!=END_ELEMENT_STATE);
+ return (state != END_ELEMENT_STATE);
}
public void close() throws XMLStreamException {
@@ -110,15 +110,15 @@
}
public boolean isStartElement() {
- return (state==START_ELEMENT_STATE);
+ return (state == START_ELEMENT_STATE);
}
public boolean isEndElement() {
- return (state==END_ELEMENT_STATE);
+ return (state == END_ELEMENT_STATE);
}
public boolean isCharacters() {
- return (state==TEXT_STATE);
+ return (state == TEXT_STATE);
}
public boolean isWhiteSpace() {
@@ -162,15 +162,15 @@
}
public int getNamespaceCount() {
- return (nsDeclared)?1:0;
+ return (nsDeclared) ? 1 : 0;
}
public String getNamespacePrefix(int i) {
- return (nsDeclared && i==0)?name.getPrefix():null;
+ return (nsDeclared && i == 0) ? name.getPrefix() : null;
}
public String getNamespaceURI(int i) {
- return (nsDeclared && i==0)?name.getNamespaceURI():null;
+ return (nsDeclared && i == 0) ? name.getNamespaceURI() : null;
}
public NamespaceContext getNamespaceContext() {
@@ -178,7 +178,7 @@
}
public int getEventType() {
- switch (state){
+ switch (state) {
case START_ELEMENT_STATE:
return START_ELEMENT;
case END_ELEMENT_STATE:
@@ -193,17 +193,17 @@
}
public String getText() {
- if (state==TEXT_STATE){
+ if (state == TEXT_STATE) {
return value;
- }else{
+ } else {
throw new IllegalStateException();
}
}
public char[] getTextCharacters() {
- if (state==TEXT_STATE){
+ if (state == TEXT_STATE) {
return value.toCharArray();
- }else{
+ } else {
throw new IllegalStateException();
}
}
@@ -214,18 +214,18 @@
}
public int getTextStart() {
- if (state==TEXT_STATE){
+ if (state == TEXT_STATE) {
return 0;
- }else{
+ } else {
throw new IllegalStateException();
}
}
public int getTextLength() {
- if (state==TEXT_STATE){
+ if (state == TEXT_STATE) {
return value.length();
- }else{
- throw new IllegalStateException();
+ } else {
+ throw new IllegalStateException();
}
}
@@ -235,11 +235,11 @@
}
public boolean hasText() {
- return (state==TEXT_STATE);
+ return (state == TEXT_STATE);
}
public Location getLocation() {
- return new Location(){
+ return new Location() {
public int getLineNumber() {
return 0;
}
@@ -263,17 +263,17 @@
}
public QName getName() {
- if (state!=TEXT_STATE){
+ if (state != TEXT_STATE) {
return name;
- }else{
+ } else {
return null;
}
}
public String getLocalName() {
- if (state!=TEXT_STATE){
+ if (state != TEXT_STATE) {
return name.getLocalPart();
- }else{
+ } else {
return null;
}
}
@@ -284,18 +284,18 @@
}
public String getNamespaceURI() {
- if (state!=TEXT_STATE){
+ if (state != TEXT_STATE) {
return name.getNamespaceURI();
- }else{
+ } else {
return null;
}
}
public String getPrefix() {
- if (state!=TEXT_STATE){
+ if (state != TEXT_STATE) {
return name.getPrefix();
- }else{
+ } else {
return null;
}
}
@@ -325,7 +325,7 @@
}
public boolean isDone() {
- return (state==END_ELEMENT_STATE);
+ return (state == END_ELEMENT_STATE);
}
public void addNamespaceContext(NamespaceContext nsContext) {
@@ -335,10 +335,11 @@
public void init() {
//just add the current elements namespace and prefix to the this
//elements nscontext
- addToNsMap(name.getPrefix(),name.getNamespaceURI());
+ addToNsMap(name.getPrefix(), name.getNamespaceURI());
}
+
/**
* @param prefix
* @param uri
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NullXMLStreamReader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NullXMLStreamReader.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NullXMLStreamReader.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/NullXMLStreamReader.java Thu Mar 29 11:49:12 2007
@@ -4,7 +4,6 @@
import javax.xml.namespace.QName;
import javax.xml.stream.Location;
import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
@@ -30,8 +29,9 @@
private static final int END_ELEMENT_STATE = 2;
- private static final QName NIL_QNAME = new QName("http://www.w3.org/2001/XMLSchema-instance","nil","xsi");
- private static final String NIL_VALUE_TRUE ="true";
+ private static final QName NIL_QNAME =
+ new QName("http://www.w3.org/2001/XMLSchema-instance", "nil", "xsi");
+ private static final String NIL_VALUE_TRUE = "true";
private int currentState = START_ELEMENT;
@@ -40,24 +40,24 @@
}
public Object getProperty(String key) throws IllegalArgumentException {
- //since optimization is a global property
+ //since optimization is a global property
//we've to implement it everywhere
- if (OPTIMIZATION_ENABLED.equals(key)){
- return Boolean.TRUE;
- }else{
- return null;
- }
+ if (OPTIMIZATION_ENABLED.equals(key)) {
+ return Boolean.TRUE;
+ } else {
+ return null;
+ }
}
public int next() throws XMLStreamException {
int returnEvent = START_DOCUMENT;
- switch(currentState){
+ switch (currentState) {
case START_ELEMENT_STATE:
currentState = END_ELEMENT_STATE;
- returnEvent = END_ELEMENT;
+ returnEvent = END_ELEMENT;
break;
case END_ELEMENT_STATE:
- throw new XMLStreamException("parser completed!");
+ throw new XMLStreamException("parser completed!");
}
@@ -77,7 +77,7 @@
}
public boolean hasNext() throws XMLStreamException {
- return (currentState!=END_ELEMENT_STATE);
+ return (currentState != END_ELEMENT_STATE);
}
@@ -86,20 +86,20 @@
}
public String getNamespaceURI(String string) {
- if (outerQName.getPrefix()!=null &&
- outerQName.getPrefix().equals(string)){
+ if (outerQName.getPrefix() != null &&
+ outerQName.getPrefix().equals(string)) {
return outerQName.getNamespaceURI();
- }else{
+ } else {
return null;
}
}
public boolean isStartElement() {
- return (currentState==START_ELEMENT_STATE);
+ return (currentState == START_ELEMENT_STATE);
}
public boolean isEndElement() {
- return (currentState==END_ELEMENT_STATE);
+ return (currentState == END_ELEMENT_STATE);
}
public boolean isCharacters() {
@@ -111,8 +111,8 @@
}
public String getAttributeValue(String string, String string1) {
- if (string== null){//null namespace - ignore it
- if (NIL_QNAME.getLocalPart().equals(string1)){
+ if (string == null) {//null namespace - ignore it
+ if (NIL_QNAME.getLocalPart().equals(string1)) {
return NIL_VALUE_TRUE;
}
}
@@ -124,19 +124,19 @@
}
public QName getAttributeName(int i) {
- return (i==0)? NIL_QNAME:null;
+ return (i == 0) ? NIL_QNAME : null;
}
public String getAttributeNamespace(int i) {
- return (i==0)? NIL_QNAME.getNamespaceURI():null;
+ return (i == 0) ? NIL_QNAME.getNamespaceURI() : null;
}
public String getAttributeLocalName(int i) {
- return (i==0)? NIL_QNAME.getLocalPart():null;
+ return (i == 0) ? NIL_QNAME.getLocalPart() : null;
}
public String getAttributePrefix(int i) {
- return (i==0)? NIL_QNAME.getPrefix():null;
+ return (i == 0) ? NIL_QNAME.getPrefix() : null;
}
public String getAttributeType(int i) {
@@ -144,7 +144,7 @@
}
public String getAttributeValue(int i) {
- return (i==0)? NIL_VALUE_TRUE:null;
+ return (i == 0) ? NIL_VALUE_TRUE : null;
}
public boolean isAttributeSpecified(int i) {
@@ -169,16 +169,16 @@
public int getEventType() {
int returnEvent = START_DOCUMENT;
- switch(currentState){
+ switch (currentState) {
case START_ELEMENT_STATE:
- returnEvent = START_ELEMENT;
+ returnEvent = START_ELEMENT;
break;
case END_ELEMENT_STATE:
- returnEvent = END_ELEMENT;
+ returnEvent = END_ELEMENT;
break;
}
- return returnEvent;
+ return returnEvent;
}
public String getText() {
@@ -210,7 +210,7 @@
}
public Location getLocation() {
- return new Location(){
+ return new Location() {
public int getLineNumber() {
return 0;
}
@@ -278,7 +278,7 @@
}
public boolean isDone() {
- return (currentState==END_ELEMENT_STATE);
+ return (currentState == END_ELEMENT_STATE);
}
public void addNamespaceContext(NamespaceContext nsContext) {
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/OMAttribKey.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/OMAttribKey.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/OMAttribKey.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/OMAttribKey.java Thu Mar 29 11:49:12 2007
@@ -16,9 +16,8 @@
*/
/**
- * A dummy object that acts as the key for the OMAttribute in the
- * attribute array - this will be provided as part of the constants
- *
+ * A dummy object that acts as the key for the OMAttribute in the attribute array - this will be
+ * provided as part of the constants
*/
public class OMAttribKey {
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/OMElementKey.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/OMElementKey.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/OMElementKey.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/OMElementKey.java Thu Mar 29 11:49:12 2007
@@ -16,8 +16,8 @@
*/
/**
- * A dummy class that creates nothing but a key for the
- * OMElement when it is passed to the ADBPullparser
+ * A dummy class that creates nothing but a key for the OMElement when it is passed to the
+ * ADBPullparser
*/
public class OMElementKey {
}
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/WrappingXMLStreamReader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/WrappingXMLStreamReader.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/WrappingXMLStreamReader.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/reader/WrappingXMLStreamReader.java Thu Mar 29 11:49:12 2007
@@ -1,10 +1,10 @@
package org.apache.axis2.databinding.utils.reader;
-import javax.xml.stream.XMLStreamException;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
import javax.xml.stream.Location;
+import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
-import javax.xml.namespace.QName;
-import javax.xml.namespace.NamespaceContext;
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
@@ -21,7 +21,7 @@
* limitations under the License.
*/
-public class WrappingXMLStreamReader implements ADBXMLStreamReader{
+public class WrappingXMLStreamReader implements ADBXMLStreamReader {
private XMLStreamReader reader;
@@ -33,7 +33,7 @@
try {
return !hasNext();
} catch (XMLStreamException e) {
- throw new RuntimeException(e);
+ throw new RuntimeException(e);
}
}
@@ -42,7 +42,7 @@
}
public int next() throws XMLStreamException {
- return reader.next();
+ return reader.next();
}
public void require(int i, String string, String string1) throws XMLStreamException {
@@ -50,7 +50,7 @@
}
public String getElementText() throws XMLStreamException {
- return reader.getElementText();
+ return reader.getElementText();
}
public int nextTag() throws XMLStreamException {
@@ -62,7 +62,7 @@
}
public void close() throws XMLStreamException {
- reader.close();
+ reader.close();
}
public String getNamespaceURI(String string) {
@@ -70,7 +70,7 @@
}
public boolean isStartElement() {
- return reader.isStartElement();
+ return reader.isStartElement();
}
public boolean isEndElement() {
@@ -78,7 +78,7 @@
}
public boolean isCharacters() {
- return reader.isCharacters();
+ return reader.isCharacters();
}
public boolean isWhiteSpace() {
@@ -86,7 +86,7 @@
}
public String getAttributeValue(String string, String string1) {
- return reader.getAttributeValue(string,string1);
+ return reader.getAttributeValue(string, string1);
}
public int getAttributeCount() {
@@ -98,7 +98,7 @@
}
public String getAttributeNamespace(int i) {
- return reader.getAttributeNamespace(i);
+ return reader.getAttributeNamespace(i);
}
public String getAttributeLocalName(int i) {
@@ -106,7 +106,7 @@
}
public String getAttributePrefix(int i) {
- return reader.getAttributeLocalName(i);
+ return reader.getAttributeLocalName(i);
}
public String getAttributeType(int i) {
@@ -126,11 +126,11 @@
}
public String getNamespacePrefix(int i) {
- return reader.getNamespacePrefix(i);
+ return reader.getNamespacePrefix(i);
}
public String getNamespaceURI(int i) {
- return reader.getNamespaceURI(i);
+ return reader.getNamespaceURI(i);
}
public NamespaceContext getNamespaceContext() {
@@ -138,7 +138,7 @@
}
public int getEventType() {
- return reader.getEventType();
+ return reader.getEventType();
}
public String getText() {
@@ -146,11 +146,11 @@
}
public char[] getTextCharacters() {
- return reader.getTextCharacters();
+ return reader.getTextCharacters();
}
public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException {
- return reader.getTextCharacters(i,chars,i1,i2);
+ return reader.getTextCharacters(i, chars, i1, i2);
}
public int getTextStart() {
@@ -174,7 +174,7 @@
}
public QName getName() {
- return reader.getName();
+ return reader.getName();
}
public String getLocalName() {
@@ -182,15 +182,15 @@
}
public boolean hasName() {
- return reader.hasName();
+ return reader.hasName();
}
public String getNamespaceURI() {
- return reader.getNamespaceURI();
+ return reader.getNamespaceURI();
}
public String getPrefix() {
- return reader.getPrefix();
+ return reader.getPrefix();
}
public String getVersion() {
@@ -202,7 +202,7 @@
}
public boolean standaloneSet() {
- return reader.standaloneSet();
+ return reader.standaloneSet();
}
public String getCharacterEncodingScheme() {
@@ -210,7 +210,7 @@
}
public String getPITarget() {
- return reader.getPITarget();
+ return reader.getPITarget();
}
public String getPIData() {
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/client/RPCServiceClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/client/RPCServiceClient.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/client/RPCServiceClient.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/client/RPCServiceClient.java Thu Mar 29 11:49:12 2007
@@ -33,7 +33,8 @@
private boolean notNullService;
- public RPCServiceClient(ConfigurationContext configContext, AxisService service) throws AxisFault {
+ public RPCServiceClient(ConfigurationContext configContext, AxisService service)
+ throws AxisFault {
super(configContext, service);
if (service != null) {
notNullService = true;
@@ -54,16 +55,16 @@
/**
* Return value can be a single a object or an object array (itself an object) , but it is
* difficulty to figure the return object correctly unless we have TyepMapping in the client
- * side too. Until it is finalized lets return OMElement as return value. And the retuen
- * value will be the body first element user has to deal with that and create
- * his own object out of that.
+ * side too. Until it is finalized lets return OMElement as return value. And the retuen value
+ * will be the body first element user has to deal with that and create his own object out of
+ * that.
*
* @param opName Operation QName (to get the body wrapper element)
* @param args Arraylist of objects
* @return Response OMElement
*/
public OMElement invokeBlocking(QName opName, Object [] args) throws AxisFault {
- OMElement omElement = BeanUtil.getOMElement(opName, args, null, false, null );
+ OMElement omElement = BeanUtil.getOMElement(opName, args, null, false, null);
if (notNullService) {
return super.sendReceive(opName, omElement);
}
@@ -73,21 +74,22 @@
/**
* @param opName Operation QName (to get the body wrapper element)
* @param args Arraylist of objects
- * @param returnTypes , this array contains the JavaTypes for the return object , it could be one
- * or more depending on the return type , most of the type array will contain just one element
- * It should be noted that the array should only contains JavaTypes NOT real object , what this
- * methods does is , get the body first element , and if it contains more than one childern take
- * ith element and convert that to ith javatype and fill the return arrya
- * the array will look like as follows
- * [Integer, String, MyBean , etc]
- * @return Object array , whic will contains real object , but the object can either be simple type
- * object or the JavaBeans, thats what this method can handle right now
- * the return array will contains [10, "Axis2Echo", {"foo","baa","11"}]
+ * @param returnTypes , this array contains the JavaTypes for the return object , it could be
+ * one or more depending on the return type , most of the type array will
+ * contain just one element It should be noted that the array should only
+ * contains JavaTypes NOT real object , what this methods does is , get the
+ * body first element , and if it contains more than one childern take ith
+ * element and convert that to ith javatype and fill the return arrya the
+ * array will look like as follows [Integer, String, MyBean , etc]
+ * @return Object array , whic will contains real object , but the object can either be simple
+ * type object or the JavaBeans, thats what this method can handle right now the return
+ * array will contains [10, "Axis2Echo", {"foo","baa","11"}]
* @throws AxisFault
*/
- public Object[] invokeBlocking(QName opName, Object [] args, Class [] returnTypes) throws AxisFault {
- OMElement omElement = BeanUtil.getOMElement(opName, args, null, false, null );
+ public Object[] invokeBlocking(QName opName, Object [] args, Class [] returnTypes)
+ throws AxisFault {
+ OMElement omElement = BeanUtil.getOMElement(opName, args, null, false, null);
OMElement response;
if (notNullService) {
response = super.sendReceive(opName, omElement);
@@ -95,15 +97,14 @@
response = super.sendReceive(omElement);
}
return BeanUtil.deserialize(response, returnTypes,
- new DefaultObjectSupplier());
+ new DefaultObjectSupplier());
}
/**
* Invoke the nonblocking/Asynchronous call
*
* @param opName
- * @param args - This should be OM Element (payload)
- * invocation behaves accordingly
+ * @param args - This should be OM Element (payload) invocation behaves accordingly
* @param callback
* @throws org.apache.axis2.AxisFault
*/
@@ -112,7 +113,7 @@
Object [] args,
Callback callback)
throws AxisFault {
- OMElement omElement = BeanUtil.getOMElement(opName, args, null, false, null );
+ OMElement omElement = BeanUtil.getOMElement(opName, args, null, false, null);
//call the underline implementation
if (notNullService) {
super.sendReceiveNonBlocking(opName, omElement, callback);
@@ -123,7 +124,7 @@
public void invokeRobust(QName opName,
Object [] args) throws AxisFault {
- OMElement omElement = BeanUtil.getOMElement(opName, args, null, false, null );
+ OMElement omElement = BeanUtil.getOMElement(opName, args, null, false, null);
//call the underline implementation
if (notNullService) {
super.sendRobust(opName, omElement);
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCInOnlyMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCInOnlyMessageReceiver.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCInOnlyMessageReceiver.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCInOnlyMessageReceiver.java Thu Mar 29 11:49:12 2007
@@ -75,12 +75,14 @@
methodElement.getNamespace().getNamespaceURI());
}
} else if (namespace != null) {
- throw new AxisFault("namespace mismatch. Axis Oepration expects non-namespace " +
- "qualified element. But received a namespace qualified element");
+ throw new AxisFault(
+ "namespace mismatch. Axis Oepration expects non-namespace " +
+ "qualified element. But received a namespace qualified element");
}
Object[] objectArray = RPCUtil.processRequest(methodElement, method,
- inMessage.getAxisService().getObjectSupplier());
+ inMessage
+ .getAxisService().getObjectSupplier());
method.invoke(obj, objectArray);
}
@@ -94,11 +96,11 @@
msg = cause.getMessage();
if (msg == null) {
msg = "Exception occurred while trying to invoke service method " +
- method.getName();
+ method.getName();
}
log.error(msg, e);
if (cause instanceof AxisFault) {
- throw (AxisFault) cause;
+ throw (AxisFault)cause;
}
}
throw new AxisFault(msg);
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCInOutAsyncMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCInOutAsyncMessageReceiver.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCInOutAsyncMessageReceiver.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCInOutAsyncMessageReceiver.java Thu Mar 29 11:49:12 2007
@@ -39,15 +39,10 @@
private static Log log = LogFactory.getLog(RPCInOnlyMessageReceiver.class);
/**
- * reflect and get the Java method
- * - for each i'th param in the java method
- * - get the first child's i'th child
- * -if the elem has an xsi:type attr then find the deserializer for it
- * - if not found,
- * lookup deser for th i'th param (java type)
- * - error if not found
- * - deserialize & save in an object array
- * - end for
+ * reflect and get the Java method - for each i'th param in the java method - get the first
+ * child's i'th child -if the elem has an xsi:type attr then find the deserializer for it - if
+ * not found, lookup deser for th i'th param (java type) - error if not found - deserialize &
+ * save in an object array - end for
* <p/>
* - invoke method and get the return value
* <p/>
@@ -60,7 +55,8 @@
* @throws AxisFault
*/
- public void invokeBusinessLogic(MessageContext inMessage, MessageContext outMessage) throws AxisFault {
+ public void invokeBusinessLogic(MessageContext inMessage, MessageContext outMessage)
+ throws AxisFault {
try {
// get the implementation class for the Web Service
Object obj = getTheImplementationObject(inMessage);
@@ -93,18 +89,21 @@
messageNameSpace = elementQName.getNamespaceURI();
OMNamespace namespace = methodElement.getNamespace();
if (messageNameSpace != null) {
- if (namespace == null || !messageNameSpace.equals(namespace.getNamespaceURI())) {
+ if (namespace == null ||
+ !messageNameSpace.equals(namespace.getNamespaceURI())) {
throw new AxisFault("namespace mismatch require " +
messageNameSpace +
" found " + methodElement.getNamespace().getNamespaceURI());
}
} else if (namespace != null) {
- throw new AxisFault("namespace mismatch. Axis Oepration expects non-namespace " +
- "qualified element. But received a namespace qualified element");
+ throw new AxisFault(
+ "namespace mismatch. Axis Oepration expects non-namespace " +
+ "qualified element. But received a namespace qualified element");
}
Object[] objectArray = RPCUtil.processRequest(methodElement,
- method, inMessage.getAxisService().getObjectSupplier());
+ method, inMessage
+ .getAxisService().getObjectSupplier());
resObject = method.invoke(obj, objectArray);
}
@@ -121,11 +120,11 @@
}
OMNamespace ns = fac.createOMNamespace(messageNameSpace,
- service.getSchematargetNamespacePrefix());
+ service.getSchematargetNamespacePrefix());
SOAPEnvelope envelope = fac.getDefaultEnvelope();
OMElement bodyContent = null;
RPCUtil.processResponse(resObject, service,
- method, envelope, fac, ns, bodyContent, outMessage);
+ method, envelope, fac, ns, bodyContent, outMessage);
} catch (InvocationTargetException e) {
String msg = null;
Throwable cause = e.getCause();
@@ -134,11 +133,11 @@
}
if (msg == null) {
msg = "Exception occurred while trying to invoke service method " +
- method.getName();
+ method.getName();
}
log.error(msg, e);
if (cause instanceof AxisFault) {
- throw (AxisFault) cause;
+ throw (AxisFault)cause;
}
throw new AxisFault(msg);
} catch (Exception e) {
Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java?view=diff&rev=523794&r1=523793&r2=523794
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java Thu Mar 29 11:49:12 2007
@@ -45,15 +45,10 @@
private static Log log = LogFactory.getLog(RPCMessageReceiver.class);
/**
- * reflect and get the Java method
- * - for each i'th param in the java method
- * - get the first child's i'th child
- * -if the elem has an xsi:type attr then find the deserializer for it
- * - if not found,
- * lookup deser for th i'th param (java type)
- * - error if not found
- * - deserialize & save in an object array
- * - end for
+ * reflect and get the Java method - for each i'th param in the java method - get the first
+ * child's i'th child -if the elem has an xsi:type attr then find the deserializer for it - if
+ * not found, lookup deser for th i'th param (java type) - error if not found - deserialize &
+ * save in an object array - end for
* <p/>
* - invoke method and get the return value
* <p/>
@@ -66,7 +61,8 @@
* @throws AxisFault
*/
- public void invokeBusinessLogic(MessageContext inMessage, MessageContext outMessage) throws AxisFault {
+ public void invokeBusinessLogic(MessageContext inMessage, MessageContext outMessage)
+ throws AxisFault {
try {
// get the implementation class for the Web Service
Object obj = getTheImplementationObject(inMessage);
@@ -109,12 +105,14 @@
" found " + methodElement.getNamespace().getNamespaceURI());
}
} else if (namespace != null) {
- throw new AxisFault("namespace mismatch. Axis Oepration expects non-namespace " +
- "qualified element. But received a namespace qualified element");
+ throw new AxisFault(
+ "namespace mismatch. Axis Oepration expects non-namespace " +
+ "qualified element. But received a namespace qualified element");
}
Object[] objectArray = RPCUtil.processRequest(methodElement, method,
- inMessage.getAxisService().getObjectSupplier());
+ inMessage
+ .getAxisService().getObjectSupplier());
resObject = method.invoke(obj, objectArray);
}
@@ -130,12 +128,12 @@
}
OMNamespace ns = fac.createOMNamespace(messageNameSpace,
- service.getSchematargetNamespacePrefix());
+ service.getSchematargetNamespacePrefix());
SOAPEnvelope envelope = fac.getDefaultEnvelope();
OMElement bodyContent = null;
RPCUtil.processResponse(resObject, service,
- method, envelope, fac, ns,
- bodyContent, outMessage);
+ method, envelope, fac, ns,
+ bodyContent, outMessage);
outMessage.setEnvelope(envelope);
} catch (InvocationTargetException e) {
String msg = null;
@@ -149,7 +147,7 @@
}
log.error(msg, e);
if (cause instanceof AxisFault) {
- throw (AxisFault) cause;
+ throw (AxisFault)cause;
}
throw new AxisFault(msg);
} catch (Exception e) {
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org