use of com.siemens.ct.exi.FidelityOptions in project arctic-sea by 52North.
the class EXIUtils method newEXIFactory.
/**
* @return An {@link EXIFactory} instance configured according the service
* configuration.
*
* @throws UnsupportedOption
* if one of the fidelity options is not supported.
*/
public EXIFactory newEXIFactory() throws UnsupportedOption {
EXIFactory factory = DefaultEXIFactory.newInstance();
factory.setGrammars(getGrammars());
// something else?
if (this.isStrict) {
factory.setFidelityOptions(FidelityOptions.createStrict());
} else if (this.isDefault) {
factory.setFidelityOptions(FidelityOptions.createDefault());
} else {
FidelityOptions options = factory.getFidelityOptions();
options.setFidelity(FidelityOptions.FEATURE_COMMENT, this.preserveComments);
options.setFidelity(FidelityOptions.FEATURE_PI, this.preserveProcessingInstructions);
options.setFidelity(FidelityOptions.FEATURE_DTD, this.preserveDTD);
options.setFidelity(FidelityOptions.FEATURE_PREFIX, this.preservePrefixes);
options.setFidelity(FidelityOptions.FEATURE_LEXICAL_VALUE, this.preserveLexicalValue);
}
factory.setCodingMode(alignment);
// }
return factory;
}
Aggregations