Package io.xlate.edi.schema
Interface SchemaFactory
-
public interface SchemaFactory
-
-
Field Summary
Fields Modifier and Type Field Description static String
SCHEMA_LOCATION_URL_CONTEXT
Property key for a URL (java.lang.String
orjava.net.URL
) to be used with relative file URLs in<include schemaLocation="...">
element/attributes processed by a SchemaFactory.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Schema
createSchema(InputStream stream)
Schema
createSchema(URL location)
Schema
getControlSchema(String standard, String[] version)
Retrieve the control schema for the provided standard and version.Object
getProperty(String name)
Get the value of a feature/property from the underlying implementationboolean
isPropertySupported(String name)
Query the set of properties that this factory supports.static SchemaFactory
newFactory()
Create a new instance of the factory.void
setProperty(String name, Object value)
Allows the user to set specific feature/property on the underlying implementation.
-
-
-
Field Detail
-
SCHEMA_LOCATION_URL_CONTEXT
static final String SCHEMA_LOCATION_URL_CONTEXT
Property key for a URL (java.lang.String
orjava.net.URL
) to be used with relative file URLs in<include schemaLocation="...">
element/attributes processed by a SchemaFactory. Besides a java.net.URL, any class with a toString method that returns a valid URL-formated String may be used as the value for this property.- Since:
- 1.8
- See Also:
- Constant Field Values
-
-
Method Detail
-
newFactory
static SchemaFactory newFactory()
Create a new instance of the factory. This static method creates a new factory instance. Once an application has obtained a reference to an EDIOutputFactory it can use the factory to configure and obtain stream instances.- Returns:
- the factory implementation
-
createSchema
Schema createSchema(URL location) throws EDISchemaException
- Throws:
EDISchemaException
-
createSchema
Schema createSchema(InputStream stream) throws EDISchemaException
- Throws:
EDISchemaException
-
getControlSchema
Schema getControlSchema(String standard, String[] version) throws EDISchemaException
Retrieve the control schema for the provided standard and version. This method loads an internal, immutable schema provided by StAEDI.- Parameters:
standard
- the standard, e.g. X12 or EDIFACTversion
- the version of the standard- Returns:
- the control schema corresponding to the standard and version
- Throws:
EDISchemaException
- when the schema can not be loaded.- Since:
- 1.5
-
isPropertySupported
boolean isPropertySupported(String name)
Query the set of properties that this factory supports.- Parameters:
name
- - The name of the property (may not be null)- Returns:
- true if the property is supported and false otherwise
-
getProperty
Object getProperty(String name)
Get the value of a feature/property from the underlying implementation- Parameters:
name
- - The name of the property (may not be null)- Returns:
- The value of the property
- Throws:
IllegalArgumentException
- if the property is not supported
-
setProperty
void setProperty(String name, Object value)
Allows the user to set specific feature/property on the underlying implementation. The underlying implementation is not required to support every setting of every property in the specification and may use IllegalArgumentException to signal that an unsupported property may not be set with the specified value.- Parameters:
name
- - The name of the property (may not be null)value
- - The value of the property- Throws:
IllegalArgumentException
- if the property is not supported
-
-