T - the value typepublic abstract class ValueOptionPropertyAdapter<T extends ValueOption<T>> extends Object implements PropertyAdapter<T>
PropertyAdapter for ValueOption.| Modifier and Type | Class and Description |
|---|---|
protected static class |
ValueOptionPropertyAdapter.BuilderBase<S extends ValueOptionPropertyAdapter.BuilderBase<S,T>,T extends PropertyAdapter<?>>
A basic implementation of builder for
ValueOptionPropertyAdapter. |
static class |
ValueOptionPropertyAdapter.NullStyle
A kind of output style of
null properties. |
| Modifier and Type | Field and Description |
|---|---|
static ValueOptionPropertyAdapter.NullStyle |
DEFAULT_NULL_STYLE
The default value of
null style. |
| Modifier | Constructor and Description |
|---|---|
protected |
ValueOptionPropertyAdapter(ValueOptionPropertyAdapter.BuilderBase<?,?> builder)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
absent(T property)
Sets "absent" value into the given property.
|
protected abstract void |
doRead(ValueReader reader,
T property)
Reads a value and set it into the given property.
|
protected abstract void |
doWrite(T property,
ValueWriter writer)
Writes a value from the given property.
|
void |
read(ValueReader reader,
T property)
Reads a value and set it into the given property.
|
void |
write(T property,
ValueWriter writer)
Writes a value from the given property.
|
public static final ValueOptionPropertyAdapter.NullStyle DEFAULT_NULL_STYLE
null style.protected ValueOptionPropertyAdapter(ValueOptionPropertyAdapter.BuilderBase<?,?> builder)
builder - the source builderpublic void absent(T property)
PropertyAdapterabsent in interface PropertyAdapter<T extends ValueOption<T>>property - the destination propertypublic final void read(ValueReader reader, T property) throws IOException
PropertyAdapterread in interface PropertyAdapter<T extends ValueOption<T>>reader - the source readerproperty - the destination propertyIOException - IOException if I/O error was occurredpublic void write(T property, ValueWriter writer) throws IOException
PropertyAdapterwrite in interface PropertyAdapter<T extends ValueOption<T>>property - the source propertywriter - the destination writerIOException - if I/O error was occurredprotected abstract void doRead(ValueReader reader, T property) throws IOException
reader - the source reader, never holds nullproperty - the destination propertyIOException - IOException if I/O error was occurredRuntimeException - if the property value is not a suitable for the destination propertyprotected abstract void doWrite(T property, ValueWriter writer) throws IOException
property - the source property, never holds nullwriter - the destination writerIOException - if I/O error was occurredCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.