/** * Digest attributes of Import element and populate Import. * @param node the Import element. * @param edimap the {@link org.milyn.edisax.model.internal.Edimap} to populate. */ private void digestImport(Node node, Edimap edimap) { Import edimapImport = new Import(); edimap.getImports().add(edimapImport); URI resourceURI = importLocator.resolveURI(getAttributeValue(node, "resource")); edimapImport.setResourceURI(resourceURI); edimapImport.setNamespace(getAttributeValue(node, "namespace")); edimapImport.setTruncatableFields(getNodeValueAsBoolean(node, "truncatableFields")); edimapImport.setTruncatableComponents(getNodeValueAsBoolean(node, "truncatableComponents")); edimapImport.setTruncatableSegments(getNodeValueAsBoolean(node, "truncatableSegments")); }
/** * 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()); } }
Import ediImport = new Import(); ediImport.setNamespace(agency); ediImport.setResource(definitionModel.getDescription().getName() + ".xml"); // TODO: Review with B�rd edimap.getImports().add(ediImport); } else {
URI importUri = imp.getResourceURI(); Map<String, Segment> importedSegments = null;
URI importUri = imp.getResourceURI(); Map<String, Segment> importedSegments = null;
/** * Digest attributes of Import element and populate Import. * @param node the Import element. * @param edimap the {@link org.milyn.edisax.model.internal.Edimap} to populate. */ private void digestImport(Node node, Edimap edimap) { Import edimapImport = new Import(); edimap.getImports().add(edimapImport); URI resourceURI = importLocator.resolveURI(getAttributeValue(node, "resource")); edimapImport.setResourceURI(resourceURI); edimapImport.setNamespace(getAttributeValue(node, "namespace")); edimapImport.setTruncatableFields(getNodeValueAsBoolean(node, "truncatableFields")); edimapImport.setTruncatableComponents(getNodeValueAsBoolean(node, "truncatableComponents")); edimapImport.setTruncatableSegments(getNodeValueAsBoolean(node, "truncatableSegments")); }
/** * 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()); } }
URI importUri = imp.getResourceURI(); Map<String, Segment> importedSegments = null;
/** * Digest attributes of Import element and populate Import. * @param node the Import element. * @param edimap the {@link org.milyn.edisax.model.internal.Edimap} to populate. */ private void digestImport(Node node, Edimap edimap) { Import edimapImport = new Import(); edimap.getImports().add(edimapImport); URI resourceURI = importLocator.resolveURI(getAttributeValue(node, "resource")); edimapImport.setResourceURI(resourceURI); edimapImport.setNamespace(getAttributeValue(node, "namespace")); edimapImport.setTruncatableFields(getNodeValueAsBoolean(node, "truncatableFields")); edimapImport.setTruncatableComponents(getNodeValueAsBoolean(node, "truncatableComponents")); edimapImport.setTruncatableSegments(getNodeValueAsBoolean(node, "truncatableSegments")); }
/** * 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()); } }
URI importUri = imp.getResourceURI(); Map<String, Segment> importedSegments = null;
/** * Digest attributes of Import element and populate Import. * @param node the Import element. * @param edimap the {@link org.milyn.edisax.model.internal.Edimap} to populate. */ private void digestImport(Node node, Edimap edimap) { Import edimapImport = new Import(); edimap.getImports().add(edimapImport); URI resourceURI = importLocator.resolveURI(getAttributeValue(node, "resource")); edimapImport.setResourceURI(resourceURI); edimapImport.setNamespace(getAttributeValue(node, "namespace")); edimapImport.setTruncatableFields(getNodeValueAsBoolean(node, "truncatableFields")); edimapImport.setTruncatableComponents(getNodeValueAsBoolean(node, "truncatableComponents")); edimapImport.setTruncatableSegments(getNodeValueAsBoolean(node, "truncatableSegments")); }
/** * 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()); } }