Package de.aristaflow.adept2.model.common.viewer
Constraints for a viewer interface:
- It must be an interface.
- All methods must be annotated with
Attribute
orAttributeSetter
. - An attribute name must only be specified once for
Attribute
and (optionally) once forAttributeSetter
. - All setters must have a single parameter.
- All getters must not be
void
and must not take any parameter. - All parameters and return values must be of the types as
specified in
ModelViewer.allowedTypesArray
, an enum or another view interface. - Naturally, the type of a setter must match the type of its getter.
- A getter may be marked as "localised", using
Attribute.localised()
, this is only valid for string types.
The translations are expected to be found in[PluginPrefix.]AttributeName.LocaleString
, where thePluginPrefix
is the optional prefix for the attributes,AttributeName
is the name of the attribute as it is specified in theAttribute
annotation andLocaleString
is the string representing the locale (e.g.de
orde_DE
.
Cf.ModelViewerTools
for tool methods. - A getter may have the
SystemDataConsumer
annotation, if it is of type int/Integer, long/Long or String. - An attribute name must not contain '[', ']' and '.'. Usage of alphabetical characters only is recommended.
- a RuntimeException is thrown, if e.g. a getter for an int
- RE on invalid string value for an enum
- RE on a string which is not a number
- A
UnresolvedParameterReferenceException
is thrown whenever an atomic non-string value can't be returned because a parameter reference is not resolved.
-
Class Summary Class Description ModelViewer Allows the creation of typed views on attribute maps.ModelViewerTools<V> Tool class for easier handling of some stuff like localisations or parameter references / system data consumers.ViewCheck Checks the model viewer interfaces for consistent annotations. -
Enum Summary Enum Description Attribute.Type Type specialisation. -
Exception Summary Exception Description UnresolvedParameterReferenceException Exception thrown when a value can't be returned because it can't be parsed because of parameter references, e.g. when a long is to be returned, but the method is a system data consumer and there is actually a parameter reference. -
Annotation Types Summary Annotation Type Description Attribute Annotates a method of a view interface, including the name of the attribute.AttributeSetter Setter for the model viewer attribute.ContainerDescription A description of the container...