/** * Converts a ContentValidationException to a parse exception, with a * separate exception for each parser error that was encountered. */ public ParseException toParseException() { ParseException result = null; Map<Element, List<ErrorContent>> errors = vc.getErrors(); for (Map.Entry<Element, List<ErrorContent>> entry : errors.entrySet()) { Element element = entry.getKey(); String location = element.getElementKey().getId().toString(); List<ErrorContent> codes = entry.getValue(); for (ErrorContent errorCode : codes) { ParseException pe = new ParseException(errorCode); pe.setLocation(location); if (result == null) { result = pe; } else { result.addSibling(pe); } } } return result; } }
/** * Converts a ContentValidationException to a parse exception, with a * separate exception for each parser error that was encountered. */ public ParseException toParseException() { ParseException result = null; Map<Element, List<ErrorContent>> errors = vc.getErrors(); for (Map.Entry<Element, List<ErrorContent>> entry : errors.entrySet()) { Element element = entry.getKey(); String location = element.getElementKey().getId().toString(); List<ErrorContent> codes = entry.getValue(); for (ErrorContent errorCode : codes) { ParseException pe = new ParseException(errorCode); pe.setLocation(location); if (result == null) { result = pe; } else { result.addSibling(pe); } } } return result; } }
/** * Converts a ContentValidationException to a parse exception, with a * separate exception for each parser error that was encountered. */ public ParseException toParseException() { ParseException result = null; Map<Element, List<ErrorContent>> errors = vc.getErrors(); for (Map.Entry<Element, List<ErrorContent>> entry : errors.entrySet()) { Element element = entry.getKey(); String location = element.getElementKey().getId().toString(); List<ErrorContent> codes = entry.getValue(); for (ErrorContent errorCode : codes) { ParseException pe = new ParseException(errorCode); pe.setLocation(location); if (result == null) { result = pe; } else { result.addSibling(pe); } } } return result; } }
@Override public String toString() { ToStringHelper helper = Objects.toStringHelper(this); helper.addValue(getElementId() + "@" + Integer.toHexString(hashCode())); Iterator<Attribute> aIter = getAttributeIterator(); while (aIter.hasNext()) { Attribute att = aIter.next(); helper.add(att.getAttributeKey().getId().toString(), att.getValue()); } if (hasTextValue()) { helper.addValue(getTextValue()); } return helper.toString(); } }
@Override public String toString() { ToStringHelper helper = Objects.toStringHelper(this); helper.addValue(getElementId() + "@" + Integer.toHexString(hashCode())); Iterator<Attribute> aIter = getAttributeIterator(); while (aIter.hasNext()) { Attribute att = aIter.next(); helper.add(att.getAttributeKey().getId().toString(), att.getValue()); } if (hasTextValue()) { helper.addValue(getTextValue()); } return helper.toString(); } }
@Override public String toString() { ToStringHelper helper = Objects.toStringHelper(this); helper.addValue(getElementId() + "@" + Integer.toHexString(hashCode())); Iterator<Attribute> aIter = getAttributeIterator(); while (aIter.hasNext()) { Attribute att = aIter.next(); helper.add(att.getAttributeKey().getId().toString(), att.getValue()); } if (hasTextValue()) { helper.addValue(getTextValue()); } return helper.toString(); } }