Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   //========================================================================
   //Copyright 2012 David Yu
   //------------------------------------------------------------------------
   //Licensed under the Apache License, Version 2.0 (the "License");
   //you may not use this file except in compliance with the License.
   //You may obtain a copy of the License at 
   //http://www.apache.org/licenses/LICENSE-2.0
   //Unless required by applicable law or agreed to in writing, software
   //distributed under the License is distributed on an "AS IS" BASIS,
  //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  //See the License for the specific language governing permissions and
  //limitations under the License.
  //========================================================================
  
  package io.protostuff.runtime;
  
  import static io.protostuff.runtime.RuntimeEnv.ALLOW_NULL_ARRAY_ELEMENT;
  import static io.protostuff.runtime.RuntimeFieldFactory.ID_BIGDECIMAL;
  import static io.protostuff.runtime.RuntimeFieldFactory.ID_BIGINTEGER;
  import static io.protostuff.runtime.RuntimeFieldFactory.ID_BOOL;
  import static io.protostuff.runtime.RuntimeFieldFactory.ID_BYTES;
  import static io.protostuff.runtime.RuntimeFieldFactory.ID_BYTE_ARRAY;
  import static io.protostuff.runtime.RuntimeFieldFactory.ID_CHAR;
  import static io.protostuff.runtime.RuntimeFieldFactory.ID_DATE;
  import static io.protostuff.runtime.RuntimeFieldFactory.ID_DOUBLE;
  import static io.protostuff.runtime.RuntimeFieldFactory.ID_FLOAT;
  import static io.protostuff.runtime.RuntimeFieldFactory.ID_INT32;
  import static io.protostuff.runtime.RuntimeFieldFactory.ID_INT64;
  import static io.protostuff.runtime.RuntimeFieldFactory.ID_SHORT;
  import static io.protostuff.runtime.RuntimeFieldFactory.ID_STRING;
  
  import java.util.Date;
  
Built-in array schemas.

