API Review: additional methods for StringExpression

Michael Heinrichs michael.heinrichs at oracle.com
Mon Sep 17 04:25:46 PDT 2012


I propose six new methods in the high level binding API, adding new functionality for ObservableStringValue's. JIRA issue: http://javafx-jira.kenai.com/browse/RT-21487

In StringExpression:
public IntegerBinding length();
public BooleanBinding isEmpty();
public BooleanBinding isNotEmpty();

In Bindings:
public static IntegerBinding length(ObservableStringValue);
public static BooleanBinding isEmpty(ObservableStringValue);
public static BooleanBinding isNotEmpty(ObservableStringValue);

As usual in the binding API, null is treated similar to an empty String, i.e. length() will return 0, isEmpty() will return true, if the value of an ObservableStringValue is null.

For consistency I would also like to add isNotEmpty() methods for collections in the Bindings class:
public static <E> BooleanBinding isNotEmpty(ObservableList<E> op);
public static <K, V> BooleanBinding isNotEmpty(ObservableMap<K, V> op);
public static <E> BooleanBinding isNotEmpty(ObservableSet<E> op);


More information about the openjfx-dev mailing list