Class ModelViewerTools<V>

java.lang.Object
de.aristaflow.adept2.model.common.viewer.ModelViewerTools<V>
Type Parameters:
V - The viewer type.

public class ModelViewerTools<V> extends Object
Tool class for easier handling of some stuff like localisations or parameter references / system data consumers.
Author:
Kevin Goeser
  • Constructor Details

    • ModelViewerTools

      public ModelViewerTools(Class<V> viewer, Map<String,String> attributes)
      Default constructor.
      Parameters:
      viewer -
      attributes -
    • ModelViewerTools

      protected ModelViewerTools(Class<V> viewer, String prefix, Map<String,String> attributes)
      Internal constructor, allowing to set a prefix, e.g. for nested views.
      Parameters:
      viewer -
      prefix -
      attributes -
  • Method Details

    • getLocalisedAttributes

      public Set<String> getLocalisedAttributes()
      Returns the names of the attributes which are localised.
      Returns:
      The names of the attributes which are localised.
    • setTranslation

      public void setTranslation(String attribute, Map<String,String> translations)
      Set the translations for
      Parameters:
      attribute - The attribute to be translated.
      translations -
    • getSystemDataConsumerAttributes

      public Map<String,SystemDataConsumer> getSystemDataConsumerAttributes()
      Returns the names of the attributes which are system data consumers.
      Returns:
      The names of the attributes which are system data consumers.
    • getAttributes

      public Map<String,Attribute> getAttributes()
      Returns all attributes of the viewer class.
      Returns:
      All attributes of the viewer class.
    • getAttributeGetters

      public Map<String,Method> getAttributeGetters()
      Returns:
      All getter methods by attribute.
    • getComplexMethods

      public Map<String,Method> getComplexMethods()
      Returns:
      The getter methods of the complex attributes.
    • isComplexAttribute

      public static boolean isComplexAttribute(Class<?> clazz)