public class StringListProperty extends StringProperty
StringProperty
that stores a list of String
values that are enclosed with
pipe-symbols.AbstractProperty.PropertyBuilder<T extends AbstractProperty<? extends V>>
Modifier and Type | Field and Description |
---|---|
private static char |
DEFAULT_CSV_SEPARATOR |
private static String |
DEFAULT_CSV_SEPARATOR_STRING |
private static char |
SEPARATOR |
private static String |
SEPARATOR_PATTERN |
TYPE
PROPERTY_TYPE
NO_PROPERTIES
Constructor and Description |
---|
StringListProperty(String name,
Bean bean)
The constructor.
|
StringListProperty(String name,
Bean bean,
AbstractValidator<? super String> validator)
The constructor.
|
StringListProperty(String name,
Bean bean,
Supplier<String> expression)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(String element,
boolean distinct) |
private List<String> |
asList() |
boolean |
contains(String element) |
protected boolean |
doSetValue(String newValue)
Called from
AbstractValueProperty.setValue(Object) . |
String |
getValueAsCsv() |
String |
getValueAsCsv(String separator) |
List<String> |
getValueAsList() |
Set<String> |
getValueAsSet() |
boolean |
remove(String element) |
void |
setValueAsCollection(Collection<String> list) |
void |
setValueAsCsv(String csv) |
void |
setValueAsCsv(String csv,
char separator) |
void |
setValueAsCsv(String csv,
char separator,
boolean trim) |
protected void |
toJson(javax.json.stream.JsonGenerator json,
String stringValue) |
private String |
wrap(String value) |
doGetValue, fromJson, withValdidator
addListener, addListener, fireValueChangedEvent, removeListener, removeListener
bind, bindBidirectional, clearValidationResult, copy, equals, getReadOnly, getValue, hashCode, invalidated, isBound, isReadOnly, isValid, markInvalid, requireWritable, setValue, unbind, unbindBidirectional, validate
assignValueFrom, clone, copy, copy, copy, copy, copy, getBean, getJsonUtil, getName, getValidator, isMandatory, toJson, toString, withValdidator
finalize, getClass, notify, notifyAll, wait, wait, wait
get, getValueSafe, length, set
concat, getType, greaterThan, greaterThan, greaterThanOrEqualTo, greaterThanOrEqualTo, isEmpty, isEqualTo, isEqualTo, isEqualToIgnoreCase, isEqualToIgnoreCase, isNotEmpty, isNotEqualTo, isNotEqualTo, isNotEqualToIgnoreCase, isNotEqualToIgnoreCase, isNotNull, isNull, lessThan, lessThan, lessThanOrEqualTo, lessThanOrEqualTo
isEqualTo, isNotEqualTo
getBean, getName
addListener, getValue, removeListener
getValue
toJson
getReadOnly, getReadOnly, isMandatory, isReadOnly, isValid, validate
bind, bindBidirectional, isBound, unbind, unbindBidirectional
setValue
private static final char SEPARATOR
private static final String SEPARATOR_PATTERN
private static final char DEFAULT_CSV_SEPARATOR
private static final String DEFAULT_CSV_SEPARATOR_STRING
public StringListProperty(String name, Bean bean)
name
- - see AbstractProperty.getName()
.bean
- - see AbstractProperty.getBean()
.public StringListProperty(String name, Bean bean, AbstractValidator<? super String> validator)
name
- - see AbstractProperty.getName()
.bean
- - see AbstractProperty.getBean()
.validator
- - see AbstractValueProperty.validate()
.public StringListProperty(String name, Bean bean, Supplier<String> expression)
name
- - see AbstractProperty.getName()
.bean
- - see AbstractProperty.getBean()
.expression
- the Supplier
providing
the actual value
.protected boolean doSetValue(String newValue)
AbstractValueProperty
AbstractValueProperty.setValue(Object)
.doSetValue
in class StringProperty
newValue
- the new value
to set.true
if the value
has changed, false
otherwise.public boolean remove(String element)
element
- the element to remove from the value as list
.true
if the given element was previously present and is now removed so the value actually has
changed, false
otherwise (if not present and no change).List.remove(Object)
public boolean add(String element, boolean distinct)
element
- the element to add to the value as list
.distinct
- true
if the value should be treated as Set
and this method should not change the
value
if the given element
is already present
,
false
otherwise.true
if the value
has changed, false
otherwise (if distinct
was
true
and the given element
was already present
).List.add(Object)
public boolean contains(String element)
element
- the element to check.true
if the given element
is contained in the value as list
.List.contains(Object)
public void setValueAsCollection(Collection<String> list)
list
- the List
of elements to set as separated string value
.public String getValueAsCsv(String separator)
separator
- the character used as separator.value
with elements separated by the given separator
.public void setValueAsCsv(String csv)
csv
- the new value
as comma separated value (e.g. "a,b,c").public void setValueAsCsv(String csv, char separator)
csv
- the new value
with elements separated by the given separator
.separator
- the character used as separator.public void setValueAsCsv(String csv, char separator, boolean trim)
protected void toJson(javax.json.stream.JsonGenerator json, String stringValue)
toJson
in class StringProperty
json
- the JsonGenerator
.stringValue
- the value
.AbstractProperty.toJson(JsonGenerator)
Copyright © 2001–2016 mmm-Team. All rights reserved.