public class ModelViewer
extends java.lang.Object
Constraints for the view:
TODO unset attributes: return default values? "not-existing-value" like e.g. INTEGER_MIN_VALUE? => define values!
TODO exception handling: external handler, default handlers... above -> default values?
TODO annotation for the interface, e.g. a description etc.
| Modifier and Type | Field and Description |
|---|---|
protected static java.util.Set<java.lang.Class<?>> |
allowedConsumerTypes
The set of types which are allowed to be
SystemDataConsumer. |
protected static java.util.Set<java.lang.Class<?>> |
allowedTypes
Set of types, which are allowed as return values and parameters.
|
static java.lang.Class<?>[] |
allowedTypesArray
Array of types, which are allowed as return values and parameters.
|
| Constructor and Description |
|---|
ModelViewer() |
| Modifier and Type | Method and Description |
|---|---|
static <V> V |
createNew(java.lang.Class<V> view)
Create a new, empty view for performing changes.
|
static <V> V |
createView(java.util.Map<java.lang.String,java.lang.String> attributes,
java.lang.Class<V> view)
Creates a new view on the given data, implementing the given interface.
|
static <V> V |
createView(java.util.Map<java.lang.String,java.lang.String> attributes,
java.lang.Class<V> view,
java.util.Locale locale)
Creates a new view on the given data, implementing the given interface.
|
protected static <V> V |
createView(java.util.Map<java.lang.String,java.lang.String> attributes,
java.lang.Class<V> view,
java.lang.String prefix,
java.util.Locale locale)
Creates a translating view, returning the values for the given locale.
|
public static final java.lang.Class<?>[] allowedTypesArray
protected static final java.util.Set<java.lang.Class<?>> allowedTypes
protected static final java.util.Set<java.lang.Class<?>> allowedConsumerTypes
SystemDataConsumer.public static <V> V createView(java.util.Map<java.lang.String,java.lang.String> attributes,
java.lang.Class<V> view)
The interface needs to match the constraints provided in the class
description of ModelViewer.
V - The type of the view.attributes - The data for the view.view - The view interface.view on the attributes. The returned
object must only be accessed via the designated view interface!public static <V> V createView(java.util.Map<java.lang.String,java.lang.String> attributes,
java.lang.Class<V> view,
java.util.Locale locale)
The interface needs to match the constraints provided in the class
description of ModelViewer.
V - The type of the view.attributes - The data for the view.view - The view interface.locale - The locale for a translated view.view on the attributes. The returned
object must only be accessed via the designated view interface!public static <V> V createNew(java.lang.Class<V> view)
V - view - protected static <V> V createView(java.util.Map<java.lang.String,java.lang.String> attributes,
java.lang.Class<V> view,
java.lang.String prefix,
java.util.Locale locale)
V - attributes - view - prefix - Prefix, if not "", it must end with a '.'.locale -