konst = cacheConstructor( key, core, trait );
}
}
T proxy = null;
HierarchyEncoder hier = ruleBase.getConfiguration().getComponentFactory().getTraitRegistry().getHierarchy();
try {
switch ( mode ) {
case MAP : proxy = konst.newInstance( core, core._getDynamicProperties(), hier.getCode( trait.getName() ), hier.getBottom(), logical );
break;
case TRIPLES: proxy = konst.newInstance( core, ruleBase.getTripleStore(), getTripleFactory(), hier.getCode( trait.getName() ), hier.getBottom(), logical );
break;
default : throw new RuntimeException( " This should not happen : unexpected property wrapping method " + mode );
}
return proxy;