public class TransformedNut extends NutWrapper implements Serializable
A transformed nut wraps a ConvertibleNut
and considers its input stream as the result of the transformation.
Consequently, not transformers will be used and no changes of the state will be accepted.
The instances could be serialized so the wrapped nut must be a Serializable
.
Constructor and Description |
---|
TransformedNut(ConvertibleNut w)
Builds a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addReferencedNut(ConvertibleNut referenced)
Adds a new nut referenced by this nut.
|
void |
addTransformer(Pipe.Transformer transformer)
Adds a
Pipe.Transformer . |
void |
setNutName(String nutName)
Sets the nut name.
|
void |
transform(Pipe.OnReady... onReady)
Transforms the source stream with all registered transformers and calls the given callback in addition
to callbacks previously registered.
|
getName, getNutType, getOriginalNuts, getReadyCallbacks, getReferencedNuts, getTransformers, isCompressed, isDynamic, isSubResource, isTransformed, onReady, openStream, setIsCompressed, setIsSubResource, setNutType
equals, getInitialName, getInitialNutType, getParentFile, getProxyUri, getVersionNumber, hashCode, setProxyUri, setVersionNumber, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getInitialName, getInitialNutType, getParentFile, getProxyUri, getVersionNumber, setProxyUri
public TransformedNut(ConvertibleNut w)
Builds a new instance.
w
- the wrapped nutpublic void setNutName(String nutName)
Sets the nut name.
setNutName
in interface ConvertibleNut
setNutName
in class NutWrapper
nutName
- the namepublic void transform(Pipe.OnReady... onReady) throws IOException
Transforms the source stream with all registered transformers and calls the given callback in addition to callbacks previously registered. The method also writes the result to the given output stream.
transform
in interface ConvertibleNut
transform
in class NutWrapper
onReady
- the callbackIOException
- if an I/O error occurspublic void addTransformer(Pipe.Transformer transformer)
Adds a Pipe.Transformer
.
addTransformer
in interface ConvertibleNut
addTransformer
in class NutWrapper
transformer
- the transformerpublic void addReferencedNut(ConvertibleNut referenced)
Adds a new nut referenced by this nut.
addReferencedNut
in interface ConvertibleNut
addReferencedNut
in class NutWrapper
referenced
- the referenced nutCopyright © 2012-2015. All Rights Reserved.