/** * Check to see if the given placeRef can be found in the given DocMap (if the placeRef and its description ref are non-null * and refer to a local id, i.e., one starting with "#"). If it is local and can't be found, add an error to 'errors'. * @param errors - StringBuilder to add a message to if there is a problem (i.e., if placeRef references a local place description * via a URI starting with "#", and there is no corresponding place description in the same document). * @param placeRef - PlaceReference object to check for a broken local link. * @param docMap - DocMap for a GedcomX document. */ private static void checkPlace(StringBuilder errors, PlaceReference placeRef, DocMap docMap) { if (placeRef != null && placeRef.getDescriptionRef() != null && placeRef.getDescriptionRef().toString().startsWith("#")) { if (docMap.getPlaceDescription(placeRef) == null) { errors.append("Error 13: Could not find referenced place ").append(placeRef.toString()).append("\n"); } } }