@Override
  public void process(final Resource resource, final Reader reader,
      final Writer writer)
      throws IOException {
    if (resource != null) {
      final String uri = resource.getUri();
      LOG.debug("matching uri: {}", uri);
      if (includes) {
        // Match (p1 OR p2 OR .. pn)
        for (String pattern : patterns) {
          if (matcher.match(pattern, uri)) {
            LOG.debug("Processing resource: {}. Match found: {}",
                uri, toString());
            getDecoratedObject().process(resource, reader, writer);
            return;
          }
        }
      } else {
        boolean process = true;
        // Match !(p1 AND p2 AND .. pn)
        for (String pattern : patterns) {
          if (matcher.match(pattern, uri)) {
            process = false;
            break;
          }
        }
        if (process) {
          LOG.debug("Processing resource: {}. Match found: {}", uri,
              toString());
          getDecoratedObject().process(resource, reader, writer);
          return;
        }
      }
      LOG.debug("Skipping {} from {}. No match found: {}", new Object[] {
          uri, getDecoratedObject(), toString() });
      WroUtil.safeCopy(reader, writer);
    } else {
      throw new WroRuntimeException("Wrong usage of "
          + toString() + ". Please use it as a pre-processor.");
    }
  }
@Override
  public void process(final Resource resource, final Reader reader,
      final Writer writer)
      throws IOException {
    if (resource != null) {
      final String uri = resource.getUri();
      LOG.debug("matching uri: {}", uri);
      if (includes) {
        
        for (String pattern : patterns) {
          if (matcher.match(pattern, uri)) {
            LOG.debug("Processing resource: {}. Match found: {}",
                uri, toString());
            getDecoratedObject().process(resource, reader, writer);
            return;
          }
        }
      } else {
        boolean process = true;
        
        for (String pattern : patterns) {
          if (matcher.match(pattern, uri)) {
            process = false;
            break;
          }
        }
        if (process) {
          LOG.debug("Processing resource: {}. Match found: {}", uri,
              toString());
          getDecoratedObject().process(resource, reader, writer);
          return;
        }
      }
      LOG.debug("Skipping {} from {}. No match found: {}", new Object[] {
          uri, getDecoratedObject(), toString() });
      WroUtil.safeCopy(reader, writer);
    } else {
      throw new WroRuntimeException("Wrong usage of "
          + toString() + ". Please use it as a pre-processor.");
    }
  }
@ Override public void process ( final Resource resource , final Reader reader , final Writer writer ) throws IOException { if ( resource != null ) { final String uri = resource . getUri ( ) ; LOG . debug ( "matching uri: {}" , uri ) ; if ( includes ) { // Match (p1 OR p2 OR .. pn) for ( String pattern : patterns ) { if ( matcher . match ( pattern , uri ) ) { LOG . debug ( "Processing resource: {}. Match found: {}" , uri , toString ( ) ) ; getDecoratedObject ( ) . process ( resource , reader , writer ) ; return ; } } } else { boolean process = true ; // Match !(p1 AND p2 AND .. pn) for ( String pattern : patterns ) { if ( matcher . match ( pattern , uri ) ) { process = false ; break ; } } if ( process ) { LOG . debug ( "Processing resource: {}. Match found: {}" , uri , toString ( ) ) ; getDecoratedObject ( ) . process ( resource , reader , writer ) ; return ; } } LOG . debug ( "Skipping {} from {}. No match found: {}" , new Object [ ] { uri , getDecoratedObject ( ) , toString ( ) } ) ; WroUtil . safeCopy ( reader , writer ) ; } else { throw new WroRuntimeException ( "Wrong usage of " + toString ( ) + ". Please use it as a pre-processor." ) ; } }
{@inheritDoc}
{