Package org.guvnor.common.services.project.builder.service

Examples of org.guvnor.common.services.project.builder.service.BuildValidationHelper


                        if ( !Files.isRegularFile( resource ) ) {
                            continue;
                        }

                        //Resource Type might require "external" validation (i.e. it's not covered by Kie)
                        final BuildValidationHelper validator = getBuildValidationHelper( resource );
                        if ( validator != null ) {
                            final List<ValidationMessage> addedValidationMessages = validator.validate( Paths.convert( resource ) );

                            if ( !( addedValidationMessages == null || addedValidationMessages.isEmpty() ) ) {
                                for ( ValidationMessage validationMessage : addedValidationMessages ) {
                                    nonKieResourceValidatorAddedMessages.add( validationMessage );
                                }
View Full Code Here


            } else {
                //Don't process dotFiles
                if ( !dotFileFilter.accept( path ) ) {

                    //Resource Type might require "external" validation (i.e. it's not covered by Kie)
                    final BuildValidationHelper validator = getBuildValidationHelper( path );
                    if ( validator != null ) {
                        final org.uberfire.backend.vfs.Path vfsPath = Paths.convert( path );
                        final List<ValidationMessage> addedValidationMessages = validator.validate( vfsPath );
                        nonKieResourceValidationHelperMessages.put( path,
                                                                    addedValidationMessages );
                    }

                    //Add new resource
View Full Code Here

        final BuildResults results = convertMessages( kieResults );

        //Validate paths that are not handled by Kie
        for ( Map.Entry<Path, BuildValidationHelper> e : nonKieResourceValidationHelpers.entrySet() ) {
            final Path resource = e.getKey();
            final BuildValidationHelper validator = e.getValue();
            final List<ValidationMessage> validationMessages = validator.validate( Paths.convert( resource ) );
            if ( !( validationMessages == null || validationMessages.isEmpty() ) ) {
                for ( ValidationMessage validationMessage : validationMessages ) {
                    results.addBuildMessage( convertValidationMessage( validationMessage ) );
                }
                nonKieResourceValidationHelperMessages.put( resource,
View Full Code Here

        for ( Message message : incrementalResults.getRemovedMessages() ) {
            handles.remove( RESOURCE_PATH + "/" + message.getPath() );
        }

        //Resource Type might require "external" validation (i.e. it's not covered by Kie)
        final BuildValidationHelper validator = getBuildValidationHelper( resource );
        if ( validator != null ) {
            nonKieResourceValidationHelpers.put( resource,
                                                 validator );
            final List<ValidationMessage> addedValidationMessages = validator.validate( Paths.convert( resource ) );
            if ( !( addedValidationMessages == null || addedValidationMessages.isEmpty() ) ) {
                for ( ValidationMessage validationMessage : addedValidationMessages ) {
                    results.addAddedMessage( convertValidationMessage( validationMessage ) );
                }
            }
View Full Code Here

        for ( Message message : incrementalResults.getRemovedMessages() ) {
            handles.remove( RESOURCE_PATH + "/" + message.getPath() );
        }

        //Resource Type might have been validated "externally" (i.e. it's not covered by Kie). Clear any errors.
        final BuildValidationHelper validator = getBuildValidationHelper( resource );
        if ( validator != null ) {
            nonKieResourceValidationHelpers.remove( resource );
            final List<ValidationMessage> removedValidationMessages = nonKieResourceValidationHelperMessages.remove( resource );
            if ( !( removedValidationMessages == null || removedValidationMessages.isEmpty() ) ) {
                for ( ValidationMessage validationMessage : removedValidationMessages ) {
View Full Code Here

                final Path resource = Paths.convert( pathCollectionEntry.getKey() );

                checkNotNull( "type", type );
                checkNotNull( "resource", resource );

                final BuildValidationHelper validator = getBuildValidationHelper( resource );
                final String destinationPath = resource.toUri().toString().substring( projectPrefix.length() + 1 );
                changedFilesKieBuilderPaths.add( destinationPath );
                switch ( type ) {
                    case ADD:
                    case UPDATE:
                        //Only files can be processed
                        if ( !Files.isRegularFile( resource ) ) {
                            continue;
                        }

                        final InputStream is = ioService.newInputStream( resource );
                        final BufferedInputStream bis = new BufferedInputStream( is );
                        kieFileSystem.write( destinationPath,
                                             KieServices.Factory.get().getResources().newInputStreamResource( bis ) );
                        addJavaClass( resource );
                        handles.put( destinationPath,
                                     pathCollectionEntry.getKey() );

                        //Resource Type might require "external" validation (i.e. it's not covered by Kie)
                        if ( validator != null ) {
                            nonKieResourceValidationHelpers.put( resource,
                                                                 validator );
                            final List<ValidationMessage> addedValidationMessages = validator.validate( Paths.convert( resource ) );
                            if ( !( addedValidationMessages == null || addedValidationMessages.isEmpty() ) ) {
                                for ( ValidationMessage validationMessage : addedValidationMessages ) {
                                    nonKieResourceValidatorAddedMessages.add( validationMessage );
                                }
                            }
View Full Code Here

                    addJavaClass( path );
                    handles.put( destinationPath,
                                 Paths.convert( path ) );

                    //Resource Type might require "external" validation (i.e. it's not covered by Kie)
                    final BuildValidationHelper validator = getBuildValidationHelper( path );
                    if ( validator != null ) {
                        nonKieResourceValidationHelpers.put( path,
                                                             validator );
                    }
                }
View Full Code Here

                throw new IllegalStateException( "A full build needs to be performed before any incremental operations." );
            }

            //Resource Type might require "external" validation (i.e. it's not covered by Kie)
            final IncrementalBuildResults results = new IncrementalBuildResults( gav );
            final BuildValidationHelper validator = getBuildValidationHelper( resource );
            if ( validator != null ) {
                final List<ValidationMessage> addedValidationMessages = validator.validate( Paths.convert( resource ) );

                if ( !( addedValidationMessages == null || addedValidationMessages.isEmpty() ) ) {
                    for ( ValidationMessage validationMessage : addedValidationMessages ) {
                        results.addAddedMessage( convertValidationMessage( validationMessage ) );
                    }
View Full Code Here

                throw new IllegalStateException( "A full build needs to be performed before any incremental operations." );
            }

            //Resource Type might have been validated "externally" (i.e. it's not covered by Kie). Clear any errors.
            final IncrementalBuildResults results = new IncrementalBuildResults( gav );
            final BuildValidationHelper validator = getBuildValidationHelper( resource );
            if ( validator != null ) {
                nonKieResourceValidationHelpers.remove( resource );
                final List<ValidationMessage> removedValidationMessages = nonKieResourceValidationHelperMessages.remove( resource );
                if ( !( removedValidationMessages == null || removedValidationMessages.isEmpty() ) ) {
                    for ( ValidationMessage validationMessage : removedValidationMessages ) {
View Full Code Here

                            if ( !Files.isRegularFile( resource ) ) {
                                continue;
                            }

                            //Resource Type might require "external" validation (i.e. it's not covered by Kie)
                            final BuildValidationHelper validator = getBuildValidationHelper( resource );
                            if ( validator != null ) {
                                final List<ValidationMessage> addedValidationMessages = validator.validate( Paths.convert( resource ) );

                                if ( !( addedValidationMessages == null || addedValidationMessages.isEmpty() ) ) {
                                    for ( ValidationMessage validationMessage : addedValidationMessages ) {
                                        nonKieResourceValidatorAddedMessages.add( validationMessage );
                                    }
View Full Code Here

TOP

Related Classes of org.guvnor.common.services.project.builder.service.BuildValidationHelper

Copyright © 2018 www.massapicom. 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.