Examples of buildClass()


Examples of cn.shenyanchao.builder.CompilationUnitBuilder.buildClass()

                String methodName = methodDeclaration.getName();
                getLog().info("methodName:" + methodDeclaration.getName());
                classTypeBuilder.buildMethod(methodName + Consts.TEST_SUFFIX, methodDeclaration);
            }

            compilationUnitBuilder.buildClass(classTypeBuilder.build());
        }

        CompilationUnit testCompilationUnit = compilationUnitBuilder.build();

        //写入测试代码文件
View Full Code Here

Examples of cn.shenyanchao.ut.builder.CompilationUnitBuilder.buildClass()

        //process methods
        for (MethodDeclaration methodDeclaration : methodDeclarations) {
            String methodName = methodDeclaration.getName();
            classTypeBuilder.buildMethod(methodName + Consts.TEST_SUFFIX, methodDeclaration);
        }
        compilationUnitBuilder.buildClass(classTypeBuilder.build());
        return compilationUnitBuilder;
    }
}
View Full Code Here

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

            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

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

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

            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

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

                    }
                    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

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

                    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

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

                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() + ";",
View Full Code Here

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

                    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() + ";",
View Full Code Here

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

                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
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.