use of io.vertigo.lang.VSystemException in project vertigo by KleeGroup.
the class DtListPatternFilterUtil method createDtListFilterForPattern.
static <D extends DtObject> Predicate<D> createDtListFilterForPattern(final FilterPattern filterPattern, final String[] parsedFilter, final DtDefinition dtDefinition) {
Assertion.checkNotNull(filterPattern);
Assertion.checkNotNull(parsedFilter);
Assertion.checkNotNull(dtDefinition);
// -----
// Si on trouve un pattern, on passe sur du code spécifique
// attention parsedFilter[0] = filtre entier
final String fieldName = parsedFilter[1];
final DtField dtField = dtDefinition.getField(fieldName);
final DataType dataType = dtField.getDomain().getDataType();
switch(filterPattern) {
case Range:
return createDtListRangeFilter(parsedFilter, fieldName, dataType);
case Term:
return createDtListTermFilter(parsedFilter, fieldName, dataType);
default:
throw new VSystemException("La chaine de filtrage: {0} , ne respecte pas la syntaxe {1}.", parsedFilter[0], filterPattern.getPattern().pattern());
}
}
use of io.vertigo.lang.VSystemException in project vertigo by KleeGroup.
the class ComponentCmdWebServices method getComponentConfig.
@AnonymousAccessAllowed
@GET("/vertigo/components/{componentId}")
public String getComponentConfig(@PathParam("componentId") final String componentId) {
Assertion.checkArgNotEmpty(componentId);
// -----
final JsonArray jsonModuleConfigs = doGetModuleConfigs();
for (int i = 0; i < jsonModuleConfigs.size(); i++) {
final JsonObject jsonModuleConfig = (JsonObject) jsonModuleConfigs.get(i);
final JsonArray jsonComponentConfigs = jsonModuleConfig.get("componentConfigs").getAsJsonArray();
for (int j = 0; j < jsonComponentConfigs.size(); j++) {
final JsonObject jsonComponentConfig = (JsonObject) jsonComponentConfigs.get(j);
if (componentId.equalsIgnoreCase(jsonComponentConfig.get("id").getAsString())) {
return jsonEngine.toJson(jsonComponentConfig);
}
}
}
throw new VSystemException("NotFoundException");
}
Aggregations