@HashCodeAndEqualsPlugin.Enhance public static class Plugin.Engine.Listener.StreamWriting extends Plugin.Engine.Listener.Adapter
PrintStream
.Plugin.Engine.Listener.Adapter, Plugin.Engine.Listener.Compound, Plugin.Engine.Listener.ForErrorHandler, Plugin.Engine.Listener.NoOp, Plugin.Engine.Listener.StreamWriting, Plugin.Engine.Listener.WithErrorsOnly, Plugin.Engine.Listener.WithTransformationsOnly
Plugin.Engine.ErrorHandler.Enforcing, Plugin.Engine.ErrorHandler.Failing
Modifier and Type | Field and Description |
---|---|
protected static String |
PREFIX
The prefix that is appended to all written messages.
|
Constructor and Description |
---|
StreamWriting(PrintStream printStream)
Creates a new stream writing listener.
|
Modifier and Type | Method and Description |
---|---|
void |
onComplete(TypeDescription typeDescription)
Invoked upon completing handling a type that was either transformed or ignored.
|
void |
onDiscovery(String typeName)
Invoked upon discovering a type but prior to its resolution.
|
void |
onError(Plugin plugin,
Throwable throwable)
Invoked at the end of the build if a plugin could not be closed.
|
void |
onError(TypeDescription typeDescription,
Plugin plugin,
Throwable throwable)
Invoked if an error occured during a plugin's application on a given type.
|
void |
onIgnored(TypeDescription typeDescription,
Plugin plugin)
Invoked if a type description is ignored by a given plugin.
|
void |
onLiveInitializer(TypeDescription typeDescription,
TypeDescription definingType)
Invoked if a type transformation implied a live initializer.
|
void |
onManifest(Manifest manifest)
Invoked when a manifest was found or found missing.
|
void |
onResource(String name)
Invoked if a resource that is not a class file is discovered.
|
void |
onTransformation(TypeDescription typeDescription,
Plugin plugin)
Invoked after a type was transformed using a specific plugin.
|
void |
onUnresolved(String typeName)
Invoked if a type could not be resolved.
|
static Plugin.Engine.Listener.StreamWriting |
toSystemError()
Creates a stream writing listener that prints all events on
System.err . |
static Plugin.Engine.Listener.StreamWriting |
toSystemOut()
Creates a stream writing listener that prints all events on
System.out . |
Plugin.Engine.Listener |
withErrorsOnly()
Returns a new listener that only prints error events.
|
Plugin.Engine.Listener |
withTransformationsOnly()
Returns a new listener that only prints transformation and error events.
|
onError, onError, onIgnored, onTransformation
protected static final String PREFIX
public StreamWriting(PrintStream printStream)
printStream
- The print stream to delegate to.public static Plugin.Engine.Listener.StreamWriting toSystemOut()
System.out
.public static Plugin.Engine.Listener.StreamWriting toSystemError()
System.err
.public Plugin.Engine.Listener withTransformationsOnly()
public Plugin.Engine.Listener withErrorsOnly()
public void onDiscovery(String typeName)
onDiscovery
in interface Plugin.Engine.Listener
onDiscovery
in class Plugin.Engine.Listener.Adapter
typeName
- The name of the discovered type.public void onTransformation(TypeDescription typeDescription, Plugin plugin)
onTransformation
in interface Plugin.Engine.Listener
onTransformation
in class Plugin.Engine.Listener.Adapter
typeDescription
- The type being transformed.plugin
- The plugin that was applied.public void onIgnored(TypeDescription typeDescription, Plugin plugin)
onIgnored
in interface Plugin.Engine.Listener
onIgnored
in class Plugin.Engine.Listener.Adapter
typeDescription
- The type being transformed.plugin
- The plugin that ignored the given type.public void onError(TypeDescription typeDescription, Plugin plugin, Throwable throwable)
onError
in interface Plugin.Engine.ErrorHandler
onError
in class Plugin.Engine.Listener.Adapter
typeDescription
- The type being matched or transformed.plugin
- The plugin being applied.throwable
- The throwable that caused the error.public void onError(Plugin plugin, Throwable throwable)
onError
in interface Plugin.Engine.ErrorHandler
onError
in class Plugin.Engine.Listener.Adapter
plugin
- The plugin that could not be closed.throwable
- The error that was caused when the plugin was attempted to be closed.public void onUnresolved(String typeName)
onUnresolved
in interface Plugin.Engine.ErrorHandler
onUnresolved
in class Plugin.Engine.Listener.Adapter
typeName
- The name of the unresolved type.public void onLiveInitializer(TypeDescription typeDescription, TypeDescription definingType)
onLiveInitializer
in interface Plugin.Engine.ErrorHandler
onLiveInitializer
in class Plugin.Engine.Listener.Adapter
typeDescription
- The type that was transformed.definingType
- The type that implies the initializer which might be the type itself or an auxiliary type.public void onComplete(TypeDescription typeDescription)
onComplete
in interface Plugin.Engine.Listener
onComplete
in class Plugin.Engine.Listener.Adapter
typeDescription
- The type that was transformed.public void onManifest(Manifest manifest)
onManifest
in interface Plugin.Engine.ErrorHandler
onManifest
in class Plugin.Engine.Listener.Adapter
manifest
- The located manifest or null
if no manifest was found.public void onResource(String name)
onResource
in interface Plugin.Engine.ErrorHandler
onResource
in class Plugin.Engine.Listener.Adapter
name
- The name of the discovered resource.Copyright © 2014–2019. All rights reserved.