|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.dyuproject.protostuff.CustomSchema<T>
public abstract class CustomSchema<T>
A schema (helper class) that wraps another schema and allows its subclasses to override certain methods for more customization.
| Field Summary | |
|---|---|
protected Schema<T> |
schema
|
| Constructor Summary | |
|---|---|
CustomSchema(Schema<T> schema)
|
|
| Method Summary | |
|---|---|
java.lang.String |
getFieldName(int number)
Gets the field name associated with the number. |
int |
getFieldNumber(java.lang.String name)
Gets the field number associated with the name. |
boolean |
isInitialized(T message)
Returns true if there is no required field or if all the required fields are set. |
void |
mergeFrom(Input input,
T message)
Deserializes a message/object from the input. |
java.lang.String |
messageFullName()
Returns the full name of the message tied to this schema. |
java.lang.String |
messageName()
Returns the simple name of the message tied to this schema. |
T |
newMessage()
Creates the message/object tied to this schema. |
java.lang.Class<? super T> |
typeClass()
Gets the class of the message. |
void |
writeTo(Output output,
T message)
Serializes a message/object to the output. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Schema<T> schema
| Constructor Detail |
|---|
public CustomSchema(Schema<T> schema)
| Method Detail |
|---|
public java.lang.String getFieldName(int number)
Schemareturn String.valueOf(number);
getFieldName in interface Schema<T>public int getFieldNumber(java.lang.String name)
Schemareturn Integer.parseInt(name);
getFieldNumber in interface Schema<T>public boolean isInitialized(T message)
Schema
isInitialized in interface Schema<T>
public void mergeFrom(Input input,
T message)
throws java.io.IOException
Schemainput.
mergeFrom in interface Schema<T>java.io.IOExceptionpublic java.lang.String messageFullName()
Schema
messageFullName in interface Schema<T>public java.lang.String messageName()
Schema
messageName in interface Schema<T>public T newMessage()
Schema
newMessage in interface Schema<T>public java.lang.Class<? super T> typeClass()
Schema
typeClass in interface Schema<T>
public void writeTo(Output output,
T message)
throws java.io.IOException
Schemaoutput.
writeTo in interface Schema<T>java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||