|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.dyuproject.protostuff.MapSchema<K,V>
public abstract class MapSchema<K,V>
A schema for a Map.
The key and value can be null (depending on the particular map impl).
The default Map message created will be an instance of HashMap.
| Nested Class Summary | |
|---|---|
static class |
MapSchema.MapWrapper<K,V>
A Map.Entry w/c wraps a Map. |
static class |
MapSchema.MessageFactories
A message factory for standard Map implementations. |
static interface |
MapSchema.MessageFactory
Creates new Map messages. |
| Field Summary | |
|---|---|
static java.lang.String |
FIELD_NAME_ENTRY
The field name of the Map.Entry. |
static java.lang.String |
FIELD_NAME_KEY
The field name of the key. |
static java.lang.String |
FIELD_NAME_VALUE
The field name of the value; |
MapSchema.MessageFactory |
messageFactory
Factory for creating Map messages. |
Pipe.Schema<java.util.Map<K,V>> |
pipeSchema
The pipe schema of the Map. |
| Constructor Summary | |
|---|---|
MapSchema()
|
|
MapSchema(MapSchema.MessageFactory messageFactory)
|
|
| Method Summary | |
|---|---|
java.lang.String |
getFieldName(int number)
|
int |
getFieldNumber(java.lang.String name)
|
boolean |
isInitialized(java.util.Map<K,V> map)
|
void |
mergeFrom(Input input,
java.util.Map<K,V> map)
|
java.lang.String |
messageFullName()
|
java.lang.String |
messageName()
|
java.util.Map<K,V> |
newMessage()
|
protected abstract void |
putValueFrom(Input input,
MapSchema.MapWrapper<K,V> wrapper,
K key)
Puts the entry(key and value), obtained from the input, into the MapWrapper. |
protected abstract K |
readKeyFrom(Input input,
MapSchema.MapWrapper<K,V> wrapper)
Reads the key from the input. |
protected abstract void |
transferKey(Pipe pipe,
Input input,
Output output,
int number,
boolean repeated)
Transfers the key from the input to the output. |
protected abstract void |
transferValue(Pipe pipe,
Input input,
Output output,
int number,
boolean repeated)
Transfers the value from the input to the output. |
java.lang.Class<? super java.util.Map<K,V>> |
typeClass()
|
protected abstract void |
writeKeyTo(Output output,
int fieldNumber,
K value,
boolean repeated)
Writes the key to the output. |
void |
writeTo(Output output,
java.util.Map<K,V> map)
|
protected abstract void |
writeValueTo(Output output,
int fieldNumber,
V value,
boolean repeated)
Writes the value to the output. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String FIELD_NAME_ENTRY
public static final java.lang.String FIELD_NAME_KEY
public static final java.lang.String FIELD_NAME_VALUE
public final MapSchema.MessageFactory messageFactory
Map messages.
public final Pipe.Schema<java.util.Map<K,V>> pipeSchema
Map.
| Constructor Detail |
|---|
public MapSchema()
public MapSchema(MapSchema.MessageFactory messageFactory)
| Method Detail |
|---|
protected abstract K readKeyFrom(Input input,
MapSchema.MapWrapper<K,V> wrapper)
throws java.io.IOException
java.io.IOException
protected abstract void putValueFrom(Input input,
MapSchema.MapWrapper<K,V> wrapper,
K key)
throws java.io.IOException
MapWrapper.
java.io.IOException
protected abstract void writeKeyTo(Output output,
int fieldNumber,
K value,
boolean repeated)
throws java.io.IOException
java.io.IOException
protected abstract void writeValueTo(Output output,
int fieldNumber,
V value,
boolean repeated)
throws java.io.IOException
java.io.IOException
protected abstract void transferKey(Pipe pipe,
Input input,
Output output,
int number,
boolean repeated)
throws java.io.IOException
java.io.IOException
protected abstract void transferValue(Pipe pipe,
Input input,
Output output,
int number,
boolean repeated)
throws java.io.IOException
java.io.IOExceptionpublic final java.lang.String getFieldName(int number)
getFieldName in interface Schema<java.util.Map<K,V>>public final int getFieldNumber(java.lang.String name)
getFieldNumber in interface Schema<java.util.Map<K,V>>public final boolean isInitialized(java.util.Map<K,V> map)
isInitialized in interface Schema<java.util.Map<K,V>>public final java.lang.String messageFullName()
messageFullName in interface Schema<java.util.Map<K,V>>public final java.lang.String messageName()
messageName in interface Schema<java.util.Map<K,V>>public final java.lang.Class<? super java.util.Map<K,V>> typeClass()
typeClass in interface Schema<java.util.Map<K,V>>public final java.util.Map<K,V> newMessage()
newMessage in interface Schema<java.util.Map<K,V>>
public final void mergeFrom(Input input,
java.util.Map<K,V> map)
throws java.io.IOException
mergeFrom in interface Schema<java.util.Map<K,V>>java.io.IOException
public final void writeTo(Output output,
java.util.Map<K,V> map)
throws java.io.IOException
writeTo in interface Schema<java.util.Map<K,V>>java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||