ClassDefinition cdef = TraitRegistry.getInstance().getTraitable( coreKlass.getName() );
String proxyName = getProxyName( tdef, cdef );
String wrapperName = getPropertyWrapperName( tdef, cdef );
ReteooComponentFactory rcf = ruleBase.getConfiguration().getComponentFactory();
// JavaDialectRuntimeData data = ruleBase.gett
//
// ((JavaDialectRuntimeData) getPackage( tdef.getDefinedClass().getPackage().getName() ).getDialectRuntimeRegistry().
// getDialectData( "java" ));
TraitPropertyWrapperClassBuilder propWrapperBuilder = (TraitPropertyWrapperClassBuilder) rcf.getClassBuilderFactory().getPropertyWrapperBuilder();
// switch ( mode ) {
// case TRIPLES : propWrapperBuilder = new TraitTriplePropertyWrapperClassBuilderImpl();
// break;
// case MAP : propWrapperBuilder = new TraitMapPropertyWrapperClassBuilderImpl();
// break;
// default : throw new RuntimeException( " This should not happen : unexpected property wrapping method " + mode );
// }
propWrapperBuilder.init( tdef );
try {
byte[] propWrapper = propWrapperBuilder.buildClass( cdef );
ruleBase.registerAndLoadTypeDefinition( wrapperName, propWrapper );
// String resourceName = JavaDialectRuntimeData.convertClassToResourcePath( wrapperName );
// data.putClassDefinition( resourceName, propWrapper );
// data.write( resourceName, propWrapper );
} catch (Exception e) {
e.printStackTrace();
}
TraitProxyClassBuilder proxyBuilder = (TraitProxyClassBuilder) rcf.getClassBuilderFactory().getTraitProxyBuilder();
// switch ( mode ) {
// case TRIPLES : proxyBuilder = new TraitTripleProxyClassBuilderImpl();
// break;
// case MAP : proxyBuilder = new TraitMapProxyClassBuilderImpl();
// break;
// default : throw new RuntimeException( " This should not happen : unexpected property wrapping method " + mode );
// }
proxyBuilder.init( tdef, rcf.getBaseTraitProxyClass() );
try {
byte[] proxy = proxyBuilder.buildClass( cdef );
ruleBase.registerAndLoadTypeDefinition( proxyName, proxy );
// String resourceName = JavaDialectRuntimeData.convertClassToResourcePath( proxyName );