Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raycw/edidom
Java-centric EDI library
https://github.com/raycw/edidom
edi java
Last synced: about 1 month ago
JSON representation
Java-centric EDI library
- Host: GitHub
- URL: https://github.com/raycw/edidom
- Owner: raycw
- Created: 2013-05-24T08:20:28.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2020-09-10T08:53:35.000Z (over 4 years ago)
- Last Synced: 2024-10-13T15:41:30.796Z (2 months ago)
- Topics: edi, java
- Language: Java
- Homepage:
- Size: 206 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/raycw/edidom.svg?branch=master)](https://travis-ci.org/raycw/edidom)
# Introduction #
Inspired by JDOM, **edidom** is both Java-centric and Java-optimized. It behaves like Java, it uses Java collections, it is completely natural API for current Java developers, and it provides a low-cost entry point for using EDI.## How to build ##
You need to install [MAVEN](http://maven.apache.org/), edidom is using maven to manage project build. If you using eclipse, I highly recommend you to install [m2e](http://www.eclipse.org/m2e/).
mvn package## Data Structure ##
+-------------------------------------------------------------------+
| InterchangeEnvelope (1) |
|-------------------------------------------------------------------|
| |
| +------------------------------------------------------------+ |
| | GroupEnvelope (0..*) | |
| |------------------------------------------------------------| |
| | | |
| | +-----------------------------------------------------+ | |
| | | Transaction (1..*) | | |
| | |-----------------------------------------------------| | |
| | | +-------------------------------------------------+ | | |
| | | | Segment (1..*) | | | |
| | | +-------------------------------------------------+ | | |
| | | ... | | |
| | | ... | | |
| | | .. | | |
| | | .. | | |
| | | . | | |
| | | +-------------------------------------------------+ | | |
| | | | Segment | | | |
| | | +-------------------------------------------------+ | | |
| | +-----------------------------------------------------+ | |
| +------------------------------------------------------------+ |
+-------------------------------------------------------------------+## Getting Started ##
### Read EDI ###
Create aBuilder
first. For X12, usecom.github.raycw.edidom.input.X12Builder
, for EDIFACT, usecom.github.raycw.edidom.input.EdifactBuilder
File ediFile = new File(path);
Builder builder = new EdifactBuilder();
Document doc = builder.buildDocument(ediFile);
### Modify Content ###
Get allSegment
"N9" and change the value of field number 2List segments = doc.getSegments("N9);
for (Segment seg : segments) {
seg.getField(2).setValue("AA")
}
### Write EDI ###
Create cooresponding outputter and output as a stringX12Outputter outputter = new X12Outputter();
String ediOutput = outputter.outputString(doc);
That is!! Good luck!!## License ##
Apache License, Version 2http://www.apache.org/licenses/LICENSE-2.0