Package de.aristaflow.adept2.model.common.viewer


package de.aristaflow.adept2.model.common.viewer
Constraints for a viewer interface:
  • It must be an interface.
  • All methods must be annotated with Attribute or AttributeSetter.
  • An attribute name must only be specified once for Attribute and (optionally) once for AttributeSetter.
  • 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 the PluginPrefix is the optional prefix for the attributes, AttributeName is the name of the attribute as it is specified in the Attribute annotation and LocaleString is the string representing the locale (e.g. de or de_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.
TODO specify handling of incomplete data - currently
  • 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
    Description
    Annotates a method of a view interface, including the name of the attribute.
    Type specialisation.
    Setter for the model viewer attribute.
    A description of the container...
    Allows the creation of typed views on attribute maps.
    Tool class for easier handling of some stuff like localisations or parameter references / system data consumers.
    Exception thrown when a value can't be returned because it can't be parsed because of parameter references, e.g.
    Checks the model viewer interfaces for consistent annotations.