(LoadContext context, CDOMObject cdo, String value)
| 46 | } |
| 47 | |
| 48 | @Override |
| 49 | protected ParseResult parseTokenWithSeparator(LoadContext context, CDOMObject cdo, String value) |
| 50 | { |
| 51 | int pipeLoc = value.indexOf(Constants.PIPE); |
| 52 | if (pipeLoc == -1) |
| 53 | { |
| 54 | return new ParseResult.Fail( |
| 55 | getTokenName() + " expecting '|', format is: " + "Fact identification|Fact value ... was: " + value); |
| 56 | } |
| 57 | else if (pipeLoc != value.lastIndexOf(Constants.PIPE)) |
| 58 | { |
| 59 | return new ParseResult.Fail(getTokenName() + " expecting only one '|', format is: " |
| 60 | + "Fact identification|Fact value ... was: " + value); |
| 61 | } |
| 62 | String factID = value.substring(0, pipeLoc); |
| 63 | if (factID.isEmpty()) |
| 64 | { |
| 65 | return new ParseResult.Fail(getTokenName() + " expecting non-empty identification, " |
| 66 | + "format is: Fact identification|Fact value ... was: " + value); |
| 67 | } |
| 68 | String factStr = value.substring(pipeLoc + 1); |
| 69 | if (factStr.isEmpty()) |
| 70 | { |
| 71 | return new ParseResult.Fail(getTokenName() + " expecting non-empty value, " |
| 72 | + "format is: Fact identification|Fact value ... was: " + value); |
| 73 | } |
| 74 | return context.processSubToken(cdo, getTokenName(), factID, factStr); |
| 75 | } |
| 76 | |
| 77 | @Override |
| 78 | public String[] unparse(LoadContext context, CDOMObject cdo) |
nothing calls this directly
no test coverage detected