Return-Path: Delivered-To: apmail-xml-axis-dev-archive@xml.apache.org Received: (qmail 18873 invoked by uid 500); 6 Nov 2001 22:03:47 -0000 Mailing-List: contact axis-dev-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@xml.apache.org Received: (qmail 18864 invoked by uid 500); 6 Nov 2001 22:03:47 -0000 Delivered-To: apmail-xml-axis-cvs@apache.org Date: 6 Nov 2001 21:52:29 -0000 Message-ID: <20011106215229.83362.qmail@icarus.apache.org> From: butek@apache.org To: xml-axis-cvs@apache.org Subject: cvs commit: xml-axis/java/src/org/apache/axis/encoding VectorDeserializer.java TypeMappingRegistry.java SOAPTypeMappingRegistry.java SerializationContext.java MapSerializer.java Hex.java ElementSerializer.java DeserializationContext.java DateSerializer.java BooleanDeserializerFactory.java BeanSerializer.java Base64.java ArraySerializer.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N butek 01/11/06 13:52:29 Modified: java/src/org/apache/axis/encoding VectorDeserializer.java TypeMappingRegistry.java SOAPTypeMappingRegistry.java SerializationContext.java MapSerializer.java Hex.java ElementSerializer.java DeserializationContext.java DateSerializer.java BooleanDeserializerFactory.java BeanSerializer.java Base64.java ArraySerializer.java Log: Internationalized org.apache.axis.encoding package. Revision Changes Path 1.9 +9 -8 xml-axis/java/src/org/apache/axis/encoding/VectorDeserializer.java Index: VectorDeserializer.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/VectorDeserializer.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- VectorDeserializer.java 2001/10/30 14:19:29 1.8 +++ VectorDeserializer.java 2001/11/06 21:52:28 1.9 @@ -57,6 +57,7 @@ import org.apache.axis.Constants; import org.apache.axis.message.SOAPHandler; +import org.apache.axis.utils.JavaUtils; import org.apache.log4j.Category; import org.xml.sax.Attributes; import org.xml.sax.SAXException; @@ -89,7 +90,7 @@ DeserializationContext context) throws SAXException { if (category.isDebugEnabled()) { - category.debug("In VectorDeserializer.startElement()"); + category.debug(JavaUtils.getMessage("enter00", "VectorDeserializer.startElement()")); } if (attributes.getValue(Constants.URI_CURRENT_SCHEMA_XSI, "nil") != null) { @@ -99,7 +100,7 @@ this.value = new java.util.Vector(); if (category.isDebugEnabled()) { - category.debug("Out VectorDeserializer.startElement()"); + category.debug(JavaUtils.getMessage("exit00", "VectorDeserializer.startElement()")); } } @@ -110,29 +111,29 @@ DeserializationContext context) throws SAXException { if (category.isDebugEnabled()) { - category.debug("In VectorDeserializer.onStartChild()"); + category.debug(JavaUtils.getMessage("enter00", "VectorDeserializer.onStartChild()")); } if (attributes == null) - throw new SAXException("No type attribute for vector!"); + throw new SAXException(JavaUtils.getMessage("noType01")); String type = null; for (int i=0; i'" + uri + "'"); + category.debug(JavaUtils.getMessage("startPrefix00", prefix, uri)); } SOAPHandler handler = getTopHandler(); @@ -517,7 +518,7 @@ throws SAXException { if (category.isDebugEnabled()) { - category.debug("EndPrefixMapping '" + prefix + "'"); + category.debug(JavaUtils.getMessage("endPrefix00", prefix)); } if (recorder != null) @@ -552,7 +553,7 @@ public void processingInstruction(String p1, String p2) throws SAXException { // must throw an error since SOAP 1.1 doesn't allow // processing instructions anywhere in the message - throw new SAXException("Processing instructions are not allowed within SOAP Messages"); + throw new SAXException(JavaUtils.getMessage("noInstructions00")); } public void skippedEntity(String p1) throws SAXException { @@ -576,8 +577,8 @@ SOAPHandler nextHandler = null; if (category.isDebugEnabled()) { - category.debug("startElement ['" + namespace + "' " + - localName + "]"); + category.debug(JavaUtils.getMessage("startElem00", + "['" + namespace + "' " + localName + "]")); } String prefix = ""; @@ -618,8 +619,8 @@ throws SAXException { if (category.isDebugEnabled()) { - category.debug("endElement ['" + namespace + "' " + - localName + "]"); + category.debug(JavaUtils.getMessage("endElem00", + "['" + namespace + "' " + localName + "]")); } if (recorder != null) @@ -634,7 +635,7 @@ } else { // We should be done! if (category.isDebugEnabled()) { - category.debug("Done with document!"); + category.debug(JavaUtils.getMessage("endDoc01")); } } 1.18 +12 -5 xml-axis/java/src/org/apache/axis/encoding/DateSerializer.java Index: DateSerializer.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/DateSerializer.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- DateSerializer.java 2001/10/30 16:46:37 1.17 +++ DateSerializer.java 2001/11/06 21:52:28 1.18 @@ -55,6 +55,8 @@ package org.apache.axis.encoding; +import org.apache.axis.utils.JavaUtils; + import org.xml.sax.Attributes; import javax.xml.rpc.namespace.QName; @@ -86,14 +88,17 @@ // validate fixed portion of format if ( source != null ) { if (source.length() < 19) - throw new NumberFormatException("invalid dateTime"); + throw new NumberFormatException( + JavaUtils.getMessage("badDateTime00")); if (source.charAt(4) != '-' || source.charAt(7) != '-' || source.charAt(10) != 'T') - throw new NumberFormatException("invalid date"); + throw new NumberFormatException( + JavaUtils.getMessage("badDate00")); if (source.charAt(13) != ':' || source.charAt(16) != ':') - throw new NumberFormatException("invalid time"); + throw new NumberFormatException( + JavaUtils.getMessage("badTime00")); } // convert what we have validated so far @@ -139,7 +144,8 @@ source.charAt(pos+3) != ':' || !Character.isDigit(source.charAt(pos+4)) || !Character.isDigit(source.charAt(pos+5))) - throw new NumberFormatException("invalid timezone"); + throw new NumberFormatException( + JavaUtils.getMessage("badTimezone00")); int hours = (source.charAt(pos+1)-'0')*10 +source.charAt(pos+2)-'0'; @@ -156,7 +162,8 @@ if (pos < source.length() && source.charAt(pos)=='Z') pos++; if (pos < source.length()) - throw new NumberFormatException("unexpected characters"); + throw new NumberFormatException( + JavaUtils.getMessage("badChars00")); } return result; 1.8 +4 -1 xml-axis/java/src/org/apache/axis/encoding/BooleanDeserializerFactory.java Index: BooleanDeserializerFactory.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/BooleanDeserializerFactory.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- BooleanDeserializerFactory.java 2001/10/30 16:46:37 1.7 +++ BooleanDeserializerFactory.java 2001/11/06 21:52:28 1.8 @@ -55,6 +55,8 @@ package org.apache.axis.encoding; +import org.apache.axis.utils.JavaUtils; + import org.xml.sax.SAXException; /** @@ -79,7 +81,8 @@ break; default: - throw new NumberFormatException("invalid boolean"); + throw new NumberFormatException( + JavaUtils.getMessage("badBool00")); } } } 1.22 +12 -11 xml-axis/java/src/org/apache/axis/encoding/BeanSerializer.java Index: BeanSerializer.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/BeanSerializer.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- BeanSerializer.java 2001/11/01 16:49:58 1.21 +++ BeanSerializer.java 2001/11/06 21:52:28 1.22 @@ -236,11 +236,12 @@ try { pd.getWriteMethod().invoke(object, new Object[] {value}); } catch (Exception ex) { - category.error("Couldn't convert " + - value.getClass().getName() + - " to bean field '" + pd.getName() + - "', type " + - pd.getPropertyType().getName()); + category.error(JavaUtils.getMessage( + "cantConvert02", + new String[] { + value.getClass().getName(), + pd.getName(), + pd.getPropertyType().getName()})); throw new SAXException(ex); } } @@ -279,14 +280,14 @@ TypeMappingRegistry tmr = context.getTypeMappingRegistry(); QName qn = tmr.getTypeQName(pd[i].getPropertyType()); if (qn == null) - throw new SAXException("Unregistered type: " + - pd[i].getPropertyType()); + throw new SAXException( + JavaUtils.getMessage("unregistered00", "" + pd[i].getPropertyType())); // get the deserializer Deserializer dSer = tmr.getDeserializer(qn); if (dSer == null) - throw new SAXException("No deserializer for " + - pd[i].getPropertyType()); + throw new SAXException( + JavaUtils.getMessage("noDeser00", "" + pd[i].getPropertyType())); // Success! Register the target and deserializer. dSer.registerValueTarget(new PropertyTarget(value, pd[i])); @@ -295,8 +296,8 @@ } // No such field - throw new SAXException("Invalid element in " + cls.getName() + - " - " + localName); + throw new SAXException( + JavaUtils.getMessage("badElem00", cls.getName(), localName)); } /** 1.7 +3 -1 xml-axis/java/src/org/apache/axis/encoding/Base64.java Index: Base64.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/Base64.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Base64.java 2001/10/30 16:46:37 1.6 +++ Base64.java 2001/11/06 21:52:28 1.7 @@ -58,6 +58,8 @@ import java.io.OutputStream; import java.io.Writer; +import org.apache.axis.utils.JavaUtils; + /** * * @author TAMURA Kent <kent@trl.ibm.co.jp> @@ -103,7 +105,7 @@ obuf[wp] = (byte)(b2 << 6 & 0xc0 | b3 & 0x3f); return 3; default: - throw new RuntimeException("Internal Errror"); + throw new RuntimeException(JavaUtils.getMessage("internalError00")); } } 1.24 +25 -27 xml-axis/java/src/org/apache/axis/encoding/ArraySerializer.java Index: ArraySerializer.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ArraySerializer.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- ArraySerializer.java 2001/10/30 14:19:29 1.23 +++ ArraySerializer.java 2001/11/06 21:52:28 1.24 @@ -56,6 +56,7 @@ import org.apache.axis.Constants; import org.apache.axis.message.SOAPHandler; +import org.apache.axis.utils.JavaUtils; import org.apache.log4j.Category; import org.xml.sax.Attributes; import org.xml.sax.SAXException; @@ -111,7 +112,7 @@ throws SAXException { if (category.isDebugEnabled()) { - category.debug("In ArraySerializer.startElement()"); + category.debug(JavaUtils.getMessage("enter00", "ArraySerializer.startElement()")); } if (attributes.getValue(Constants.URI_CURRENT_SCHEMA_XSI, "nil") != null) { @@ -122,7 +123,7 @@ attributes.getValue(Constants.URI_SOAP_ENC, Constants.ATTR_ARRAY_TYPE)); if (arrayTypeValue == null) - throw new SAXException("No arrayType attribute for array!"); + throw new SAXException(JavaUtils.getMessage("noArrayType00")); String arrayTypeValueNamespaceURI = arrayTypeValue.getNamespaceURI(); String arrayTypeValueLocalPart = arrayTypeValue.getLocalPart(); @@ -133,8 +134,8 @@ || rightBracketIndex == -1 || rightBracketIndex < leftBracketIndex) { - throw new IllegalArgumentException("Malformed arrayTypeValue '" + - arrayTypeValue + "'."); + throw new IllegalArgumentException( + JavaUtils.getMessage("badArrayType00", "" + arrayTypeValue)); } String componentTypeName = @@ -142,9 +143,8 @@ if (componentTypeName.endsWith("]")) { - throw new IllegalArgumentException("Arrays of arrays are not " + - "supported '" + arrayTypeValue + - "'."); + throw new IllegalArgumentException( + JavaUtils.getMessage("noArrayArray00", "" + arrayTypeValue)); } arrayItemType = new QName(arrayTypeValueNamespaceURI, @@ -159,8 +159,7 @@ if (lengthStr.indexOf(',') != -1) { throw new IllegalArgumentException( - "Multi-dimensional arrays are not supported '" + - lengthStr + "'."); + JavaUtils.getMessage("noMultiArray00", lengthStr)); } try @@ -170,8 +169,8 @@ getClassForQName(arrayItemType); if (componentType == null) - throw new SAXException("No component type for " + - arrayItemType); + throw new SAXException( + JavaUtils.getMessage("noComponent00", "" + arrayItemType)); ArrayList list = new ArrayList(length); // ArrayList lacks a setSize(), so... @@ -184,8 +183,7 @@ catch (NumberFormatException e) { throw new IllegalArgumentException( - "Explicit array length is not a valid integer '" + - lengthStr + "'."); + JavaUtils.getMessage("badInteger00", lengthStr)); } } @@ -199,8 +197,8 @@ || rightBracketIndex == -1 || rightBracketIndex < leftBracketIndex) { - throw new SAXException("Malformed offset attribute '" + - offset + "'."); + throw new SAXException( + JavaUtils.getMessage("badOffset00", offset)); } curIndex = Integer.parseInt(offset.substring(leftBracketIndex + 1, @@ -208,7 +206,7 @@ } if (category.isDebugEnabled()) { - category.debug("Out ArraySerializer.startElement()"); + category.debug(JavaUtils.getMessage("exit00", "ArraySerializer.startElement()")); } } @@ -220,7 +218,7 @@ throws SAXException { if (category.isDebugEnabled()) { - category.debug("In ArraySerializer.onStartChild()"); + category.debug(JavaUtils.getMessage("enter00", "ArraySerializer.onStartChild()")); } if (attributes != null) { @@ -234,8 +232,8 @@ || rightBracketIndex == -1 || rightBracketIndex < leftBracketIndex) { - throw new SAXException("Malformed position attribute '" + - pos + "'."); + throw new SAXException( + JavaUtils.getMessage("badPosition00", pos)); } curIndex = @@ -255,7 +253,7 @@ dSer.registerCallback(this, new Integer(curIndex++)); if (category.isDebugEnabled()) { - category.debug("Out ArraySerializer.onStartChild()"); + category.debug(JavaUtils.getMessage("exit00", "ArraySerializer.onStartChild()")); } return dSer; } @@ -263,8 +261,8 @@ public void valueReady(Object value, Object hint) { if (category.isDebugEnabled()) { - category.debug("ArraySerializer got value [" + hint + - "] = " + value); + category.debug(JavaUtils.getMessage("gotValue00", "ArraySerializer", "[" + hint + + "] = " + value)); } ((ArrayList)this.value).set(((Integer)hint).intValue(), value); } @@ -274,15 +272,15 @@ throws IOException { if (value == null) - throw new IOException("Can't serialize null Arrays just yet..."); + throw new IOException(JavaUtils.getMessage("cantDoNullArray00")); Class cls = value.getClass(); List list = null; if (!cls.isArray()) { if (!(value instanceof List)) { - throw new IOException("Can't serialize a " + cls.getName() + - " with the ArraySerializer!"); + throw new IOException( + JavaUtils.getMessage("cantSerialize00", cls.getName())); } list = (List)value; } @@ -300,8 +298,8 @@ QName componentQName = context.getQNameForClass(componentType); if (componentQName == null) - throw new IOException("No mapped schema type for " + - componentType.getName()); + throw new IOException( + JavaUtils.getMessage("noType00", componentType.getName())); String prefix = context.getPrefixForURI(componentQName.getNamespaceURI()); String arrayType = prefix + ":" + componentQName.getLocalPart(); int len = (list == null) ? Array.getLength(value) : list.size();