public class SourceMapLineInspector extends LineInspector
This inspector removes from scripts the "sourceMappingURL" statement when the chain is going to minify/aggregate it. Otherwise, extracts the source map.
A source map is not a sub resource since this is not required before loading a page.
LineInspector.ReplacementInfo
STRING_LITERAL_REGEX
Constructor and Description |
---|
SourceMapLineInspector(NodeEngine enclosingEngine)
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. |
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 SourceMapLineInspector(NodeEngine enclosingEngine)
Builds a new instance.
enclosingEngine
- the engine that uses this injectorprotected 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 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 occursCopyright © 2012-2015. All Rights Reserved.