Skip to content

Commit

Permalink
Add getControlSchema to SchemaFactory, add Multi-Release to MANIFEST
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeEdgar committed May 11, 2020
1 parent fc99a46 commit 088edd2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>io.xlate</groupId>
<artifactId>staedi</artifactId>
<version>1.4.2-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>

<name>StAEDI : Streaming API for EDI for Java</name>
<description>Streaming API for EDI for Java</description>
Expand Down Expand Up @@ -106,6 +106,13 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ public Schema createSchema(URL location) throws EDISchemaException {
}
}

@Override
public Schema getControlSchema(String standard, String[] version) throws EDISchemaException {
return SchemaUtils.getControlSchema(standard, version);
}

@Override
public boolean isPropertySupported(String name) {
return supportedProperties.contains(name);
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/io/xlate/edi/schema/SchemaFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ public static SchemaFactory newFactory() {

public abstract Schema createSchema(InputStream stream) throws EDISchemaException;

/**
* Retrieve the control schema for the provided standard and version. This method
* loads an internal, immutable schema provided by StAEDI.
*
* @param standard the standard, e.g. X12 or EDIFACT
* @param version the version of the standard
* @return the control schema corresponding to the standard and version
* @throws EDISchemaException when the schema can not be loaded.
*
* @since 1.5
*/
public Schema getControlSchema(String standard, String[] version) throws EDISchemaException;

/**
* Query the set of properties that this factory supports.
*
Expand Down

0 comments on commit 088edd2

Please sign in to comment.