Class StringExpression
- All Implemented Interfaces:
-
Observable,ObservableObjectValue<String>,ObservableStringValue,ObservableValue<String>
- Direct Known Subclasses:
-
ReadOnlyStringProperty,StringBinding
public abstract class StringExpression
extends Object
implements ObservableStringValue StringExpression is an ObservableStringValue plus additional convenience methods to generate bindings in a fluent style. A concrete sub-class of StringExpression has to implement the method ObservableObjectValue.get(), which provides the actual value of this expression.
Note: all implementation of BooleanBinding returned by the comparisons in this class consider a String that is null equal to an empty String.
- Since:
- JavaFX 2.0
Constructor Summary
| Constructor | Description |
|---|---|
StringExpression() | Creates a default StringExpression. |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
StringExpression | concat(Object other) | Returns a StringExpression that holds the value of this StringExpression concatenated with another Object. |
String | getValueSafe() | Returns usually the value of this StringExpression. |
BooleanBinding | greaterThan(String other) | Creates a new BooleanBinding that holds true if this StringExpression is greater than a constant value. |
BooleanBinding | greaterThan(ObservableStringValue other) | Creates a new BooleanBinding that holds true if this StringExpression is greater than another ObservableStringValue. |
BooleanBinding | greaterThanOrEqualTo(String other) | Creates a new BooleanBinding that holds true if this StringExpression is greater than or equal to a constant value. |
BooleanBinding | greaterThanOrEqualTo(ObservableStringValue other) | Creates a new BooleanBinding that holds true if this StringExpression is greater than or equal to another ObservableStringValue. |
BooleanBinding | isEmpty() | |
BooleanBinding | isEqualTo(String other) | |
BooleanBinding | isEqualTo(ObservableStringValue other) | |
BooleanBinding | isEqualToIgnoreCase(String other) | Creates a new BooleanBinding that holds true if this StringExpression is equal to a constant value ignoring case. |
BooleanBinding | isEqualToIgnoreCase(ObservableStringValue other) | Creates a new BooleanBinding that holds true if this and another ObservableStringValue are equal ignoring case. |
BooleanBinding | isNotEmpty() | |
BooleanBinding | isNotEqualTo(String other) | Creates a new BooleanBinding that holds true if this StringExpression is not equal to a constant value. |
BooleanBinding | isNotEqualTo(ObservableStringValue other) | Creates a new BooleanBinding that holds true if this and another ObservableStringValue are not equal. |
BooleanBinding | isNotEqualToIgnoreCase(String other) | Creates a new BooleanBinding that holds true if this StringExpression is not equal to a constant value ignoring case. |
BooleanBinding | isNotEqualToIgnoreCase(ObservableStringValue other) | Creates a new BooleanBinding that holds true if this and another ObservableStringValue are not equal ignoring case. |
BooleanBinding | isNotNull() | |
BooleanBinding | isNull() | |
IntegerBinding | length() | Creates a new IntegerBinding that holds the length of this StringExpression. |
BooleanBinding | lessThan(String other) | Creates a new BooleanBinding that holds true if this StringExpression is less than a constant value. |
BooleanBinding | lessThan(ObservableStringValue other) | Creates a new BooleanBinding that holds true if this StringExpression is less than another ObservableStringValue. |
BooleanBinding | lessThanOrEqualTo(String other) | Creates a new BooleanBinding that holds true if this StringExpression is less than or equal to a constant value. |
BooleanBinding | lessThanOrEqualTo(ObservableStringValue other) | Creates a new BooleanBinding that holds true if this StringExpression is less than or equal to another ObservableStringValue. |
static StringExpression | stringExpression(ObservableValue<?> value) | Returns a StringExpression that wraps a ObservableValue. |
Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods declared in interface javafx.beans.Observable
addListener, removeListener
Methods declared in interface javafx.beans.value.ObservableObjectValue
get
Methods declared in interface javafx.beans.value.ObservableValue
addListener, getValue, removeListener
Constructor Details
StringExpression
public StringExpression()
StringExpression.Method Details
getValueSafe
public final String getValueSafe()
StringExpression. Only if the value is null an empty String is returned instead.- Returns:
- the value of this
StringExpressionor the emptyString
stringExpression
public static StringExpression stringExpression(ObservableValue<?> value)
StringExpression that wraps a ObservableValue. If the ObservableValue is already a StringExpression, it will be returned. Otherwise a new StringBinding is created that holds the value of the ObservableValue converted to a String.- Parameters:
-
value- The sourceObservableValue - Returns:
- A
StringExpressionthat wraps theObservableValueif necessary - Throws:
-
NullPointerException- ifvalueisnull
concat
public StringExpression concat(Object other)
StringExpression that holds the value of this StringExpression concatenated with another Object. If the value of this StringExpression changes, the value of the resulting StringExpression is updated automatically. Also if the other Object is an implementation of ObservableValue, changes in the other Object are reflected automatically in the resulting StringExpression.
- Parameters:
-
other- the otherObject - Returns:
- the new
StringExpression
isEqualTo
public BooleanBinding isEqualTo(ObservableStringValue other)
BooleanBinding that holds true if this and another ObservableStringValue are equal. Note: In this comparison a String that is null is considered equal to an empty String.
- Parameters:
-
other- the constant value - Returns:
- the new
BooleanBinding
isEqualTo
public BooleanBinding isEqualTo(String other)
BooleanBinding that holds true if this StringExpression is equal to a constant value. Note: In this comparison a String that is null is considered equal to an empty String.
- Parameters:
-
other- the constant value - Returns:
- the new
BooleanBinding
isNotEqualTo
public BooleanBinding isNotEqualTo(ObservableStringValue other)
BooleanBinding that holds true if this and another ObservableStringValue are not equal. Note: In this comparison a String that is null is considered equal to an empty String.
- Parameters:
-
other- the constant value - Returns:
- the new
BooleanBinding
isNotEqualTo
public BooleanBinding isNotEqualTo(String other)
BooleanBinding that holds true if this StringExpression is not equal to a constant value. Note: In this comparison a String that is null is considered equal to an empty String.
- Parameters:
-
other- the constant value - Returns:
- the new
BooleanBinding
isEqualToIgnoreCase
public BooleanBinding isEqualToIgnoreCase(ObservableStringValue other)
BooleanBinding that holds true if this and another ObservableStringValue are equal ignoring case. Note: In this comparison a String that is null is considered equal to an empty String.
- Parameters:
-
other- the secondObservableStringValue - Returns:
- the new
BooleanBinding
isEqualToIgnoreCase
public BooleanBinding isEqualToIgnoreCase(String other)
BooleanBinding that holds true if this StringExpression is equal to a constant value ignoring case. Note: In this comparison a String that is null is considered equal to an empty String.
- Parameters:
-
other- the constant value - Returns:
- the new
BooleanBinding
isNotEqualToIgnoreCase
public BooleanBinding isNotEqualToIgnoreCase(ObservableStringValue other)
BooleanBinding that holds true if this and another ObservableStringValue are not equal ignoring case. Note: In this comparison a String that is null is considered equal to an empty String.
- Parameters:
-
other- the secondObservableStringValue - Returns:
- the new
BooleanBinding
isNotEqualToIgnoreCase
public BooleanBinding isNotEqualToIgnoreCase(String other)
BooleanBinding that holds true if this StringExpression is not equal to a constant value ignoring case. Note: In this comparison a String that is null is considered equal to an empty String.
- Parameters:
-
other- the constant value - Returns:
- the new
BooleanBinding
greaterThan
public BooleanBinding greaterThan(ObservableStringValue other)
BooleanBinding that holds true if this StringExpression is greater than another ObservableStringValue. Note: In this comparison a String that is null is considered equal to an empty String.
- Parameters:
-
other- the secondObservableStringValue - Returns:
- the new
BooleanBinding
greaterThan
public BooleanBinding greaterThan(String other)
BooleanBinding that holds true if this StringExpression is greater than a constant value. Note: In this comparison a String that is null is considered equal to an empty String.
- Parameters:
-
other- the constant value - Returns:
- the new
BooleanBinding
lessThan
public BooleanBinding lessThan(ObservableStringValue other)
BooleanBinding that holds true if this StringExpression is less than another ObservableStringValue. Note: In this comparison a String that is null is considered equal to an empty String.
- Parameters:
-
other- the secondObservableStringValue - Returns:
- the new
BooleanBinding
lessThan
public BooleanBinding lessThan(String other)
BooleanBinding that holds true if this StringExpression is less than a constant value. Note: In this comparison a String that is null is considered equal to an empty String.
- Parameters:
-
other- the constant value - Returns:
- the new
BooleanBinding
greaterThanOrEqualTo
public BooleanBinding greaterThanOrEqualTo(ObservableStringValue other)
BooleanBinding that holds true if this StringExpression is greater than or equal to another ObservableStringValue. Note: In this comparison a String that is null is considered equal to an empty String.
- Parameters:
-
other- the secondObservableStringValue - Returns:
- the new
BooleanBinding
greaterThanOrEqualTo
public BooleanBinding greaterThanOrEqualTo(String other)
BooleanBinding that holds true if this StringExpression is greater than or equal to a constant value. Note: In this comparison a String that is null is considered equal to an empty String.
- Parameters:
-
other- the constant value - Returns:
- the new
BooleanBinding
lessThanOrEqualTo
public BooleanBinding lessThanOrEqualTo(ObservableStringValue other)
BooleanBinding that holds true if this StringExpression is less than or equal to another ObservableStringValue. Note: In this comparison a String that is null is considered equal to an empty String.
- Parameters:
-
other- the secondObservableStringValue - Returns:
- the new
BooleanBinding
lessThanOrEqualTo
public BooleanBinding lessThanOrEqualTo(String other)
BooleanBinding that holds true if this StringExpression is less than or equal to a constant value. Note: In this comparison a String that is null is considered equal to an empty String.
- Parameters:
-
other- the constant value - Returns:
- the new
BooleanBinding
isNull
public BooleanBinding isNull()
- Returns:
- the new
BooleanBinding
isNotNull
public BooleanBinding isNotNull()
- Returns:
- the new
BooleanBinding
length
public IntegerBinding length()
IntegerBinding that holds the length of this StringExpression. Note: If the value of this StringExpression is null, the length is considered to be 0.
- Returns:
- the new
IntegerBinding - Since:
- JavaFX 8.0
isEmpty
public BooleanBinding isEmpty()
BooleanBinding that holds true if this StringExpression is empty. Note: If the value of this StringExpression is null, it is considered to be empty.
- Returns:
- the new
BooleanBinding - Since:
- JavaFX 8.0
isNotEmpty
public BooleanBinding isNotEmpty()
BooleanBinding that holds true if this StringExpression is not empty. Note: If the value of this StringExpression is null, it is considered to be empty.
- Returns:
- the new
BooleanBinding - Since:
- JavaFX 8.0
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.