|
RuneHive-Game
|
This class provides an easy to use google gson parser specifically designed for parsing JSON files. More...
Public Member Functions | |
| final void | deserialize () |
| The method that deserializes the file information. | |
| GsonParser (String path) | |
Creates a new GsonParser. | |
| GsonParser (String path, boolean log) | |
Creates a new GsonParser. | |
| void | initialize (int size) |
| Public Member Functions inherited from com.runehive.util.parser.GenericParser | |
| GenericParser (String path, String extension, boolean log) | |
Creates a new GenericParser. | |
| final int | getIndex () |
| Gets the current index of the line being parsed. | |
| void | onRead () |
| The method called after all the data has been parsed. | |
| void | run () |
| String | toString () |
Protected Member Functions | |
| void | onEnd () |
| This method handles what happens after the parser has ended. | |
| abstract void | parse (JsonObject data) |
| The method allows a user to modify the data as its being parsed. | |
Protected Attributes | |
| transient Gson | builder |
The Gson object. | |
| Protected Attributes inherited from com.runehive.util.parser.GenericParser | |
| int | index |
| The index of the current line being parsed. | |
| final Path | path |
| The path of the file to parse. | |
Static Private Attributes | |
| static final Logger | logger = LogManager.getLogger(GsonParser.class) |
This class provides an easy to use google gson parser specifically designed for parsing JSON files.
Definition at line 16 of file GsonParser.java.
| com.runehive.util.parser.GsonParser.GsonParser | ( | String | path | ) |
Creates a new GsonParser.
| path | The specified path of the json file to parse. |
Definition at line 28 of file GsonParser.java.
References com.runehive.util.parser.GenericParser.path.
| com.runehive.util.parser.GsonParser.GsonParser | ( | String | path, |
| boolean | log ) |
Creates a new GsonParser.
| path | The specified path of the json file to parse. |
| log | The flag that denotes to log messages. |
Definition at line 38 of file GsonParser.java.
References com.runehive.util.parser.GenericParser.log, and com.runehive.util.parser.GenericParser.path.
| final void com.runehive.util.parser.GsonParser.deserialize | ( | ) |
The method that deserializes the file information.
Reimplemented from com.runehive.util.parser.GenericParser.
Definition at line 60 of file GsonParser.java.
References com.runehive.util.parser.GenericParser.index, initialize(), logger, onEnd(), parse(), and com.runehive.util.parser.GenericParser.path.
Referenced by com.runehive.game.world.entity.mob.npc.definition.NpcDefinition.main().
| void com.runehive.util.parser.GsonParser.initialize | ( | int | size | ) |
Reimplemented in com.runehive.util.parser.old.EquipmentDefinitionParser.
Definition at line 43 of file GsonParser.java.
Referenced by deserialize().
|
protected |
This method handles what happens after the parser has ended.
Reimplemented in com.runehive.util.parser.old.EquipmentDefinitionParser.
Definition at line 56 of file GsonParser.java.
Referenced by deserialize().
|
abstractprotected |
The method allows a user to modify the data as its being parsed.
| data | The JsonObject that contains all serialized information. |
Reimplemented in com.runehive.util.parser.impl.CombatProjectileParser, com.runehive.util.parser.impl.GlobalObjectParser, com.runehive.util.parser.impl.NpcDropParser, com.runehive.util.parser.impl.NpcForceChatParser, com.runehive.util.parser.impl.NpcSpawnParser, com.runehive.util.parser.impl.ObjectRemovalParser, com.runehive.util.parser.impl.PacketSizeParser, com.runehive.util.parser.impl.StoreParser, com.runehive.util.parser.old.EquipmentDefinitionParser, com.runehive.util.parser.old.EquipmentParser, com.runehive.util.parser.old.ItemDefinitionParser, and com.runehive.util.parser.old.WeaponDefinitionParser.
Referenced by deserialize().
|
protected |
The Gson object.
Definition at line 21 of file GsonParser.java.
Referenced by com.runehive.util.parser.impl.CombatProjectileParser.parse(), com.runehive.util.parser.impl.GlobalObjectParser.parse(), com.runehive.util.parser.impl.NpcDropParser.parse(), com.runehive.util.parser.impl.NpcForceChatParser.parse(), com.runehive.util.parser.impl.NpcSpawnParser.parse(), com.runehive.util.parser.impl.ObjectRemovalParser.parse(), com.runehive.util.parser.impl.StoreParser.parse(), com.runehive.util.parser.old.EquipmentParser.parse(), and com.runehive.util.parser.old.WeaponDefinitionParser.parse().
|
staticprivate |
Definition at line 18 of file GsonParser.java.
Referenced by deserialize().