(LoadContext context, Loadable po, Object source, String tok)
| 116 | } |
| 117 | |
| 118 | public static boolean processToken(LoadContext context, Loadable po, Object source, String tok) |
| 119 | { |
| 120 | final String token = tok.trim(); |
| 121 | final int colonLoc = token.indexOf(':'); |
| 122 | if (colonLoc == -1) |
| 123 | { |
| 124 | Logging.errorPrint("Invalid Token - does not contain a colon: '" + token + "' in " |
| 125 | + po.getClass().getSimpleName() + " " + po.getDisplayName() + " of " + source); |
| 126 | return false; |
| 127 | } |
| 128 | else if (colonLoc == 0) |
| 129 | { |
| 130 | Logging.errorPrint("Invalid Token - starts with a colon: '" + token + "' in " |
| 131 | + po.getClass().getSimpleName() + " " + po.getDisplayName() + " of " + source); |
| 132 | return false; |
| 133 | } |
| 134 | |
| 135 | String key = token.substring(0, colonLoc); |
| 136 | String value = (colonLoc == (token.length() - 1)) ? null : token.substring(colonLoc + 1); |
| 137 | boolean successful = context.processToken(po, key, value); |
| 138 | if (successful) |
| 139 | { |
| 140 | context.commit(); |
| 141 | } |
| 142 | else |
| 143 | { |
| 144 | context.rollback(); |
| 145 | Logging.replayParsedMessages(); |
| 146 | } |
| 147 | Logging.clearParseMessages(); |
| 148 | return successful; |
| 149 | } |
| 150 | } |
no test coverage detected