Package io.protostuff.runtime
Class Field<T>
- java.lang.Object
-
- io.protostuff.runtime.Field<T>
-
- Direct Known Subclasses:
RuntimeCollectionField
,RuntimeDerivativeField
,RuntimeMapField
,RuntimeMessageField
,RuntimeObjectField
public abstract class Field<T> extends java.lang.Object
Represents a field of a message/pojo.
-
-
Field Summary
Fields Modifier and Type Field Description int
groupFilter
java.lang.String
name
int
number
boolean
repeated
WireFormat.FieldType
type
-
Constructor Summary
Constructors Constructor Description Field(WireFormat.FieldType type, int number, java.lang.String name, boolean repeated, Tag tag)
Field(WireFormat.FieldType type, int number, java.lang.String name, Tag tag)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Field<T>
copy(IdStrategy strategy)
No copy by default.protected abstract void
mergeFrom(Input input, T message)
Reads the field value into themessage
.protected abstract void
transfer(Pipe pipe, Input input, Output output, boolean repeated)
Transfer the input field to the output field.protected abstract void
writeTo(Output output, T message)
Writes the value of a field to theoutput
.
-
-
-
Field Detail
-
type
public final WireFormat.FieldType type
-
number
public final int number
-
name
public final java.lang.String name
-
repeated
public final boolean repeated
-
groupFilter
public final int groupFilter
-
-
Constructor Detail
-
Field
public Field(WireFormat.FieldType type, int number, java.lang.String name, boolean repeated, Tag tag)
-
Field
public Field(WireFormat.FieldType type, int number, java.lang.String name, Tag tag)
-
-
Method Detail
-
copy
protected Field<T> copy(IdStrategy strategy)
No copy by default.
-
writeTo
protected abstract void writeTo(Output output, T message) throws java.io.IOException
Writes the value of a field to theoutput
.- Throws:
java.io.IOException
-
mergeFrom
protected abstract void mergeFrom(Input input, T message) throws java.io.IOException
Reads the field value into themessage
.- Throws:
java.io.IOException
-
-