public class SelectiveContentsTransformer extends java.lang.Object implements ContentsTransformer
ContentsTransformer that delegates contents transformation to one of two delegates, depending on whether
the name argument matches a string Predicate or not.| Constructor and Description |
|---|
SelectiveContentsTransformer(Predicate<? super java.lang.String> namePredicate,
ContentsTransformer transformer,
ContentsTransformer delegate)
If the
namePredicate does not match the node's name, then the delegate is called. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
toString() |
void |
transform(java.lang.String name,
java.io.InputStream is,
java.io.OutputStream os)
If the
namePredicate does not match the name, then the delegate is called with
arguments is and os. |
public SelectiveContentsTransformer(Predicate<? super java.lang.String> namePredicate, ContentsTransformer transformer, ContentsTransformer delegate)
namePredicate does not match the node's name, then the delegate is called.
Otherwise the delegate is called, and its output is piped through the transformer.
Notice that the preformance is particularly good if the transformer and/or the delegate is
ContentsTransformations.COPY.
public void transform(java.lang.String name,
java.io.InputStream is,
java.io.OutputStream os)
throws java.io.IOException
namePredicate does not match the name, then the delegate is called with
arguments is and os.
Otherwise the delegate is called with argument is, and its output is piped through the transformer before it is written to os.transform in interface ContentsTransformername - Designates the contents that is transformedjava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object