use of org.whole.lang.parsers.ForwardEntityDescriptorStrategyDataTypeParser in project whole by wholeplatform.
the class XsiDataTypeParser method putParserStrategy.
protected void putParserStrategy(String entityType, IDataTypeParser dataTypeParser) {
ForwardEntityDescriptorStrategyDataTypeParser strategy = (ForwardEntityDescriptorStrategyDataTypeParser) getStrategy();
EntityDescriptor<?> ed = CommonsDataTypePersistenceParser.parseEntityDescriptor(entityType);
strategy.putParserStrategy(ed, dataTypeParser);
}
use of org.whole.lang.parsers.ForwardEntityDescriptorStrategyDataTypeParser in project whole by wholeplatform.
the class DataTypesGrammarsDataTypeParser method install.
public static void install(ILanguageKit lk, Map<EntityDescriptor<?>, IDataTypeParser> strategies) {
IDataTypeParser persistence = lk.getDataTypeParser(DataTypeParsers.PERSISTENCE);
IDataTypeParser persistenceStrategy = persistence.getStrategy();
IDataTypeParser presentation = lk.getDataTypeParser(DataTypeParsers.PRESENTATION);
IDataTypeParser presentationStrategy = presentation.getStrategy();
ForwardEntityDescriptorStrategyDataTypeParser persistenceForwardStrategy, presentationForwardStrategy;
if (persistenceStrategy.equals(presentationStrategy)) {
persistenceForwardStrategy = presentationForwardStrategy = new ForwardEntityDescriptorStrategyDataTypeParser(presentationStrategy);
persistenceForwardStrategy.putParserStrategies(strategies);
} else {
persistenceForwardStrategy = new ForwardEntityDescriptorStrategyDataTypeParser(presentationStrategy);
persistenceForwardStrategy.putParserStrategies(strategies);
presentationForwardStrategy = new ForwardEntityDescriptorStrategyDataTypeParser(presentationStrategy);
presentationForwardStrategy.putParserStrategies(strategies);
}
persistence.setStrategy(persistenceForwardStrategy);
presentation.setStrategy(presentationForwardStrategy);
}
Aggregations