de.smartics.properties.api.core.domain
Interface PropertyValueRange<T>

Package class diagram package PropertyValueRange
Type Parameters:
T - the type of the property value.
All Superinterfaces:
Serializable
All Known Implementing Classes:
CollectionPropertyValueRange, EnumeratedPropertyValueRange

public interface PropertyValueRange<T>
     
     
extends Serializable

Defines the possible values for a property.


Method Summary
 T fromString(String valueAsString)
          Constructs a value of the real type T from the given string representation of a value of the range.
 List<T> getValues()
          Returns the list of values provided by the property range.
 boolean isCommented()
          Checks whether or not the values have comments.
 String toString()
          Returns the list of possible values or any form to show the the range of values to select from using the default locale.
 String toString(Locale locale)
          Returns the list of possible values or any form to show the the range of values to select from.
 

Method Detail

getValues

List<T> getValues()
Returns the list of values provided by the property range. If the empty list is returned, the values of this range are not enumerable. In this case the method toString() returns information about the values that should be rendered instead.

Example:

For instance, if the range is restricted to prime numbers, this
method returns the empty list and the <A HREF="../../../../../../de/smartics/properties/api/core/domain/PropertyValueRange.html#toString()"><CODE>toString()</CODE></A> method returns the
descriptive text
"Only prime numbers are allowed as values for this property.".

Returns:
the list of values provided by the property range.

isCommented

boolean isCommented()
Checks whether or not the values have comments.

Returns:
true if the values have comments, false if the values have no comments.

fromString

T fromString(String valueAsString)
             throws IllegalArgumentException
Constructs a value of the real type T from the given string representation of a value of the range.

Parameters:
valueAsString - the string representation of the value.
Returns:
the value of type T.
Throws:
IllegalArgumentException - if the given string argument cannot be parsed and is therefore illegal to construct an instance of type <T>.

toString

String toString(Locale locale)
Returns the list of possible values or any form to show the the range of values to select from. Only in the latter case the locale is relevant. Localization of property values is (currently) out of scope.

Parameters:
locale - the locale to use for formatting.
Returns:
the list of possible values or any form to show the the range of values to select from.

toString

String toString()
Returns the list of possible values or any form to show the the range of values to select from using the default locale.

Overrides:
toString in class Object
Returns:
the list of possible values or any form to show the the range of values to select from.


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.