com.dyuproject.protostuff.runtime
Class DerivativeSchema

java.lang.Object
  extended by com.dyuproject.protostuff.runtime.DerivativeSchema
All Implemented Interfaces:
Schema<java.lang.Object>

public abstract class DerivativeSchema
extends java.lang.Object
implements Schema<java.lang.Object>

This schema delegates to another schema derived from the input.

Author:
David Yu
Date created:
Jan 21, 2011

Field Summary
 Pipe.Schema<java.lang.Object> pipeSchema
          This pipe schema delegates to another schema derived from the input.
 IdStrategy strategy
           
 
Constructor Summary
DerivativeSchema(IdStrategy strategy)
           
 
Method Summary
protected abstract  void doMergeFrom(Input input, Schema<java.lang.Object> derivedSchema, java.lang.Object owner)
           
 java.lang.String getFieldName(int number)
           
 int getFieldNumber(java.lang.String name)
           
 boolean isInitialized(java.lang.Object owner)
           
 void mergeFrom(Input input, java.lang.Object owner)
          Delegates to the schema derived from the input.
 java.lang.String messageFullName()
           
 java.lang.String messageName()
           
 java.lang.Object newMessage()
           
 java.lang.Class<? super java.lang.Object> typeClass()
           
 void writeTo(Output output, java.lang.Object value)
          Delegates to the schema derived from the value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

strategy

public final IdStrategy strategy

pipeSchema

public final Pipe.Schema<java.lang.Object> pipeSchema
This pipe schema delegates to another schema derived from the input.

Constructor Detail

DerivativeSchema

public DerivativeSchema(IdStrategy strategy)
Method Detail

getFieldName

public java.lang.String getFieldName(int number)
Specified by:
getFieldName in interface Schema<java.lang.Object>

getFieldNumber

public int getFieldNumber(java.lang.String name)
Specified by:
getFieldNumber in interface Schema<java.lang.Object>

isInitialized

public boolean isInitialized(java.lang.Object owner)
Specified by:
isInitialized in interface Schema<java.lang.Object>

messageFullName

public java.lang.String messageFullName()
Specified by:
messageFullName in interface Schema<java.lang.Object>

messageName

public java.lang.String messageName()
Specified by:
messageName in interface Schema<java.lang.Object>

newMessage

public java.lang.Object newMessage()
Specified by:
newMessage in interface Schema<java.lang.Object>

typeClass

public java.lang.Class<? super java.lang.Object> typeClass()
Specified by:
typeClass in interface Schema<java.lang.Object>

mergeFrom

public void mergeFrom(Input input,
                      java.lang.Object owner)
               throws java.io.IOException
Delegates to the schema derived from the input. The owner owns the message (polymorphic) that is tied to this schema.

Specified by:
mergeFrom in interface Schema<java.lang.Object>
Throws:
java.io.IOException

writeTo

public void writeTo(Output output,
                    java.lang.Object value)
             throws java.io.IOException
Delegates to the schema derived from the value.

Specified by:
writeTo in interface Schema<java.lang.Object>
Throws:
java.io.IOException

doMergeFrom

protected abstract void doMergeFrom(Input input,
                                    Schema<java.lang.Object> derivedSchema,
                                    java.lang.Object owner)
                             throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2009-2014. All Rights Reserved.