ro.isdc.wro.model.transformer
Class WildcardExpanderModelTransformer

java.lang.Object
  extended by ro.isdc.wro.model.transformer.WildcardExpanderModelTransformer
All Implemented Interfaces:
Transformer<WroModel>

public class WildcardExpanderModelTransformer
extends Object
implements Transformer<WroModel>

A decorator which looks up for resources containing wildcards and replaces them with the corresponding collection of specific resources. For example, a resource of this type:

<js>/path/to/**.js</js>

can be transformed into:

<js>/path/to/a1.js</js>
<js>/path/to/a2.js</js>
<js>/path/to/a3.js</js>

This model transformation is also known as wildcard expander, because it mutates the model after it is built by adding resources to the group which contains resources with wildcard uri.

Since:
1.4.0
Author:
Alex Objelean

Nested Class Summary
static class WildcardExpanderModelTransformer.NoMoreAttemptsIOException
          An instance of IOException having a special purpose: to skip subsequent attempts to localize a stream.
 
Constructor Summary
WildcardExpanderModelTransformer()
           
 
Method Summary
 Function<Collection<File>,Void> createExpanderHandler(Group group, Resource resource, String baseNameFolder)
          create the handler which expand the resources containing wildcard.
 WroModel transform(WroModel input)
          Apply a transformation on the input object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WildcardExpanderModelTransformer

public WildcardExpanderModelTransformer()
Method Detail

transform

public WroModel transform(WroModel input)
Apply a transformation on the input object.

Specified by:
transform in interface Transformer<WroModel>
Parameters:
input - the object to transform.
Returns:
the transformed object.

createExpanderHandler

public Function<Collection<File>,Void> createExpanderHandler(Group group,
                                                             Resource resource,
                                                             String baseNameFolder)
create the handler which expand the resources containing wildcard.



Copyright © 2008-2013. All Rights Reserved.