axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bu...@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
Date Tue, 06 Nov 2001 21:52:29 GMT
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<Constants.URIS_SCHEMA_XSI.length && type==null; i++)
               type = attributes.getValue(Constants.URIS_SCHEMA_XSI[i], "type");
   
           if (type == null)
  -            throw new SAXException("No type attribute for vector!");
  +            throw new SAXException(JavaUtils.getMessage("noType01"));
   
           QName itemType = context.getQNameFromString(type);
           if (itemType == null)
  -            throw new SAXException("No type attribute for vector!");
  +            throw new SAXException(JavaUtils.getMessage("noType01"));
   
           Deserializer dSer = context.getTypeMappingRegistry().
                                           getDeserializer(itemType);
           dSer.registerCallback(this, null);
   
           if (category.isDebugEnabled()) {
  -            category.debug("Out VectorDeserializer.onStartChild()");
  +            category.debug(JavaUtils.getMessage("exit00", "VectorDeserializer.onStartChild()"));
           }
           return dSer;
       }
  @@ -140,7 +141,7 @@
       public void valueReady(Object value, Object hint)
       {
           if (category.isDebugEnabled()) {
  -            category.debug("VectorDeserializer got value = " + value);
  +            category.debug(JavaUtils.getMessage("gotValue00", "VectorDeserializer", ""
+ value));
           }
           ((Vector)this.value).add(value);
       }
  
  
  
  1.34      +6 -6      xml-axis/java/src/org/apache/axis/encoding/TypeMappingRegistry.java
  
  Index: TypeMappingRegistry.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/TypeMappingRegistry.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- TypeMappingRegistry.java	2001/10/31 23:50:21	1.33
  +++ TypeMappingRegistry.java	2001/11/06 21:52:28	1.34
  @@ -56,6 +56,7 @@
   package org.apache.axis.encoding;
   
   import org.apache.axis.Constants;
  +import org.apache.axis.utils.JavaUtils;
   import org.w3c.dom.Document;
   import org.w3c.dom.Element;
   import org.xml.sax.Attributes;
  @@ -120,12 +121,12 @@
           // debug assertions: every tmr must have exactly one
           // SOAPTypeMappingRegistry at the top.
           if (parent == null)
  -            new Exception("null parent!").printStackTrace();
  +            new Exception(JavaUtils.getMessage("nullParent00")).printStackTrace();
           if (this instanceof SOAPTypeMappingRegistry)
  -            new Exception("SOAPTypeMappingRegistry w/parent").printStackTrace();
  +            new Exception(JavaUtils.getMessage("withParent00")).printStackTrace();
           for (TypeMappingRegistry t = parent; t!=null; t=t.getParent())
               if (t instanceof SOAPTypeMappingRegistry) return;
  -        new Exception("no SOAPTypeMappingRegistry parent").printStackTrace();
  +        new Exception(JavaUtils.getMessage("noParent00")).printStackTrace();
       }
   
       public TypeMappingRegistry getParent() {
  @@ -268,9 +269,8 @@
                   _class = _class.getSuperclass();
               }
               
  -            throw new IOException("No serializer found for class " +
  -                                  value.getClass().getName() +
  -                                  " in registry " + this);
  +            throw new IOException(JavaUtils.getMessage("noSerializer00",
  +                    value.getClass().getName(), "" + this));
           }
           // !!! Write out a generic null, or get type info from somewhere else?
       }
  
  
  
  1.46      +4 -2      xml-axis/java/src/org/apache/axis/encoding/SOAPTypeMappingRegistry.java
  
  Index: SOAPTypeMappingRegistry.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/SOAPTypeMappingRegistry.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- SOAPTypeMappingRegistry.java	2001/10/31 23:50:21	1.45
  +++ SOAPTypeMappingRegistry.java	2001/11/06 21:52:28	1.46
  @@ -57,6 +57,7 @@
   
   import org.apache.axis.Constants;
   import org.apache.axis.message.SOAPHandler;
  +import org.apache.axis.utils.JavaUtils;
   import org.xml.sax.Attributes;
   import org.xml.sax.SAXException;
   
  @@ -114,7 +115,7 @@
                             Object value, SerializationContext context)
               throws IOException
           {
  -            throw new IOException("Can't serialize a raw object");
  +            throw new IOException(JavaUtils.getMessage("cantSerialize02"));
           }
       }
   
  @@ -128,7 +129,8 @@
                                           DeserializationContext context)
               throws SAXException
           {
  -            throw new SAXException("Basic deser can't handle structured data!");
  +            throw new SAXException(
  +                    JavaUtils.getMessage("cantHandle00", "BasicDeser"));
           }
           
           public void characters(char [] chars, int start, int end)
  
  
  
  1.53      +5 -3      xml-axis/java/src/org/apache/axis/encoding/SerializationContext.java
  
  Index: SerializationContext.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/SerializationContext.java,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- SerializationContext.java	2001/11/06 21:38:04	1.52
  +++ SerializationContext.java	2001/11/06 21:52:28	1.53
  @@ -61,6 +61,7 @@
   import org.apache.axis.client.Call;
   import org.apache.axis.utils.Mapping;
   import org.apache.axis.utils.NSStack;
  +import org.apache.axis.utils.JavaUtils;
   import org.apache.axis.utils.XMLUtils;
   import org.apache.log4j.Category;
   import org.w3c.dom.Attr;
  @@ -237,7 +238,7 @@
       public void registerPrefixForURI(String prefix, String uri)
       {
           if (category.isDebugEnabled()) {
  -            category.debug("register '" + prefix + "' - '" + uri + "'");
  +            category.debug(JavaUtils.getMessage("register00", prefix, uri));
           }
   
           if ((uri != null) && (prefix != null)) {
  @@ -379,7 +380,8 @@
           throws IOException
       {
           if (category.isDebugEnabled()) {
  -            category.debug("Out: Starting element [" + qName.getNamespaceURI() + "]:" +
qName.getLocalPart());
  +            category.debug(JavaUtils.getMessage("startElem00",
  +                    "[" + qName.getNamespaceURI() + "]:" + qName.getLocalPart()));
           }
   
           if (startOfDocument && sendXMLDecl) {
  @@ -463,7 +465,7 @@
           String elementQName = (String)elementStack.pop();
   
           if (category.isDebugEnabled()) {
  -            category.debug("Out: Ending element " + elementQName);
  +            category.debug(JavaUtils.getMessage("endElem00", "" + elementQName));
           }
   
           nsStack.pop();
  
  
  
  1.11      +8 -6      xml-axis/java/src/org/apache/axis/encoding/MapSerializer.java
  
  Index: MapSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/MapSerializer.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- MapSerializer.java	2001/10/30 16:46:37	1.10
  +++ MapSerializer.java	2001/11/06 21:52:28	1.11
  @@ -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;
  @@ -113,8 +114,8 @@
           throws IOException
       {
           if (!(value instanceof Map))
  -            throw new IOException("MapSerializer: " +
  -                 value.getClass().getName() + " is not a Map");
  +            throw new IOException(
  +                    JavaUtils.getMessage("noMap00", "MapSerializer", value.getClass().getName()));
           
           Map map = (Map)value;
           
  @@ -201,13 +202,13 @@
           throws SAXException
       {
           if (category.isDebugEnabled()) {
  -            category.debug("In MapSerializer.startElement()");
  +            category.debug(JavaUtils.getMessage("enter00", "MapSerializer.startElement()"));
           }
           
           value = new HashMap();
           
           if (category.isDebugEnabled()) {
  -            category.debug("Out MapSerializer.startElement()");
  +            category.debug(JavaUtils.getMessage("exit00", "MapSerializer.startElement()"));
           }
       }
       
  @@ -219,11 +220,12 @@
           throws SAXException
       {
           if (category.isDebugEnabled()) {
  -            category.debug("In MapSerializer.onStartChild()");
  +            category.debug(JavaUtils.getMessage("enter00", "MapSerializer.onStartChild()"));
           }
   
           if (!localName.equals("item"))
  -            throw new SAXException("Only 'item' elements are allowed in a Map!");
  +            throw new SAXException(
  +                    JavaUtils.getMessage("itemInMap00"));
           
           return new ItemHandler();
       }
  
  
  
  1.6       +6 -2      xml-axis/java/src/org/apache/axis/encoding/Hex.java
  
  Index: Hex.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/Hex.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Hex.java	2001/10/30 16:46:37	1.5
  +++ Hex.java	2001/11/06 21:52:28	1.6
  @@ -56,6 +56,8 @@
   
   import java.io.ByteArrayOutputStream;
   
  +import org.apache.axis.utils.JavaUtils;
  +
   /**
    * Custom class for supporting primitive XSD data type hexBinary.
    *
  @@ -92,8 +94,10 @@
           return s1.equals(s2);
       }
   
  -    public static final String ERROR_ODD_NUMBER_OF_DIGITS="Odd number of digits hex string";
  -    public static final String ERROR_BAD_CHARACTER_IN_HEX_STRING="Bad character or insufficient
number of characters in hex string";
  +    public static final String ERROR_ODD_NUMBER_OF_DIGITS =
  +            JavaUtils.getMessage("oddDigits00");
  +    public static final String ERROR_BAD_CHARACTER_IN_HEX_STRING =
  +            JavaUtils.getMessage("badChars01");
   
       // Code from Ajp11, from Apache's JServ
   
  
  
  
  1.2       +3 -1      xml-axis/java/src/org/apache/axis/encoding/ElementSerializer.java
  
  Index: ElementSerializer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ElementSerializer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ElementSerializer.java	2001/10/31 23:50:21	1.1
  +++ ElementSerializer.java	2001/11/06 21:52:28	1.2
  @@ -55,6 +55,8 @@
   
   package org.apache.axis.encoding;
   
  +import org.apache.axis.utils.JavaUtils;
  +
   import org.xml.sax.Attributes;
   import org.xml.sax.SAXException;
   import org.w3c.dom.Element;
  @@ -76,7 +78,7 @@
           throws IOException
       {
           if (!(value instanceof Element))
  -            throw new IOException("Can't serialize non-Elements with an ElementSerializer!");
  +            throw new IOException(JavaUtils.getMessage("cantSerialize01"));
           
           context.writeDOMElement((Element)value);
       }
  
  
  
  1.36      +13 -12    xml-axis/java/src/org/apache/axis/encoding/DeserializationContext.java
  
  Index: DeserializationContext.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/DeserializationContext.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- DeserializationContext.java	2001/11/06 21:38:04	1.35
  +++ DeserializationContext.java	2001/11/06 21:52:28	1.36
  @@ -66,6 +66,7 @@
   import org.apache.axis.message.SOAPEnvelope;
   import org.apache.axis.message.SOAPHandler;
   import org.apache.axis.utils.NSStack;
  +import org.apache.axis.utils.JavaUtils;
   import org.apache.axis.utils.XMLUtils;
   import org.apache.log4j.Category;
   import org.xml.sax.Attributes;
  @@ -427,7 +428,7 @@
       public void pushElementHandler(SOAPHandler handler)
       {
           if (category.isDebugEnabled()) {
  -            category.debug("Pushing handler " + handler);
  +            category.debug(JavaUtils.getMessage("pushHandler00", "" + handler));
           }
           
           handlerStack.push(handler);
  @@ -450,13 +451,13 @@
           if (!handlerStack.empty()) {
               SOAPHandler handler = getTopHandler();
               if (category.isDebugEnabled()) {
  -                category.debug("Popping handler " + handler);
  +                category.debug(JavaUtils.getMessage("popHandler00", "" + handler));
               }
               handlerStack.pop();
               return handler;
           } else {
               if (category.isDebugEnabled()) {
  -                category.debug("Popping handler...(null)");
  +                category.debug(JavaUtils.getMessage("popHandler00", "(null)"));
               }
               return null;
           }
  @@ -473,7 +474,7 @@
       
       public void endDocument() throws SAXException {
           if (category.isDebugEnabled()) {
  -            category.debug("EndDocument");
  +            category.debug(JavaUtils.getMessage("endDoc00"));
           }
           if (recorder != null)
               recorder.endDocument();
  @@ -505,7 +506,7 @@
           }
          
           if (category.isDebugEnabled()) {
  -            category.debug("StartPrefixMapping '" + prefix + "'->'" + 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 &lt;kent@trl.ibm.co.jp&gt;
  @@ -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();
  
  
  

Mime
View raw message