AnnotationList atns = fn.getAnnotations(); logger.trace("lookupFunctions; fn annotations: {}", atns.size()); StringBuilder buff = new StringBuilder(); for (Annotation atn: atns) {
@Override public void check(AnnotationList annotations, String construct) throws XPathException { for (int i = 0; i < annotations.size(); i++) { Annotation ann = annotations.get(i); for (DisallowedCombination dc : blackList) { if (dc.one.equals(ann.getAnnotationQName()) && dc.where.contains(construct)) { if (dc.two == null) { throw new XPathException("Annotation %" + ann.getAnnotationQName().getLocalPart() + " is not allowed here", dc.errorCode); } else { for (int j = 0; j < i; j++) { Annotation other = annotations.get(j); if (dc.two.equals(other.getAnnotationQName())) { if (dc.two.equals(ann.getAnnotationQName())) { throw new XPathException("Annotation %" + ann.getAnnotationQName().getLocalPart() + " cannot appear more than once", dc.errorCode); } else { throw new XPathException("Annotations %" + ann.getAnnotationQName().getLocalPart() + " and " + other.getAnnotationQName().getLocalPart() + " cannot appear together", dc.errorCode); } } } } } } } }
@Override public void check(AnnotationList annotations, String construct) throws XPathException { for (int i = 0; i < annotations.size(); i++) { Annotation ann = annotations.get(i); for (DisallowedCombination dc : blackList) { if (dc.one.equals(ann.getAnnotationQName()) && dc.where.contains(construct)) { if (dc.two == null) { throw new XPathException("Annotation %" + ann.getAnnotationQName().getLocalPart() + " is not allowed here", dc.errorCode); } else { for (int j = 0; j < i; j++) { Annotation other = annotations.get(j); if (dc.two.equals(other.getAnnotationQName())) { if (dc.two.equals(ann.getAnnotationQName())) { throw new XPathException("Annotation %" + ann.getAnnotationQName().getLocalPart() + " cannot appear more than once", dc.errorCode); } else { throw new XPathException("Annotations %" + ann.getAnnotationQName().getLocalPart() + " and " + other.getAnnotationQName().getLocalPart() + " cannot appear together", dc.errorCode); } } } } } } } }