public class CssUrlLineInspector extends LineInspector implements NutFilterHolder
This class inspects CSS files to extract nuts referenced with @import statement to process it. Then it adapts the path of those processed nuts to be accessible when exposed to the browser through WUIC uri.
LineInspector.ReplacementInfo
STRING_LITERAL_REGEX
Constructor and Description |
---|
CssUrlLineInspector()
Builds a new instance.
|
Modifier and Type | Method and Description |
---|---|
List<? extends ConvertibleNut> |
appendTransformation(Matcher matcher,
StringBuilder replacement,
EngineRequest request,
CompositeNut.CompositeInputStream cis,
ConvertibleNut originalNut)
Computes the replacement to be made inside the text for the given
Matcher which its find()
method as just been called. |
void |
setNutFilter(List<NutFilter> filters)
Sets the filter.
|
protected String |
toString(ConvertibleNut convertibleNut)
Converts the given
ConvertibleNut to a String representation that is possible to append directly
to the referencer. |
fallbackToVersionNumberInQueryString, getHeap, getPattern, manageAppend, replacementInfo
public List<? extends ConvertibleNut> appendTransformation(Matcher matcher, StringBuilder replacement, EngineRequest request, CompositeNut.CompositeInputStream cis, ConvertibleNut originalNut) throws WuicException
Computes the replacement to be made inside the text for the given Matcher
which its find()
method as just been called.
appendTransformation
in class LineInspector
matcher
- the matcher which provides found text thanks to its group()
method.replacement
- the text which will replace the matching textrequest
- the request that orders this transformationcis
- a composite stream which indicates what nut owns the transformed text, null
if the nut is not a compositionoriginalNut
- the original nutnull
if the inspector did not perform any changeWuicException
- if an exception occursprotected String toString(ConvertibleNut convertibleNut) throws IOException
Converts the given ConvertibleNut
to a String
representation that is possible to append directly
to the referencer. This could be used as an alternative to URL statements.
toString
in class LineInspector
convertibleNut
- the convertible nut to convertString
representation, null
if no inclusion is possibleIOException
- if the transformation failspublic void setNutFilter(List<NutFilter> filters)
Sets the filter.
setNutFilter
in interface NutFilterHolder
filters
- the filtersCopyright © 2012-2015. All Rights Reserved.