public abstract class AbstractSatisfactionVisitor<T> extends Object implements SatisfactionVisitor<T>
SatisfactionVisitor
. All methods delegate to
visitDefault()
, which in turn returns a default value.Modifier and Type | Field and Description |
---|---|
protected T |
defaultValue |
Constructor and Description |
---|
AbstractSatisfactionVisitor()
Construct a visitor with a null default.
|
AbstractSatisfactionVisitor(T dft)
Construct a visitor with the specified default value.
|
Modifier and Type | Method and Description |
---|---|
T |
visitClass(Class<?> clazz)
Called when visiting a satisfaction that will instantiate a class.
|
T |
visitDefault()
Default method called when other methods are not overridden.
|
T |
visitInstance(Object instance)
Called when visiting a satisfaction that will return a pre-configured instance.
|
T |
visitNull()
Called when visiting a null satisfaction.
|
T |
visitProviderClass(Class<? extends javax.inject.Provider<?>> pclass)
Called when visiting a satisfaction that will instantiate and invoke a provider class.
|
T |
visitProviderInstance(javax.inject.Provider<?> provider)
Called when visiting a satisfaction that will invoke a pre-instantiated provider.
|
protected final T defaultValue
public AbstractSatisfactionVisitor()
public AbstractSatisfactionVisitor(T dft)
dft
- The default value to be returned by visitDefault()
.public T visitDefault()
AbstractSatisfactionVisitor(Object)
.public T visitNull()
SatisfactionVisitor
visitNull
in interface SatisfactionVisitor<T>
public T visitClass(Class<?> clazz)
SatisfactionVisitor
visitClass
in interface SatisfactionVisitor<T>
clazz
- The implementation class.public T visitInstance(Object instance)
SatisfactionVisitor
visitInstance
in interface SatisfactionVisitor<T>
instance
- The instance that will be returned. The visitor should not modify it
in any way.public T visitProviderClass(Class<? extends javax.inject.Provider<?>> pclass)
SatisfactionVisitor
visitProviderClass
in interface SatisfactionVisitor<T>
pclass
- The provider class.public T visitProviderInstance(javax.inject.Provider<?> provider)
SatisfactionVisitor
visitProviderInstance
in interface SatisfactionVisitor<T>
provider
- The provider instance. The visitor should not modify it in any way.Copyright © 2016 GroupLens Research. All rights reserved.