axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/encoding SerializationContext.java
Date Mon, 30 Jul 2001 15:33:53 GMT
rubys       01/07/30 08:33:53

  Modified:    java/src/org/apache/axis/encoding SerializationContext.java
  Log:
  Expand the list of primitives for which we do not do multiref's.
  
  Revision  Changes    Path
  1.23      +17 -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.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- SerializationContext.java	2001/07/25 04:27:37	1.22
  +++ SerializationContext.java	2001/07/30 15:33:53	1.23
  @@ -194,15 +194,29 @@
           return getTypeMappingRegistry().getTypeQName(cls);
       }
       
  +    /**
  +     * Classes which are known to not require multi-ref.  Doing multiref
  +     * for these would not only tend to increase the size of the payload,
  +     * they decrease interopability by utilizing an advanced function of
  +     * the protocol unnecessarily.
  +     */
  +    public boolean isPrimitive(Object value)
  +    {
  +        if (value instanceof String) return true;
  +        if (value instanceof Number) return true;
  +        if (value instanceof Boolean) return true;
  +        if (value instanceof Date) return true;
  +        if (value instanceof byte[]) return true;
  +        return false;
  +    }
  +    
       public void serialize(QName qName, Attributes attributes, Object value)
           throws IOException
       {
           if (value == null)
               return;
           
  -        if (doMultiRefs && (value != currentSer) &&
  -            !(value.getClass().equals(String.class)) &&
  -            !(value instanceof Number)) {
  +        if (doMultiRefs && (value != currentSer) && !isPrimitive(value))
{
               if (multiRefIndex == -1)
                   multiRefValues = new HashMap();
               
  
  
  

Mime
View raw message