T
- the value typepublic abstract class ValueOptionFieldAdapter<T extends ValueOption<T>> extends Object implements FieldAdapter<T>
FieldAdapter
which accepts ValueOption
.Modifier and Type | Class and Description |
---|---|
protected static class |
ValueOptionFieldAdapter.BuilderBase<S extends ValueOptionFieldAdapter.BuilderBase<S,T>,T extends FieldAdapter<?>>
A basic implementation of builder for
ValueOptionFieldAdapter . |
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_NULL_FORMAT
The default value of
NULL format. |
Constructor and Description |
---|
ValueOptionFieldAdapter()
Creates a new instance.
|
ValueOptionFieldAdapter(String nullFormat)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
clear(T property)
Clears the given property.
|
protected abstract void |
doEmit(T property,
StringBuilder output)
Emits the given non-null property value into the string builder.
|
protected abstract void |
doParse(CharSequence contents,
T property)
Parses the given non-null character sequence and set the parsed value into property.
|
void |
emit(T property,
FieldOutput output)
Extracts the given property value into the destination field.
|
void |
parse(CharSequence contents,
T property)
Extracts the given field content into the destination property.
|
public static final String DEFAULT_NULL_FORMAT
NULL
format.public ValueOptionFieldAdapter()
public ValueOptionFieldAdapter(String nullFormat)
nullFormat
- the null
value format (nullable)public void clear(T property)
FieldAdapter
clear
in interface FieldAdapter<T extends ValueOption<T>>
property
- the propertypublic void parse(CharSequence contents, T property)
FieldAdapter
parse
in interface FieldAdapter<T extends ValueOption<T>>
contents
- the field contentproperty
- the destination propertypublic void emit(T property, FieldOutput output)
FieldAdapter
emit
in interface FieldAdapter<T extends ValueOption<T>>
property
- the property valueoutput
- the destination field outputprotected abstract void doParse(CharSequence contents, T property)
contents
- the contents, never null
property
- the destination propertyIllegalArgumentException
- if the character sequence is malformed for this fieldprotected abstract void doEmit(T property, StringBuilder output)
property
- the property value, never null
nor represents null
output
- the destination bufferCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.