Search in sources :

Example 1 with ForwardEntityDescriptorStrategyDataTypeParser

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);
}
Also used : ForwardEntityDescriptorStrategyDataTypeParser(org.whole.lang.parsers.ForwardEntityDescriptorStrategyDataTypeParser)

Example 2 with ForwardEntityDescriptorStrategyDataTypeParser

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);
}
Also used : ForwardEntityDescriptorStrategyDataTypeParser(org.whole.lang.parsers.ForwardEntityDescriptorStrategyDataTypeParser) IDataTypeParser(org.whole.lang.parsers.IDataTypeParser)

Aggregations

ForwardEntityDescriptorStrategyDataTypeParser (org.whole.lang.parsers.ForwardEntityDescriptorStrategyDataTypeParser)2 IDataTypeParser (org.whole.lang.parsers.IDataTypeParser)1