use of org.whole.lang.xsd.parsers.XsiDataTypeParser in project whole by wholeplatform.
the class XsdLanguageKit method getDataTypeParser.
@Override
public IDataTypeParser getDataTypeParser(DataTypeParsers kind) {
if (dataTypeParser == null) {
IMappingStrategy mappingStrategy = MappingStrategyRegistry.instance().getMappingStrategy(getURI());
if (mappingStrategy == null)
return super.getDataTypeParser(kind);
dataTypeParser = new XsiDataTypeParser(mappingStrategy.getDataTypeParsers());
}
return dataTypeParser;
}
use of org.whole.lang.xsd.parsers.XsiDataTypeParser 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