T
- The node type being built.B
- The builder type.public static interface MString.AbstractBuilder<T,B> extends MNode.Builder<T,B>
This is the super-type of all type specific field metadata builders.
Modifier and Type | Method and Description |
---|---|
B |
allowsEmpty(boolean allowsEmpty)
Sets the 'allowsEmpty' option for the field.
|
B |
defaultValue(String value)
Sets a default value that required occurrences of the field are to be
initialized to.
|
build, name
B defaultValue(String value) throws IllegalArgumentException
value
- an initial valueIllegalArgumentException
- if value
is null, or is
invalid for the type, or is incompatible with the 'allows
empty' valueB allowsEmpty(boolean allowsEmpty)
By default MField.FieldType.STRING
type fields allow empty
input but other sub-types do not. This may be used to change this
default behavior.
When a field allows empty input and an empty (zero length string) is parsed, its internal representation will be a zero length string and not an object of the default type for the field.
allowsEmpty
- true to allow the field to parse empty input or
false if parsing of the field should fail upon encountering
empty inputIllegalArgumentException
- if setting to false and the default
value is emptyCopyright © 2016 Push Technology Ltd. All Rights Reserved.