|!-fitlibrary.spec.SpecifyFixture-!|
|!-
fitlibrary.specify.parser.ClassWithParseMethod2 |
show | my class |
check | my class | i 3 |
check | same my class | i 4 | i 4 |
check | my class | i 3 | + | i 1 | i 4 |
-!|!-
fitlibrary.specify.parser.ClassWithParseMethod2 |
show | my class |
i 3 |
check | my class | i 3 |
check | same my class | i 4 | i 4 |
check | my class | i 3 | + | i 1 | i 4 |
-!|
The ''static parse()'' method of a class is used if a object of that type needs a ''!-TypeAdapter-!''
In this example, the method ''myClass()'' returns an object of class ''!-MyClass-!''. This has the following methods, which are all needed for parsing to work:
* ''public static parse(String s)'' is used to parse a String from a Fit table cell. It needs to return an object (not a primitive value or ''void'').
* ''public String toString()'' is used to unparse an Object, to display the actual result in a reported cell.
* ''public boolean equals(Object object)'' is used to compare an expected and an actual value to see if they're the same.
This capability is provided for all fixtures in the ''!-FitNesse-!'' version of Fit.