public static void setMode( VirtualPropertyMode newMode, KnowledgeBase kBase ) {
RuleBase ruleBase = ((KnowledgeBaseImpl) kBase).getRuleBase();
ReteooComponentFactory rcf = ((AbstractRuleBase) ruleBase).getConfiguration().getComponentFactory();
ClassBuilderFactory cbf = rcf.getClassBuilderFactory();
rcf.getTraitFactory().mode = newMode;
switch ( newMode ) {
case MAP :
cbf.setPropertyWrapperBuilder( new TraitMapPropertyWrapperClassBuilderImpl() );
cbf.setTraitProxyBuilder( new TraitMapProxyClassBuilderImpl() );
break;
case TRIPLES:
cbf.setPropertyWrapperBuilder( new TraitTriplePropertyWrapperClassBuilderImpl() );
cbf.setTraitProxyBuilder( new TraitTripleProxyClassBuilderImpl() );
break;
default : throw new RuntimeException( " This should not happen : unexpected property wrapping method " + newMode );
}
}