Class Overview
Abstract class that makes it easy to create transforms that go from string to string. Override
#getEncoding() to customize the character encoding of the underlying content and transformed content.
For example, here is a minimal transformer that prepends text to the underlying resource:
public class PrefixTransformer implements WebResourceTransformer
{
public DownloadableResource transform(Element configElement, ResourceLocation location, String filePath, DownloadableResource nextResource)
{
return new CharSequenceDownloadableResource(nextResource)
{
protected CharSequence transform(CharSequence originalContent)
{
return "Prefix: " + originalContent;
}
};
}
}
Protected Constructors
Public Methods
Protected Methods
Override this method to transform the original content into a new format.
Parameters
original
| The content from the original resource. |