Package org.drools.factmodel

Examples of org.drools.factmodel.ClassBuilder.buildClass()


        type.setNovel( isNovelClass( typeDescr ) );

        if ( type.isNovel() ) {
            try {
                ClassBuilder cb = new ClassBuilder();
                byte[] d = cb.buildClass( def );

                JavaDialectRuntimeData dialect = (JavaDialectRuntimeData) pkgRegistry.getDialectRuntimeRegistry().getDialectData( "java" );

                dialect.write( JavaDialectRuntimeData.convertClassToResourcePath( fullName ),
                               d );
View Full Code Here


                boolean isKey = field.getMetaAttributes().containsKey( "key" );
                fieldDef.setKey( isKey );
                def.addField( fieldDef );
            }

            byte[] d = cb.buildClass( def );

            JavaDialectRuntimeData dialect = (JavaDialectRuntimeData) pkgRegistry.getDialectRuntimeRegistry().getDialectData( "java" );

            dialect.write( JavaDialectRuntimeData.convertClassToResourcePath( fullName ),
                           d );
View Full Code Here

                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 +
View Full Code Here

                    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(
View Full Code Here

                boolean isKey = field.getMetaAttributes().containsKey( "key" );
                fieldDef.setKey( isKey );
                def.addField( fieldDef );
            }

            byte[] d = cb.buildClass( def );

            JavaDialectRuntimeData dialect = (JavaDialectRuntimeData) pkgRegistry.getDialectRuntimeRegistry().getDialectData( "java" );

            dialect.write( JavaDialectRuntimeData.convertClassToResourcePath( fullName ),
                           d );
View Full Code Here

                boolean isKey = field.getMetaAttributes().containsKey( "key" );
                fieldDef.setKey( isKey );
                def.addField( fieldDef );
            }

            byte[] d = cb.buildClass( def );

            JavaDialectRuntimeData dialect = (JavaDialectRuntimeData) pkgRegistry.getDialectRuntimeRegistry().getDialectData( "java" );

            dialect.write( JavaDialectRuntimeData.convertClassToResourcePath( fullName ),
                           d );
View Full Code Here

            JavaDialectRuntimeData dialect = (JavaDialectRuntimeData) pkgRegistry.getDialectRuntimeRegistry().getDialectData( "java" );
            switch ( type.getKind() ) {
                case TRAIT :
                    try {
                        ClassBuilder tb = this.configuration.getClassBuilderFactory().getTraitBuilder();
                        byte[] d = tb.buildClass( def );
                        String resourceName = JavaDialectRuntimeData.convertClassToResourcePath( fullName );
                        dialect.putClassDefinition( resourceName, d );
                        if ( ruleBase != null ) {
                            ruleBase.registerAndLoadTypeDefinition( fullName, d );
                        } else {
View Full Code Here

                    }
                    break;
                case ENUM :
                    try {
                        ClassBuilder eb = this.configuration.getClassBuilderFactory().getEnumClassBuilder();
                        byte[] d = eb.buildClass( def );
                        String resourceName = JavaDialectRuntimeData.convertClassToResourcePath( fullName );
                        dialect.putClassDefinition( resourceName, d );
                        if ( ruleBase != null ) {
                            ruleBase.registerAndLoadTypeDefinition( fullName, d );
                        } else {
View Full Code Here

                    break;
                case CLASS :
                default :
                    try {
                        ClassBuilder cb = this.configuration.getClassBuilderFactory().getBeanClassBuilder();
                        byte[] d = cb.buildClass( def );
                        String resourceName = JavaDialectRuntimeData.convertClassToResourcePath( fullName );
                        dialect.putClassDefinition( resourceName, d );
                        if ( ruleBase != null ) {
                            ruleBase.registerAndLoadTypeDefinition( fullName, d );
                        }
View Full Code Here

            JavaDialectRuntimeData dialect = (JavaDialectRuntimeData) pkgRegistry.getDialectRuntimeRegistry().getDialectData( "java" );
            switch ( type.getKind() ) {
                case TRAIT :
                    try {
                        ClassBuilder tb = ClassBuilderFactory.getTraitBuilderService();
                        byte[] d = tb.buildClass( def );
                        String resourceName = JavaDialectRuntimeData.convertClassToResourcePath( fullName );
                        dialect.putClassDefinition( resourceName, d );
                        dialect.write( resourceName, d );
                    } catch ( Exception e ) {
                        this.results.add( new TypeDeclarationError( typeDescr,
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.