com.dyuproject.protostuff
Class MessageCollectionSchema<V>

java.lang.Object
  extended by com.dyuproject.protostuff.CollectionSchema<V>
      extended by com.dyuproject.protostuff.MessageCollectionSchema<V>
All Implemented Interfaces:
Schema<java.util.Collection<V>>

public final class MessageCollectionSchema<V>
extends CollectionSchema<V>

A schema for a Collection with Message or pojo values. Does not allow null values.

Author:
David Yu
Date created:
Jan 26, 2011

Nested Class Summary
 
Nested classes/interfaces inherited from class com.dyuproject.protostuff.CollectionSchema
CollectionSchema.MessageFactories, CollectionSchema.MessageFactory
 
Field Summary
 Pipe.Schema<V> pipeSchema
          The pipe schema of the member (message).
 Schema<V> schema
          The schema of the member (message).
 
Fields inherited from class com.dyuproject.protostuff.CollectionSchema
FIELD_NAME_VALUE, messageFactory
 
Constructor Summary
MessageCollectionSchema(Schema<V> schema)
           
MessageCollectionSchema(Schema<V> schema, Pipe.Schema<V> pipeSchema)
           
 
Method Summary
protected  void addValueFrom(Input input, java.util.Collection<V> collection)
          Adds the value from the input into the Collection.
protected  void transferValue(Pipe pipe, Input input, Output output, int number, boolean repeated)
          Transfers the value from the input to the output.
protected  void writeValueTo(Output output, int fieldNumber, V value, boolean repeated)
          Writes the value to the output.
 
Methods inherited from class com.dyuproject.protostuff.CollectionSchema
getFieldName, getFieldNumber, isInitialized, mergeFrom, messageFullName, messageName, newMessage, typeClass, writeTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

schema

public final Schema<V> schema
The schema of the member (message).


pipeSchema

public final Pipe.Schema<V> pipeSchema
The pipe schema of the member (message).

Constructor Detail

MessageCollectionSchema

public MessageCollectionSchema(Schema<V> schema)

MessageCollectionSchema

public MessageCollectionSchema(Schema<V> schema,
                               Pipe.Schema<V> pipeSchema)
Method Detail

addValueFrom

protected void addValueFrom(Input input,
                            java.util.Collection<V> collection)
                     throws java.io.IOException
Description copied from class: CollectionSchema
Adds the value from the input into the Collection.

Specified by:
addValueFrom in class CollectionSchema<V>
Throws:
java.io.IOException

writeValueTo

protected void writeValueTo(Output output,
                            int fieldNumber,
                            V value,
                            boolean repeated)
                     throws java.io.IOException
Description copied from class: CollectionSchema
Writes the value to the output.

Specified by:
writeValueTo in class CollectionSchema<V>
Throws:
java.io.IOException

transferValue

protected void transferValue(Pipe pipe,
                             Input input,
                             Output output,
                             int number,
                             boolean repeated)
                      throws java.io.IOException
Description copied from class: CollectionSchema
Transfers the value from the input to the output.

Specified by:
transferValue in class CollectionSchema<V>
Throws:
java.io.IOException


Copyright © 2009-2012. All Rights Reserved.