public Description getDescription() { if(description != null) { return description; } return getEdimap().getDescription(); }
/** * Returns the delimiters used in edifact format. * @return delimiters. */ public Delimiters getDelimiters() { return getEdimap().getDelimiters(); }
/** * Returns the delimiters used in edifact format. * @return delimiters. */ public Delimiters getDelimiters() { return getEdimap().getDelimiters(); }
public Description getDescription() { if(description != null) { return description; } return getEdimap().getDescription(); }
public Description getDescription() { if(description != null) { return description; } return getEdimap().getDescription(); }
/** * Returns the delimiters used in edifact format. * @return delimiters. */ public Delimiters getDelimiters() { return getEdimap().getDelimiters(); }
public Description getDescription() { if(description != null) { return description; } return getEdimap().getDescription(); }
/** * Returns the delimiters used in edifact format. * @return delimiters. */ public Delimiters getDelimiters() { return getEdimap().getDelimiters(); }
/** * Returns the Edimap for a given edi-mapping inputstream. * @param inputStream the edi-mapping. * @return the Edimap. * @throws EDIConfigurationException When edi-mapping-configuration is badly formatted. * @throws IOException When unable to read edi-mapping-configuration. */ private Edimap readEDIConfig(InputStream inputStream) throws EDIConfigurationException, IOException { EdifactModel edifactModel = new EdifactModel(inputStream); return edifactModel.getEdimap(); }
public void parse() throws IOException, SAXException { if(contentHandler == null) { throw new IllegalStateException("'contentHandler' not set. Cannot parse EDI stream."); } if(segmentReader == null) { throw new IllegalStateException("'bufferedSegmentReader' not set. Cannot parse EDI stream."); } if(edifactModel == null || edifactModel.getEdimap() == null) { throw new IllegalStateException("'mappingModel' not set. Cannot parse EDI stream."); } try { parse(true); } finally { contentHandler = null; } }
/** * Parse an EDI message, using a supplied segment reader. */ public void parse() throws IOException, SAXException { if(contentHandler == null) { throw new IllegalStateException("'contentHandler' not set. Cannot parse EDI stream."); } if(segmentReader == null) { throw new IllegalStateException("'bufferedSegmentReader' not set. Cannot parse EDI stream."); } if(edifactModel == null || edifactModel.getEdimap() == null) { throw new IllegalStateException("'mappingModel' not set. Cannot parse EDI stream."); } try { parse(true); } finally { contentHandler = null; } }
private Map<String, Segment> getImportedSegments(URI importUri) { if(associateModels != null) { for(EdifactModel model : associateModels) { if(model.getModelURI().equals(importUri)) { return createImportMap(model.getEdimap()); } } } return null; }
private Map<String, Segment> getImportedSegments(URI importUri) { if(associateModels != null) { for(EdifactModel model : associateModels) { if(model.getModelURI().equals(importUri)) { return createImportMap(model.getEdimap()); } } } return null; }
private Map<String, Segment> getImportedSegments(URI importUri) { if(associateModels != null) { for(EdifactModel model : associateModels) { if(model.getModelURI().equals(importUri)) { return createImportMap(model.getEdimap()); } } } return null; }
private Map<String, Segment> getImportedSegments(URI importUri) { if(associateModels != null) { for(EdifactModel model : associateModels) { if(model.getModelURI().equals(importUri)) { return createImportMap(model.getEdimap()); } } } return null; }
private static boolean loadXMLMappingModel(String mappingModelFile, Map<String, EdifactModel> mappingModels, URI baseURI) throws EDIConfigurationException { try { EdifactModel model = EDIParser.parseMappingModel(mappingModelFile, baseURI); mappingModels.put(toLookupName(model.getEdimap().getDescription()), model); return true; } catch (IOException e) { return false; } catch (SAXException e) { logger.debug("Configured mapping model file '" + mappingModelFile + "' is not a valid Mapping Model xml file."); return false; } }
private static boolean loadXMLMappingModel(String mappingModelFile, Map<String, EdifactModel> mappingModels, URI baseURI) throws EDIConfigurationException { try { EdifactModel model = EDIParser.parseMappingModel(mappingModelFile, baseURI); mappingModels.put(toLookupName(model.getEdimap().getDescription()), model); return true; } catch (IOException e) { return false; } catch (SAXException e) { logger.debug("Configured mapping model file '" + mappingModelFile + "' is not a valid Mapping Model xml file."); return false; } }
private static boolean loadXMLMappingModel(String mappingModelFile, Map<String, EdifactModel> mappingModels, URI baseURI) throws EDIConfigurationException { try { EdifactModel model = EDIParser.parseMappingModel(mappingModelFile, baseURI); mappingModels.put(toLookupName(model.getEdimap().getDescription()), model); return true; } catch (IOException e) { return false; } catch (SAXException e) { logger.debug("Configured mapping model file '" + mappingModelFile + "' is not a valid Mapping Model xml file."); return false; } }
private static boolean loadXMLMappingModel(String mappingModelFile, Map<String, EdifactModel> mappingModels, URI baseURI) throws EDIConfigurationException { try { EdifactModel model = EDIParser.parseMappingModel(mappingModelFile, baseURI); mappingModels.put(toLookupName(model.getEdimap().getDescription()), model); return true; } catch (IOException e) { return false; } catch (SAXException e) { logger.debug("Configured mapping model file '" + mappingModelFile + "' is not a valid Mapping Model xml file."); return false; } }
private void parse(boolean indent) throws SAXException, IOException, EDIParseException { startElement(edifactModel.getEdimap().getSegments(), indent); // Work through all the segments in the model. Move to the first segment before starting... if(segmentReader.moveToNextSegment()) { mapSegments(edifactModel.getEdimap().getSegments().getSegments()); // If we reach the end of the mapping model and we still have more EDI segments in the message.... while (segmentReader.hasCurrentSegment()) { if (!EMPTY_LINE.matcher(segmentReader.getSegmentBuffer().toString()).matches()) { throw new EDIParseException(edifactModel.getEdimap(), "Reached end of mapping model but there are more EDI segments in the incoming message. Read " + segmentReader.getCurrentSegmentNumber() + " segment(s). Current EDI segment is [" + segmentReader.getSegmentBuffer() + "]"); } segmentReader.moveToNextSegment(); } } // Fire the endDocument event, as well as the endElement event... endElement(edifactModel.getEdimap().getSegments(), true); }