@Nullable public UID getKeyPredicate() { MapElements mapKey = getAnnotation(MapElements.class); if (mapKey != null) { Predicate predicate = mapKey.key(); // String parentNs = getParentNs(mapKey, getMember()); return UID.create(declaringClass.getClassNs(), predicate.ns(), predicate.ln(), null); } else { return null; } }
@Nullable public UID getValuePredicate() { MapElements mapKey = getAnnotation(MapElements.class); if (mapKey != null) { Predicate predicate = mapKey.value(); try { // String parentNs = getParentNs(mapKey, getMember()); return UID.create(declaringClass.getClassNs(), predicate.ns(), predicate.ln(), null); } catch (IllegalArgumentException e) { return null; } } else { return null; } }
public MappedPredicate(String parentNs, Predicate predicate, @Nullable String elementName) { this.uid = UID.create(parentNs, predicate.ns(), predicate.ln(), elementName); this.inv = predicate.inv(); this.ignoreInvalid = predicate.ignoreInvalid(); this.includeInferred = predicate.includeInferred(); if (predicate.context().isEmpty()) { this.context = null; } else { this.context = new UID(predicate.context()); } }