@Override public String toString() { if (isValid()) return "VALID"; StringBuilder sb = new StringBuilder(); if (notAllowedAttributes != null) errorComment(sb, "Not allowed Attribute", tagsOfNotAllowedAttributes()).append(StringUtils.LINE_SEPARATOR); if (missingAttributes != null) errorComment(sb, "Missing Attribute", tagsOfMissingAttributes()).append(StringUtils.LINE_SEPARATOR); if (missingAttributeValues != null) errorComment(sb, "Missing Value of Attribute", tagsOfMissingAttributeValues()).append(StringUtils.LINE_SEPARATOR); if (invalidAttributeValues != null) errorComment(sb, "Invalid Attribute", tagsOfInvalidAttributeValues()).append(StringUtils.LINE_SEPARATOR); return sb.substring(0, sb.length()-1); }
public String getErrorComment() { StringBuilder sb = new StringBuilder(); if (notAllowedAttributes != null) return errorComment(sb, "Not allowed Attribute", tagsOfNotAllowedAttributes()).toString(); if (missingAttributes != null) return errorComment(sb, "Missing Attribute", tagsOfMissingAttributes()).toString(); if (missingAttributeValues != null) return errorComment(sb, "Missing Value of Attribute", tagsOfMissingAttributeValues()).toString(); if (invalidAttributeValues != null) return errorComment(sb, "Invalid Attribute", tagsOfInvalidAttributeValues()).toString(); return null; }
public int[] getOffendingElements() { return cat(tagsOfMissingAttributes(), tagsOfMissingAttributeValues(), tagsOfInvalidAttributeValues(), tagsOfNotAllowedAttributes()); }
public static DicomServiceException valueOf(ValidationResult result, Attributes attrs) { if (result.hasNotAllowedAttributes()) return new DicomServiceException(Status.NoSuchAttribute) .setAttributeIdentifierList(result.tagsOfNotAllowedAttributes()); if (result.hasMissingAttributes()) return new DicomServiceException(Status.MissingAttribute) .setAttributeIdentifierList(result.tagsOfMissingAttributes()); if (result.hasMissingAttributeValues()) return new DicomServiceException(Status.MissingAttributeValue) .setDataset(new Attributes(attrs, result.tagsOfMissingAttributeValues())); if (result.hasInvalidAttributeValues()) return new DicomServiceException(Status.InvalidAttributeValue) .setDataset(new Attributes(attrs, result.tagsOfInvalidAttributeValues())); return null; } }
public static DicomServiceException valueOf(ValidationResult result, Attributes attrs) { if (result.hasNotAllowedAttributes()) return new DicomServiceException(Status.NoSuchAttribute) .setAttributeIdentifierList(result.tagsOfNotAllowedAttributes()); if (result.hasMissingAttributes()) return new DicomServiceException(Status.MissingAttribute) .setAttributeIdentifierList(result.tagsOfMissingAttributes()); if (result.hasMissingAttributeValues()) return new DicomServiceException(Status.MissingAttributeValue) .setDataset(new Attributes(attrs, result.tagsOfMissingAttributeValues())); if (result.hasInvalidAttributeValues()) return new DicomServiceException(Status.InvalidAttributeValue) .setDataset(new Attributes(attrs, result.tagsOfInvalidAttributeValues())); return null; } }