A {@link NameValue} may have an {@linkplain #getWhitespaceReplacement() associated whitespace replacementString
} that will be used to replace any sequence ofone or more consecutive whitespace characters that occur after any {@linkplain Name#computeValue() interpolation} of a {@link NameValue} within the context of a given {@linkplain Name#getNamed() owner} when that {@link NameValue} is not{@linkplain #isAtomic() atomic}.
A {@link NameValue}, once initialized with a {@linkplain #setValue(String) value} and an {@linkplain #setAtomic(boolean) atomicity}—whether via {@linkplain #NameValue(String,boolean,String) the constructor} or the {@link #setValue(String)}and {@link #setAtomic(boolean)} and {@link #setWhitespaceReplacement(String)} methods—can be treated asthough it is immutable. Subsequent attempts to call either the {@link #setValue(String)} or {@link #setAtomic(boolean)} or {@link #setWhitespaceReplacement(String)} methods will fail with {@link IllegalStateException}s.
Two {@link NameValue}s are {@linkplain #equals(Object) equal} iftheir {@linkplain AbstractValued#getValue() values} are {@linkplain String#equals(Object) equal} and if they are both {@linkplain #isAtomic() atomic} and if their {@linkplain #getWhitespaceReplacement() whitespace replacementString
}s are {@linkplain String#equals(Object) equal}.
This class is designed to be treated as immutable once fully {@linkplain #isInitialized() initialized}. Consequently, certain methods, like {@link #setAtomic(boolean)} and {@link #setValue(String)} and {@link #setWhitespaceReplacement(String)}, may only be called once with a given parameter value.
Methods and fields that might otherwise be {@code final} areexplicitly left non- {@code final} so that this class may be used asa JPA entity.
@author Laird Nelson @see Name @see AbstractValued @see Named @see #setValue(String) @see #setAtomic(boolean) @see #setWhitespaceReplacement(String) @see #isInitialized()
|
|