@SuppressWarnings({ "rawtypes", "unchecked" })
    public static PackagingProcessor<? extends Archive<?>> find(
            final PackagingType packagingType) {

        ServiceRegistry registry = ServiceRegistry.getInstance();
        Collection<PackagingProcessor> processors = registry.all(PackagingProcessor.class);

        StringBuilder unsupportedFormatMessage = new StringBuilder("No packaging processor for ")
                .append(packagingType.toString()).append(
                        " packaging was found. Supported processors are: ");

        for (PackagingProcessor processor : processors) {
            if (processor.handles(packagingType)) {
                // unchecked cast
                return (PackagingProcessor<? extends Archive<?>>) processor;
            }
            unsupportedFormatMessage.append(processor.getClass()).append(", ");
        }
        // trim
        if (unsupportedFormatMessage.indexOf(", ") != -1) {
            unsupportedFormatMessage.delete(unsupportedFormatMessage.length() - 2, unsupportedFormatMessage.length());
        }

        throw new UnsupportedOperationException(unsupportedFormatMessage.toString());
    }
@ SuppressWarnings ( { "rawtypes" , "unchecked" } ) public static PackagingProcessor < ? extends Archive < ? > > find ( final PackagingType packagingType ) { ServiceRegistry registry = ServiceRegistry . getInstance ( ) ; Collection < PackagingProcessor > processors = registry . all ( PackagingProcessor . class ) ; StringBuilder unsupportedFormatMessage = new StringBuilder ( "No packaging processor for " ) . append ( packagingType . toString ( ) ) . append ( " packaging was found. Supported processors are: " ) ; for ( PackagingProcessor processor : processors ) { if ( processor . handles ( packagingType ) ) { return ( PackagingProcessor < ? extends Archive < ? > > ) processor ; } unsupportedFormatMessage . append ( processor . getClass ( ) ) . append ( ", " ) ; } if ( unsupportedFormatMessage . indexOf ( ", " ) != - 1 ) { unsupportedFormatMessage . delete ( unsupportedFormatMessage . length ( ) - 2 , unsupportedFormatMessage . length ( ) ) ; } throw new UnsupportedOperationException ( unsupportedFormatMessage . toString ( ) ) ; }
Finds the first packaging processor on the classpath that supports give {@code packageType}

@param packagingType Package type
@return