Module org.autogui

Class GuiRepresentation.GuiReprNone

java.lang.Object
org.autogui.base.mapping.GuiRepresentation.GuiReprNone
All Implemented Interfaces:
GuiRepresentation
Enclosing interface:
GuiRepresentation

public static class GuiRepresentation.GuiReprNone extends Object implements GuiRepresentation
the empty implementation of the representation
  • Constructor Details

    • GuiReprNone

      public GuiReprNone()
  • Method Details

    • match

      public boolean match(GuiMappingContext context)
      Description copied from interface: GuiRepresentation
      match the representation with the typeElement of the context, and if succeeded, it sets this representation to the context, and it might create sub-contexts for recursive matches *
      Specified by:
      match in interface GuiRepresentation
      Parameters:
      context - the context of the repr.
      Returns:
      the matching result
    • checkAndUpdateSource

      public boolean checkAndUpdateSource(GuiMappingContext context)
      Description copied from interface: GuiRepresentation
      invoke the associated method and check the returned value whether it is updated or not. if updated, set the source of context to the value. This is non-recursive operation; GuiMappingContext recursively calls this method. The source of parent is already updated by the order of the calls.
      Specified by:
      checkAndUpdateSource in interface GuiRepresentation
      Parameters:
      context - the context of the repr.
      Returns:
      the representation is updated or not
    • toJson

      public Object toJson(GuiMappingContext context, Object source)
      Description copied from interface: GuiRepresentation
      convert the source into JSON format
      Specified by:
      toJson in interface GuiRepresentation
      Parameters:
      context - a context holds the representation
      source - the converted object
      Returns:
      JSON objects representing the source; String, Number, Boolean, List, Map or null
    • fromJson

      public Object fromJson(GuiMappingContext context, Object target, Object json)
      Description copied from interface: GuiRepresentation
      create a new value object from the JSON with treating the target as an old value, or update the target with the JSON contents. the behavior can be varied by each representation, confirmed by GuiRepresentation.isJsonSetter().
      Specified by:
      fromJson in interface GuiRepresentation
      Parameters:
      context - a context holds the representation
      target - the target object or null
      json - JSON objects representing the target String, Number, Boolean, List, Map or null
      Returns:
      created object from the json, target if provided, or null.
    • toString

      public String toString()
      Overrides:
      toString in class Object