/** * Inserts data from imported segment into the importing segment. Continues through all * the child segments of the importing segment. * @param segment the importing segment. * @param imp import information like url and namespace. * @param importedSegments the imported segment. * @throws EDIParseException Thrown when a segref attribute in importing segment contains * a value not located in the imported segment but with the namespace referencing the imported file. */ private void applyImportOnSegment(Segment segment, Import imp, Map<String, Segment> importedSegments) throws EDIParseException { if (segment.getNodeTypeRef() != null && segment.getNodeTypeRef().startsWith(imp.getNamespace()+":")) { String key = segment.getNodeTypeRef().substring(segment.getNodeTypeRef().indexOf(':') + 1); Segment importedSegment = importedSegments.get(key); if (importedSegment == null) { throw new EDIParseException(edimap, "Referenced segment [" + key + "] does not exist in imported edi-message-mapping [" + imp.getResource() + "]"); } insertImportedSegmentInfo(segment, importedSegment, imp.isTruncatableSegments(), imp.isTruncatableFields(), imp.isTruncatableComponents()); } }
/** * Inserts data from imported segment into the importing segment. Continues through all * the child segments of the importing segment. * @param segment the importing segment. * @param imp import information like url and namespace. * @param importedSegments the imported segment. * @throws EDIParseException Thrown when a segref attribute in importing segment contains * a value not located in the imported segment but with the namespace referencing the imported file. */ private void applyImportOnSegment(Segment segment, Import imp, Map<String, Segment> importedSegments) throws EDIParseException { if (segment.getNodeTypeRef() != null && segment.getNodeTypeRef().startsWith(imp.getNamespace()+":")) { String key = segment.getNodeTypeRef().substring(segment.getNodeTypeRef().indexOf(':') + 1); Segment importedSegment = importedSegments.get(key); if (importedSegment == null) { throw new EDIParseException(edimap, "Referenced segment [" + key + "] does not exist in imported edi-message-mapping [" + imp.getResource() + "]"); } insertImportedSegmentInfo(segment, importedSegment, imp.isTruncatableSegments(), imp.isTruncatableFields(), imp.isTruncatableComponents()); } }
/** * Inserts data from imported segment into the importing segment. Continues through all * the child segments of the importing segment. * @param segment the importing segment. * @param imp import information like url and namespace. * @param importedSegments the imported segment. * @throws EDIParseException Thrown when a segref attribute in importing segment contains * a value not located in the imported segment but with the namespace referencing the imported file. */ private void applyImportOnSegment(Segment segment, Import imp, Map<String, Segment> importedSegments) throws EDIParseException { if (segment.getNodeTypeRef() != null && segment.getNodeTypeRef().startsWith(imp.getNamespace()+":")) { String key = segment.getNodeTypeRef().substring(segment.getNodeTypeRef().indexOf(':') + 1); Segment importedSegment = importedSegments.get(key); if (importedSegment == null) { throw new EDIParseException(edimap, "Referenced segment [" + key + "] does not exist in imported edi-message-mapping [" + imp.getResource() + "]"); } insertImportedSegmentInfo(segment, importedSegment, imp.isTruncatableSegments(), imp.isTruncatableFields(), imp.isTruncatableComponents()); } }
/** * Inserts data from imported segment into the importing segment. Continues through all * the child segments of the importing segment. * @param segment the importing segment. * @param imp import information like url and namespace. * @param importedSegments the imported segment. * @throws EDIParseException Thrown when a segref attribute in importing segment contains * a value not located in the imported segment but with the namespace referencing the imported file. */ private void applyImportOnSegment(Segment segment, Import imp, Map<String, Segment> importedSegments) throws EDIParseException { if (segment.getNodeTypeRef() != null && segment.getNodeTypeRef().startsWith(imp.getNamespace()+":")) { String key = segment.getNodeTypeRef().substring(segment.getNodeTypeRef().indexOf(':') + 1); Segment importedSegment = importedSegments.get(key); if (importedSegment == null) { throw new EDIParseException(edimap, "Referenced segment [" + key + "] does not exist in imported edi-message-mapping [" + imp.getResource() + "]"); } insertImportedSegmentInfo(segment, importedSegment, imp.isTruncatableSegments(), imp.isTruncatableFields(), imp.isTruncatableComponents()); } }