Examples of JavaDialectRuntimeData


Examples of org.drools.rule.JavaDialectRuntimeData

        }

        if ( type.isNovel() ) {
            String fullName = typeDescr.getType().getFullName();
            JavaDialectRuntimeData dialect = (JavaDialectRuntimeData) pkgRegistry.getDialectRuntimeRegistry().getDialectData( "java" );
            switch ( type.getFormat() ) {
                case TRAIT :
                    try {
                        byte[] d;

                        ClassBuilder tb = ClassBuilderFactory.getTraitBuilderService();
                        d = tb.buildClass( def );
                        dialect.write( JavaDialectRuntimeData.convertClassToResourcePath( fullName ),
                                       d );

                    } catch ( Exception e ) {
                        this.results.add( new TypeDeclarationError( "Unable to compile declared trait " + fullName + ": " + e.getMessage() + ";",
                                                                    typeDescr.getLine() ) );
                    }
                    break;
                case POJO :
                default :
                    try {
                        ClassBuilder cb = ClassBuilderFactory.getBeanClassBuilderService();
                        byte[] d = cb.buildClass( def );
                        dialect.write( JavaDialectRuntimeData.convertClassToResourcePath( fullName ),
                                       d );

                    } catch ( Exception e ) {
                        this.results.add( new TypeDeclarationError( "Unable to create a class for declared type " + fullName + ": " + e.getMessage() + ";",
                                                                    typeDescr.getLine() ) );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.