Classes | |
class | CompatibleDateTimePersistor |
class | MenuItemDeserialiser |
class | MenuItemSerialiser |
Public Member Functions | |
JsonMenuItemSerializer (Consumer< GsonBuilder > builder) | |
Gson | getGson () |
List< PersistedMenu > | populateListInOrder (SubMenuItem node, MenuTree menuTree, boolean processingRoot) |
String | itemsToCopyText (MenuItem startingPoint, MenuTree tree) |
List< PersistedMenu > | copyTextToItems (String items) |
MenuTree | newMenuTreeWithItems (String tcMenuCopy) |
Static Public Member Functions | |
static boolean | checkItemValueCanPersist (PersistedMenu persistedMenu) |
static JsonObject | getJsonObjOrThrow (JsonObject object, String child) throws IOException |
static String | getJsonStrOrThrow (JsonObject object, String child) throws IOException |
static int | getJsonIntOrThrow (JsonObject object, String child) throws IOException |
Creates a menu serializer instance that can convert menu structures to and from JSON format. In the simplest case just create a new instance of the class and you can use it to convert between formats.
var jsonSerializer = new JsonMenuItemSerializer(); var tree = jsonSerializer.newMenuTreeWithItems(textCopiedFromTcMenuDesigner); var json = jsonSerializer.itemsToCopyText(MenuTree.ROOT, tree);
|
static |
There are some menu types that should not have a default value, these generally don't have a value associated with them that can be easily saved, such as lists, action items, builder items and submenus.
persistedMenu | the item to check |