Author(s):
David Yu
Created:
Dec 4, 2012
  
  public final class ArraySchemas
  {
      private ArraySchemas()
      {
      }
  
      /*
       * public static final int CID_BOOL = 0, CID_BYTE = 1, CID_CHAR = 2, CID_SHORT = 3, CID_INT32 = 4, CID_INT64 = 5,
       * CID_FLOAT = 6, CID_DOUBLE = 7, CID_STRING = 16, CID_BYTES = 17, CID_BYTE_ARRAY = 18, CID_BIGDECIMAL = 19,
       * CID_BIGINTEGER = 20, CID_DATE = 21;
       */
  
      static final int ID_ARRAY_LEN = 1,
              ID_ARRAY_DATA = 2,
              ID_ARRAY_NULLCOUNT = 3;
  
      static final String STR_ARRAY_LEN = "a",
              STR_ARRAY_DATA = "b",
              STR_ARRAY_NULLCOUNT = "c";
  
      static boolean isPrimitive(int arrayId)
      {
          return arrayId < 8;
      }
  
      static int toArrayId(int idboolean primitive)
      {
          if (primitive)
              return id - 1;
  
          // if id < 9, its the primitive's boxed type.
          return id < 9 ? ((id - 1) | 0x08) : (id + 7);
      }
  
      static int toInlineId(int arrayId)
      {
          if (arrayId < 8)
              return arrayId + 1;
  
          if (arrayId < 16)
              return 1 + (arrayId & 0x07);
  
          return arrayId - 7;
      }
  
      static Base getSchema(int idboolean primitive)
     {
         switch (id)
         {
             case :
                 return primitive ? . : .;
             case :
                 return primitive ? . : .;
             case :
                 return primitive ? . : .;
             case :
                 return primitive ? . : .;
             case :
                 return primitive ? . : .;
             case :
                 return primitive ? . : .;
             case :
                 return primitive ? .
                         : .;
             case :
                 return .;
             case :
                 return .;
             case :
                 return .;
             case :
                 return .;
             case :
                 return .;
             case :
                 return .;
             default:
                 throw new RuntimeException("Should not happen.");
         }
     }
 
     static Base getGenericElementSchema(int id)
     {
         switch (id)
         {
             case :
                 return .;
             case :
                 return .;
             case :
                 return .;
             case :
                 return .;
             case :
                 return .;
             case :
                 return .;
             case :
                 return .;
             case :
                 return .;
             case :
                 return .;
             case :
                 return .;
             case :
                 return .;
             case :
                 return .;
             case :
                 return .;
             default:
                 throw new RuntimeException("Should not happen.");
         }
     }
 
     static Base newSchema(int idClass<?> compontentTypeClass<?> typeClass,
             IdStrategy strategyfinal Handler handler)
     {
         switch (id)
         {
             case :
                 return new BoolArray(handlercompontentType.isPrimitive());
             case :
                 return new CharArray(handlercompontentType.isPrimitive());
             case :
                 return new ShortArray(handlercompontentType.isPrimitive());
             case :
                 return new Int32Array(handlercompontentType.isPrimitive());
             case :
                 return new Int64Array(handlercompontentType.isPrimitive());
             case :
                 return new FloatArray(handlercompontentType.isPrimitive());
             case :
                 return new DoubleArray(handlercompontentType.isPrimitive());
             case :
                 return new StringArray(handler);
             case :
                 return new ByteStringArray(handler);
             case :
                 return new ByteArrayArray(handler);
             case :
                 return new BigDecimalArray(handler);
             case :
                 return new BigIntegerArray(handler);
             case :
                 return new DateArray(handler);
             default:
                 throw new RuntimeException("Should not happen.");
         }
     }
 
     static String name(int number)
     {
         switch (number)
         {
             case :
                 return ;
             case :
                 return ;
             case :
                 return ;
             default:
                 return null;
         }
     }
 
     static int number(String name)
     {
         if (name.length() != 1)
             return 0;
 
         switch (name.charAt(0))
         {
             case 'a':
                 return ;
             case 'b':
                 return ;
             case 'c':
                 return ;
             default:
                 return 0;
         }
     }
 
     static void transferObject(Pipe.Schema<ObjectpipeSchemaPipe pipe,
             Input inputOutput outputIdStrategy strategy,
             Delegate<?> delegatethrows IOException
     {
         if ( != input.readFieldNumber(pipeSchema.wrappedSchema))
             throw new ProtostuffException("Corrupt input.");
 
         final int len = input.readUInt32();
         // write it back
         output.writeUInt32(lenfalse);
 
         for (int i = 0, nullCount = 0; i < len;)
         {
             switch (input.readFieldNumber(pipeSchema.wrappedSchema))
             {
                 case :
                     i++;
                     delegate.transfer(pipeinputoutputtrue);
                     break;
                 case :
                     nullCount = input.readUInt32();
                     i += nullCount;
                     output.writeUInt32(nullCountfalse);
                     break;
                 default:
                     throw new ProtostuffException("Corrupt input.");
             }
         }
 
         if (0 != input.readFieldNumber(pipeSchema.wrappedSchema))
             throw new ProtostuffException("Corrupt input.");
     }
 
     public static abstract class Base extends PolymorphicSchema
     {
         protected final Handler handler;
 
         public Base(final Handler handler)
         {
             super(null);
 
             this. = handler;
         }
 
         @Override
         public String getFieldName(int number)
         {
             return name(number);
         }
 
         @Override
         public int getFieldNumber(String name)
         {
             return number(name);
         }
 
         @Override
         public String messageFullName()
         {
             return Array.class.getName();
         }
 
         @Override
         public String messageName()
         {
             return Array.class.getSimpleName();
         }
 
         @Override
         protected void setValue(Object valueObject owner)
         {
             .setValue(valueowner);
         }
 
         @Override
         public void mergeFrom(Input inputObject ownerthrows IOException
         {
             setValue(readFrom(inputowner), owner);
         }
 
         protected abstract Object readFrom(Input inputObject owner)
                 throws IOException;
     }
 
     public static class BoolArray extends Base
     {
         public static final BoolArray PRIMITIVE = new BoolArray(nulltrue);
 
         public static final BoolArray ELEMENT_SCHEMA = new BoolArray(null,
                 false)
         {
             @Override
             @SuppressWarnings("unchecked")
             protected void setValue(Object valueObject owner)
             {
                 if (MapWrapper.class == owner.getClass())
                     ((MapWrapper<ObjectObject>) owner).setValue(value);
                 else
                     ((Collection<Object>) owner).add(value);
             }
         };
 
         protected final Pipe.Schema<ObjectpipeSchema = new Pipe.Schema<Object>(
                 this)
         {
             @Override
             protected void transfer(Pipe pipeInput inputOutput output)
                     throws IOException
             {
                 transferObject(thispipeinputoutput,
                         .);
             }
         };
 
         final boolean primitive;
 
         BoolArray(Handler handlerboolean primitive)
         {
             super(handler);
             this. = primitive;
         }
 
         @Override
         public Pipe.Schema<ObjectgetPipeSchema()
         {
             return ;
         }
 
         @Override
         public Object readFrom(Input inputObject ownerthrows IOException
         {
             if ( != input.readFieldNumber(this))
                 throw new ProtostuffException("Corrupt input.");
 
             final int len = input.readUInt32();
 
             if ()
             {
                 boolean[] array = new boolean[len];
                 if (input instanceof GraphInput)
                 {
                     // update the actual reference.
                     ((GraphInputinput).updateLast(arrayowner);
                 }
 
                 for (int i = 0; i < leni++)
                 {
                     if ( != input.readFieldNumber(this))
                         throw new ProtostuffException("Corrupt input.");
 
                     array[i] = input.readBool();
                 }
 
                 if (0 != input.readFieldNumber(this))
                     throw new ProtostuffException("Corrupt input.");
 
                 return array;
             }
 
             final Boolean[] array = new Boolean[len];
             if (input instanceof GraphInput)
             {
                 // update the actual reference.
                 ((GraphInputinput).updateLast(arrayowner);
             }
 
             for (int i = 0; i < len;)
             {
                 switch (input.readFieldNumber(this))
                 {
                     case :
                         array[i++] = input.readBool();
                         break;
                     case :
                         i += input.readUInt32();
                         break;
                     default:
                         throw new ProtostuffException("Corrupt input.");
                 }
             }
 
             if (0 != input.readFieldNumber(this))
                 throw new ProtostuffException("Corrupt input.");
 
             return array;
         }
 
         @Override
         public void writeTo(Output outputObject valuethrows IOException
         {
             if ()
             {
                 boolean[] array = (boolean[]) value;
                 output.writeUInt32(array.lengthfalse);
 
                 for (int i = 0, len = array.lengthi < leni++)
                     output.writeBool(array[i], true);
 
                 return;
             }
 
             final Boolean[] array = (Boolean[]) value;
             output.writeUInt32(array.lengthfalse);
 
             int nullCount = 0;
             for (int i = 0, len = array.lengthi < leni++)
             {
                 Boolean v = array[i];
                 if (v != null)
                 {
                     if (nullCount != 0)
                     {
                         output.writeUInt32(nullCountfalse);
                         nullCount = 0;
                     }
 
                     output.writeBool(vtrue);
                 }
                 else if ()
                 {
                     nullCount++;
                 }
             }
 
             // if last element is null
             if (nullCount != 0)
                 output.writeUInt32(nullCountfalse);
         }
     }
 
     public static class CharArray extends Base
     {
         public static final CharArray PRIMITIVE = new CharArray(nulltrue);
 
         public static final CharArray ELEMENT_SCHEMA = new CharArray(null,
                 false)
         {
             @Override
             @SuppressWarnings("unchecked")
             protected void setValue(Object valueObject owner)
             {
                 if (MapWrapper.class == owner.getClass())
                     ((MapWrapper<ObjectObject>) owner).setValue(value);
                 else
                     ((Collection<Object>) owner).add(value);
             }
         };
 
         protected final Pipe.Schema<ObjectpipeSchema = new Pipe.Schema<Object>(
                 this)
         {
             @Override
             protected void transfer(Pipe pipeInput inputOutput output)
                     throws IOException
             {
                 transferObject(thispipeinputoutput,
                         .);
             }
         };
 
         final boolean primitive;
 
         CharArray(Handler handlerboolean primitive)
         {
             super(handler);
             this. = primitive;
         }
 
         @Override
         public Pipe.Schema<ObjectgetPipeSchema()
         {
             return ;
         }
 
         @Override
         public Object readFrom(Input inputObject ownerthrows IOException
         {
             if ( != input.readFieldNumber(this))
                 throw new ProtostuffException("Corrupt input.");
 
             final int len = input.readUInt32();
 
             if ()
             {
                 char[] array = new char[len];
                 if (input instanceof GraphInput)
                 {
                     // update the actual reference.
                     ((GraphInputinput).updateLast(arrayowner);
                 }
 
                 for (int i = 0; i < leni++)
                 {
                     if ( != input.readFieldNumber(this))
                         throw new ProtostuffException("Corrupt input.");
 
                     array[i] = (charinput.readUInt32();
                 }
 
                 if (0 != input.readFieldNumber(this))
                     throw new ProtostuffException("Corrupt input.");
 
                 return array;
             }
 
             final Character[] array = new Character[len];
             if (input instanceof GraphInput)
             {
                 // update the actual reference.
                 ((GraphInputinput).updateLast(arrayowner);
             }
 
             for (int i = 0; i < len;)
             {
                 switch (input.readFieldNumber(this))
                 {
                     case :
                         array[i++] = (charinput.readUInt32();
                         break;
                     case :
                         i += input.readUInt32();
                         break;
                     default:
                         throw new ProtostuffException("Corrupt input.");
                 }
             }
 
             if (0 != input.readFieldNumber(this))
                 throw new ProtostuffException("Corrupt input.");
 
             return array;
         }
 
         @Override
         public void writeTo(Output outputObject valuethrows IOException
         {
             if ()
             {
                 char[] array = (char[]) value;
                 output.writeUInt32(array.lengthfalse);
 
                 for (int i = 0, len = array.lengthi < leni++)
                     output.writeUInt32(array[i], true);
 
                 return;
             }
 
             final Character[] array = (Character[]) value;
             output.writeUInt32(array.lengthfalse);
 
             int nullCount = 0;
             for (int i = 0, len = array.lengthi < leni++)
             {
                 Character v = array[i];
                 if (v != null)
                 {
                     if (nullCount != 0)
                     {
                         output.writeUInt32(nullCountfalse);
                         nullCount = 0;
                     }
 
                     output.writeUInt32(vtrue);
                 }
                 else if ()
                 {
                     nullCount++;
                 }
             }
 
             // if last element is null
             if (nullCount != 0)
                 output.writeUInt32(nullCountfalse);
         }
     }
 
     public static class ShortArray extends Base
     {
         public static final ShortArray PRIMITIVE = new ShortArray(nulltrue);
 
         public static final ShortArray ELEMENT_SCHEMA = new ShortArray(null,
                 false)
         {
             @Override
             @SuppressWarnings("unchecked")
             protected void setValue(Object valueObject owner)
             {
                 if (MapWrapper.class == owner.getClass())
                     ((MapWrapper<ObjectObject>) owner).setValue(value);
                 else
                     ((Collection<Object>) owner).add(value);
             }
         };
 
         protected final Pipe.Schema<ObjectpipeSchema = new Pipe.Schema<Object>(
                 this)
         {
             @Override
             protected void transfer(Pipe pipeInput inputOutput output)
                     throws IOException
             {
                 transferObject(thispipeinputoutput,
                         .);
             }
         };
 
         final boolean primitive;
 
         ShortArray(Handler handlerboolean primitive)
         {
             super(handler);
             this. = primitive;
         }
 
         @Override
         public Pipe.Schema<ObjectgetPipeSchema()
         {
             return ;
         }
 
         @Override
         public Object readFrom(Input inputObject ownerthrows IOException
         {
             if ( != input.readFieldNumber(this))
                 throw new ProtostuffException("Corrupt input.");
 
             final int len = input.readUInt32();
 
             if ()
             {
                 short[] array = new short[len];
                 if (input instanceof GraphInput)
                 {
                     // update the actual reference.
                     ((GraphInputinput).updateLast(arrayowner);
                 }
 
                 for (int i = 0; i < leni++)
                 {
                     if ( != input.readFieldNumber(this))
                         throw new ProtostuffException("Corrupt input.");
 
                     array[i] = (shortinput.readUInt32();
                 }
 
                 if (0 != input.readFieldNumber(this))
                     throw new ProtostuffException("Corrupt input.");
 
                 return array;
             }
 
             final Short[] array = new Short[len];
             if (input instanceof GraphInput)
             {
                 // update the actual reference.
                 ((GraphInputinput).updateLast(arrayowner);
             }
 
             for (int i = 0; i < len;)
             {
                 switch (input.readFieldNumber(this))
                 {
                     case :
                         array[i++] = (shortinput.readUInt32();
                         break;
                     case :
                         i += input.readUInt32();
                         break;
                     default:
                         throw new ProtostuffException("Corrupt input.");
                 }
             }
 
             if (0 != input.readFieldNumber(this))
                 throw new ProtostuffException("Corrupt input.");
 
             return array;
         }
 
         @Override
         public void writeTo(Output outputObject valuethrows IOException
         {
             if ()
             {
                 short[] array = (short[]) value;
                 output.writeUInt32(array.lengthfalse);
 
                 for (int i = 0, len = array.lengthi < leni++)
                     output.writeUInt32(array[i], true);
 
                 return;
             }
 
             final Short[] array = (Short[]) value;
             output.writeUInt32(array.lengthfalse);
 
             int nullCount = 0;
             for (int i = 0, len = array.lengthi < leni++)
             {
                 Short v = array[i];
                 if (v != null)
                 {
                     if (nullCount != 0)
                     {
                         output.writeUInt32(nullCountfalse);
                         nullCount = 0;
                     }
 
                     output.writeUInt32(vtrue);
                 }
                 else if ()
                 {
                     nullCount++;
                 }
             }
 
             // if last element is null
             if (nullCount != 0)
                 output.writeUInt32(nullCountfalse);
         }
     }
 
     public static class Int32Array extends Base
     {
         public static final Int32Array PRIMITIVE = new Int32Array(nulltrue);
 
         public static final Int32Array ELEMENT_SCHEMA = new Int32Array(null,
                 false)
         {
             @Override
             @SuppressWarnings("unchecked")
             protected void setValue(Object valueObject owner)
             {
                 if (MapWrapper.class == owner.getClass())
                     ((MapWrapper<ObjectObject>) owner).setValue(value);
                 else
                     ((Collection<Object>) owner).add(value);
             }
         };
 
         protected final Pipe.Schema<ObjectpipeSchema = new Pipe.Schema<Object>(
                 this)
         {
             @Override
             protected void transfer(Pipe pipeInput inputOutput output)
                     throws IOException
             {
                 transferObject(thispipeinputoutput,
                         .);
             }
         };
 
         final boolean primitive;
 
         Int32Array(Handler handlerboolean primitive)
         {
             super(handler);
             this. = primitive;
         }
 
         @Override
         public Pipe.Schema<ObjectgetPipeSchema()
         {
             return ;
         }
 
         @Override
         public Object readFrom(Input inputObject ownerthrows IOException
         {
             if ( != input.readFieldNumber(this))
                 throw new ProtostuffException("Corrupt input.");
 
             final int len = input.readUInt32();
 
             if ()
             {
                 int[] array = new int[len];
                 if (input instanceof GraphInput)
                 {
                     // update the actual reference.
                     ((GraphInputinput).updateLast(arrayowner);
                 }
 
                 for (int i = 0; i < leni++)
                 {
                     if ( != input.readFieldNumber(this))
                         throw new ProtostuffException("Corrupt input.");
 
                     array[i] = input.readInt32();
                 }
 
                 if (0 != input.readFieldNumber(this))
                     throw new ProtostuffException("Corrupt input.");
 
                 return array;
             }
 
             final Integer[] array = new Integer[len];
             if (input instanceof GraphInput)
             {
                 // update the actual reference.
                 ((GraphInputinput).updateLast(arrayowner);
             }
 
             for (int i = 0; i < len;)
             {
                 switch (input.readFieldNumber(this))
                 {
                     case :
                         array[i++] = input.readInt32();
                         break;
                     case :
                         i += input.readUInt32();
                         break;
                     default:
                         throw new ProtostuffException("Corrupt input.");
                 }
             }
 
             if (0 != input.readFieldNumber(this))
                 throw new ProtostuffException("Corrupt input.");
 
             return array;
         }
 
         @Override
         public void writeTo(Output outputObject valuethrows IOException
         {
             if ()
             {
                 int[] array = (int[]) value;
                 output.writeUInt32(array.lengthfalse);
 
                 for (int i = 0, len = array.lengthi < leni++)
                     output.writeInt32(array[i], true);
 
                 return;
             }
 
             final Integer[] array = (Integer[]) value;
             output.writeUInt32(array.lengthfalse);
 
             int nullCount = 0;
             for (int i = 0, len = array.lengthi < leni++)
             {
                 Integer v = array[i];
                 if (v != null)
                 {
                     if (nullCount != 0)
                     {
                         output.writeUInt32(nullCountfalse);
                         nullCount = 0;
                     }
 
                     output.writeInt32(vtrue);
                 }
                 else if ()
                 {
                     nullCount++;
                 }
             }
 
             // if last element is null
             if (nullCount != 0)
                 output.writeUInt32(nullCountfalse);
         }
     }
 
     public static class Int64Array extends Base
     {
         public static final Int64Array PRIMITIVE = new Int64Array(nulltrue);
 
         public static final Int64Array ELEMENT_SCHEMA = new Int64Array(null,
                 false)
         {
             @Override
             @SuppressWarnings("unchecked")
             protected void setValue(Object valueObject owner)
             {
                 if (MapWrapper.class == owner.getClass())
                     ((MapWrapper<ObjectObject>) owner).setValue(value);
                 else
                     ((Collection<Object>) owner).add(value);
             }
         };
 
         protected final Pipe.Schema<ObjectpipeSchema = new Pipe.Schema<Object>(
                 this)
         {
             @Override
             protected void transfer(Pipe pipeInput inputOutput output)
                     throws IOException
             {
                 transferObject(thispipeinputoutput,
                         .);
             }
         };
 
         final boolean primitive;
 
         Int64Array(Handler handlerboolean primitive)
         {
             super(handler);
             this. = primitive;
         }
 
         @Override
         public Pipe.Schema<ObjectgetPipeSchema()
         {
             return ;
         }
 
         @Override
         public Object readFrom(Input inputObject ownerthrows IOException
         {
             if ( != input.readFieldNumber(this))
                 throw new ProtostuffException("Corrupt input.");
 
             final int len = input.readUInt32();
 
             if ()
             {
                 long[] array = new long[len];
                 if (input instanceof GraphInput)
                 {
                     // update the actual reference.
                     ((GraphInputinput).updateLast(arrayowner);
                 }
 
                 for (int i = 0; i < leni++)
                 {
                     if ( != input.readFieldNumber(this))
                         throw new ProtostuffException("Corrupt input.");
 
                     array[i] = input.readInt64();
                 }
 
                 if (0 != input.readFieldNumber(this))
                     throw new ProtostuffException("Corrupt input.");
 
                 return array;
             }
 
             final Long[] array = new Long[len];
             if (input instanceof GraphInput)
             {
                 // update the actual reference.
                 ((GraphInputinput).updateLast(arrayowner);
             }
 
             for (int i = 0; i < len;)
             {
                 switch (input.readFieldNumber(this))
                 {
                     case :
                         array[i++] = input.readInt64();
                         break;
                     case :
                         i += input.readUInt32();
                         break;
                     default:
                        throw new ProtostuffException("Corrupt input.");
                }
            }
            if (0 != input.readFieldNumber(this))
                throw new ProtostuffException("Corrupt input.");
            return array;
        }
        @Override
        public void writeTo(Output outputObject valuethrows IOException
        {
            if ()
            {
                long[] array = (long[]) value;
                output.writeUInt32(array.lengthfalse);
                for (int i = 0, len = array.lengthi < leni++)
                    output.writeInt64(array[i], true);
                return;
            }
            final Long[] array = (Long[]) value;
            output.writeUInt32(array.lengthfalse);
            int nullCount = 0;
            for (int i = 0, len = array.lengthi < leni++)
            {
                Long v = array[i];
                if (v != null)
                {
                    if (nullCount != 0)
                    {
                        output.writeUInt32(nullCountfalse);
                        nullCount = 0;
                    }
                    output.writeInt64(vtrue);
                }
                else if ()
                {
                    nullCount++;
                }
            }
            // if last element is null
            if (nullCount != 0)
                output.writeUInt32(nullCountfalse);
        }
    }
    public static class FloatArray extends Base
    {
        public static final FloatArray PRIMITIVE = new FloatArray(nulltrue);
        public static final FloatArray ELEMENT_SCHEMA = new FloatArray(null,
                false)
        {
            @Override
            @SuppressWarnings("unchecked")
            protected void setValue(Object valueObject owner)
            {
                if (MapWrapper.class == owner.getClass())
                    ((MapWrapper<ObjectObject>) owner).setValue(value);
                else
                    ((Collection<Object>) owner).add(value);
            }
        };
        protected final Pipe.Schema<ObjectpipeSchema = new Pipe.Schema<Object>(
                this)
        {
            @Override
            protected void transfer(Pipe pipeInput inputOutput output)
                    throws IOException
            {
                transferObject(thispipeinputoutput,
                        .);
            }