java.lang.Object
org.autogui.base.mapping.GuiReprSet
- All Implemented Interfaces:
GuiRepresentation
a composition of representations.
if
match(GuiMappingContext)
matches a member representation, it immediately stops the matching and returns true.
the matched member representation will be set to the context-
Nested Class Summary
Nested classes/interfaces inherited from interface org.autogui.base.mapping.GuiRepresentation
GuiRepresentation.GuiReprNone
-
Field Summary
FieldsFields inherited from interface org.autogui.base.mapping.GuiRepresentation
NONE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd
(GuiRepresentation... rs) boolean
checkAndUpdateSource
(GuiMappingContext context) the class is basically used for matching; so the definition of the method is useless.fromJson
(GuiMappingContext context, Object target, Object json) create a new value object from the JSON with treating the target as an old value, or update the target with the JSON contents.insert
(GuiRepresentation... rs) boolean
match
(GuiMappingContext context) 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 *toJson
(GuiMappingContext context, Object source) convert the source into JSON formattoString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.autogui.base.mapping.GuiRepresentation
continueCheckAndUpdateSourceForChildren, fromHumanReadableString, fromJsonWithNamed, isJsonSetter, isTaskRunnerUsedFor, matchAndSetNotifiersAsInit, setNotifiersTree, shutdown, toHumanReadableString, toJsonWithNamed, toStringHeader
-
Field Details
-
representations
-
-
Constructor Details
-
GuiReprSet
public GuiReprSet()
-
-
Method Details
-
add
-
insert
-
match
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 interfaceGuiRepresentation
- Parameters:
context
- the context of the repr.- Returns:
- the matching result
-
checkAndUpdateSource
the class is basically used for matching; so the definition of the method is useless.- Specified by:
checkAndUpdateSource
in interfaceGuiRepresentation
- Parameters:
context
- the context of the repr.- Returns:
- the representation is updated or not
-
toJson
Description copied from interface:GuiRepresentation
convert the source into JSON format -
fromJson
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 byGuiRepresentation.isJsonSetter()
.- Specified by:
fromJson
in interfaceGuiRepresentation
- Parameters:
context
- a context holds the representationtarget
- the target object or nulljson
- JSON objects representing the targetString
,Number
,Boolean
,List
,Map
or null- Returns:
- created object from the json, target if provided, or null.
-
toString
-