|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.dyuproject.protostuff.runtime.EnumIO<E>
public abstract class EnumIO<E extends java.lang.Enum<E>>
Determines how enums are serialized/deserialized. Default is BY_NUMBER. To enable BY_NAME, set the property "protostuff.runtime.enums_by_name=true".
| Nested Class Summary | |
|---|---|
static class |
EnumIO.ByName<E extends java.lang.Enum<E>>
Reads the enum by its name. |
static class |
EnumIO.ByNumber<E extends java.lang.Enum<E>>
Reads the enum by its number. |
| Field Summary | |
|---|---|
java.lang.Class<E> |
enumClass
The enum class. |
| Constructor Summary | |
|---|---|
EnumIO(java.lang.Class<E> enumClass)
|
|
| Method Summary | ||
|---|---|---|
MapSchema.MessageFactory |
getEnumMapFactory()
Returns the factory for an EnumMap (lazy). |
|
CollectionSchema.MessageFactory |
getEnumSetFactory()
Returns the factory for an EnumSet (lazy). |
|
|
newEnumMap()
Returns an empty EnumMap. |
|
java.util.EnumSet<E> |
newEnumSet()
Returns an empty EnumSet. |
|
abstract E |
readFrom(Input input)
Read the enum from the input. |
|
static void |
transfer(Pipe pipe,
Input input,
Output output,
int number,
boolean repeated)
Transfers the Enum from the input to the output. |
|
static void |
writeTo(Output output,
int number,
boolean repeated,
java.lang.Enum<?> e)
Writes the Enum to the output. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final java.lang.Class<E extends java.lang.Enum<E>> enumClass
| Constructor Detail |
|---|
public EnumIO(java.lang.Class<E> enumClass)
| Method Detail |
|---|
public static void writeTo(Output output,
int number,
boolean repeated,
java.lang.Enum<?> e)
throws java.io.IOException
Enum to the output.
java.io.IOException
public static void transfer(Pipe pipe,
Input input,
Output output,
int number,
boolean repeated)
throws java.io.IOException
Enum from the input to the output.
java.io.IOExceptionpublic CollectionSchema.MessageFactory getEnumSetFactory()
public MapSchema.MessageFactory getEnumMapFactory()
public java.util.EnumSet<E> newEnumSet()
EnumSet.
public <V> java.util.EnumMap<E,V> newEnumMap()
EnumMap.
public abstract E readFrom(Input input)
throws java.io.IOException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||