use of com.evolveum.midpoint.prism.query.Visitor in project midpoint by Evolveum.
the class ObjectQueryUtil method assertPropertyOnly.
// TODO what about OidIn here?
public static void assertPropertyOnly(ObjectFilter filter, final String message) {
Visitor visitor = f -> {
if (f instanceof OrgFilter) {
if (message == null) {
throw new IllegalArgumentException(f.toString());
} else {
throw new IllegalArgumentException(message + ": " + f);
}
}
};
filter.accept(visitor);
}
use of com.evolveum.midpoint.prism.query.Visitor in project midpoint by Evolveum.
the class ObjectQueryUtil method hasAllDefinitions.
public static boolean hasAllDefinitions(ObjectFilter filter) {
final MutableBoolean hasAllDefinitions = new MutableBoolean(true);
Visitor visitor = f -> {
if (f instanceof ValueFilter) {
ItemDefinition definition = ((ValueFilter<?, ?>) f).getDefinition();
if (definition == null) {
hasAllDefinitions.setValue(false);
}
}
};
filter.accept(visitor);
return hasAllDefinitions.booleanValue();
}
use of com.evolveum.midpoint.prism.query.Visitor in project midpoint by Evolveum.
the class ObjectQueryUtil method assertNotRaw.
public static void assertNotRaw(ObjectFilter filter, final String message) {
Visitor visitor = f -> {
if (f instanceof ValueFilter && ((ValueFilter) f).isRaw()) {
if (message == null) {
throw new IllegalArgumentException(f.toString());
} else {
throw new IllegalArgumentException(message + ": " + f);
}
}
};
filter.accept(visitor);
}
use of com.evolveum.midpoint.prism.query.Visitor in project midpoint by Evolveum.
the class ShadowManager method processQueryMatchingRules.
/**
* Visit the query and normalize values (or set matching rules) as needed
*/
private void processQueryMatchingRules(ObjectQuery repoQuery, final RefinedObjectClassDefinition objectClassDef) {
ObjectFilter filter = repoQuery.getFilter();
Visitor visitor = f -> {
try {
processQueryMatchingRuleFilter(f, objectClassDef);
} catch (SchemaException e) {
throw new SystemException(e);
}
};
filter.accept(visitor);
}
Aggregations