public EntityView(Class<C> entityClass, String webFolder) { super(entityClass); City.load(); this.cityList = City.getCityNames(); this.postalCodeList = City.getPostalCodes(); this.webFolder = "/restricted/admin/data/" + webFolder + "/"; this.entityClass = entityClass; }
public List<String> cityComplete(String query) { String value = City.getNormalizedCity(query.toLowerCase()); List<String> result = new ArrayList<String>(); List<String> like = City.likeCity(value); List<String> begin = City.beginWith(value); if (like != null) { result.addAll(like); } if (begin != null) { result.addAll(begin); } Collections.sort(result); return result; }