use of org.whole.lang.xsd.visitors.XsiPrettyPrinterVisitor in project whole by wholeplatform.
the class SchemaHelpers method deploySchemaOperations.
public static void deploySchemaOperations(final String languageUri) {
ILanguageKit lk = ReflectionFactory.getLanguageKit(languageUri, false, null);
if (!lk.isDynamic())
return;
// configure data-type parsers
IMappingStrategy mappingStrategy = MappingStrategyRegistry.instance().getMappingStrategy(languageUri);
IDataTypeParser parser = new XsiDataTypeParser(mappingStrategy.getDataTypeParsers());
DynamicLanguageKit languageKit = (DynamicLanguageKit) lk;
languageKit.setDataTypeParser(DataTypeParsers.PERSISTENCE, parser);
languageKit.setDataTypeParser(DataTypeParsers.PRESENTATION, parser);
// deploy a generic pretty print
ReflectionFactory.deploy(new AbstractLanguageExtensionDeployer() {
public void deploy(ReflectionFactory platform) {
platform.addOperationFactory(languageUri, PrettyPrinterOperation.ID, new IVisitorFactory() {
public IVisitor create(IOperation operation, int stage) {
return new XsiPrettyPrinterVisitor();
}
});
}
});
}
Aggregations