/** Returns the int code of this item */ public final int getCode() { return getItemType().code; }
@Override protected void adding(Item item) { super.adding(item); Validator.ensure("Could not add an item of type " + item.getItemType() + ": Equiv can only have word/int/phrase as children", item.getItemType() == ItemType.WORD || item.getItemType() == ItemType.EXACT || item.getItemType() == ItemType.INT || item.getItemType() == ItemType.PHRASE); }
protected String getFormName(Item item) { return item.getItemType().name(); } }
static String serializeItem(Item item, ItemIdMapper itemIdMapper) { return ItemExecutorRegistry.getByType(item.getItemType()).itemToForm(item, itemIdMapper).serialize(itemIdMapper); } }
public String serialize(Item root) { ItemIdMapper itemIdMapper = new ItemIdMapper(); return ItemExecutorRegistry.getByType(root.getItemType()).itemToForm(root, itemIdMapper).serialize(itemIdMapper); } }