public Place getPlace(String token) { int colonAt = token.indexOf(':'); String initial; String rest; if (colonAt >= 0) { initial = token.substring(0, colonAt); rest = token.substring(colonAt + 1); } else { initial = ""; rest = token; } PlaceTokenizer<?> tokenizer = getTokenizer(initial); if (tokenizer != null) { return tokenizer.getPlace(rest); } return null; }
@Override public String getToken(Place place) { if (place == null) { return null; } String parentToken = null; if (place instanceof ViewPlace && ((ViewPlace) place).getParent() != null) { parentToken = this.getToken(((ViewPlace) place).getParent()); } String prefix = MvpUtils.getPlacePrefix(place); String token = null; ActivityFactory activityFactory = this.activityFactories.get(prefix); if (activityFactory instanceof PlaceTokenizer) { token = ((PlaceTokenizer) activityFactory).getToken(place); } String result = ""; if (parentToken != null) { result = parentToken + MvpController.PLACE_SEPARATOR; if (prefix.startsWith("!")) { prefix = prefix.substring(1); } } if (token != null) { result += prefix.length() == 0 ? token : prefix + MvpController.PLACE_TOKEN_SEPARATOR + token; } else { result += prefix; } return result; }
@Override public String getToken(Place place) { if (place == null) { return null; } String parentToken = null; if (place instanceof ViewPlace && ((ViewPlace) place).getParent() != null) { parentToken = this.getToken(((ViewPlace) place).getParent()); } String prefix = MvpUtils.getPlacePrefix(place); String token = null; ActivityFactory activityFactory = this.activityFactories.get(prefix); if (activityFactory instanceof PlaceTokenizer) { token = ((PlaceTokenizer) activityFactory).getToken(place); } String result = ""; if (parentToken != null) { result = parentToken + MvpController.PLACE_SEPARATOR; if (prefix.startsWith("!")) { prefix = prefix.substring(1); } } if (token != null) { result += prefix.length() == 0 ? token : prefix + MvpController.PLACE_TOKEN_SEPARATOR + token; } else { result += prefix; } return result; }
private Place getSimplePlace(String token) { int colonAt = token.indexOf(MvpController.PLACE_TOKEN_SEPARATOR); String prefix = token; String rest = null; if (colonAt > 0) { prefix = token.substring(0, colonAt); rest = token.substring(colonAt + 1); } if (!prefix.startsWith(MvpController.PLACE_CROWLER_DELIMITER)) { prefix = MvpController.PLACE_CROWLER_DELIMITER + prefix; } ActivityFactory activityFactory = this.activityFactories.get(prefix); if (activityFactory instanceof PlaceTokenizer) { return ((PlaceTokenizer) activityFactory).getPlace(rest); } return null; }
private Place getSimplePlace(String token) { int colonAt = token.indexOf(MvpController.PLACE_TOKEN_SEPARATOR); String prefix = token; String rest = null; if (colonAt > 0) { prefix = token.substring(0, colonAt); rest = token.substring(colonAt + 1); } if (!prefix.startsWith(MvpController.PLACE_CROWLER_DELIMITER)) { prefix = MvpController.PLACE_CROWLER_DELIMITER + prefix; } ActivityFactory activityFactory = this.activityFactories.get(prefix); if (activityFactory instanceof PlaceTokenizer) { return ((PlaceTokenizer) activityFactory).getPlace(rest); } return null; }
public Place getPlace(String token) { int colonAt = token.indexOf(':'); String initial; String rest; if (colonAt >= 0) { initial = token.substring(0, colonAt); rest = token.substring(colonAt + 1); } else { initial = ""; rest = token; } PlaceTokenizer<?> tokenizer = getTokenizer(initial); if (tokenizer != null) { return tokenizer.getPlace(rest); } return null; }
public Place getPlace(String token) { int colonAt = token.indexOf(':'); String initial; String rest; if (colonAt >= 0) { initial = token.substring(0, colonAt); rest = token.substring(colonAt + 1); } else { initial = ""; rest = token; } PlaceTokenizer<?> tokenizer = getTokenizer(initial); if (tokenizer != null) { return tokenizer.getPlace(rest); } return null; }