-
Notifications
You must be signed in to change notification settings - Fork 2
Custom Datatypes
revbingo edited this page Nov 8, 2012
·
7 revisions
In some cases, you will want to have closer control of how parts of a file are parsed. In this case, you can implement your own class, extending com.revbingo.spiff.datatypes.DataType, and declare this for use in your ADF file.
Let's look at an example. Suppose the creators of the file format had a bit of a moment and decided that it would be a great idea to store all strings backwards. Whilst you could receive the backwards value and reverse it after the event, it would be easier if SPIFF handed the data to the event listeners with the string the right way round.
`` 00000000 21 65 73 72 65 76 65 72 6e 61 63 66 66 69 70 73 |!esrevernacffips|