|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.batch.classify.ClassifierAdapter<C,T>
public class ClassifierAdapter<C,T>
Wrapper for an object to adapt it to the Classifier
interface.
Constructor Summary | |
---|---|
ClassifierAdapter()
Default constructor for use with setter injection. |
|
ClassifierAdapter(Classifier<C,T> delegate)
Create a new Classifier from the delegate provided. |
|
ClassifierAdapter(Object delegate)
Create a new Classifier from the delegate provided. |
Method Summary | |
---|---|
T |
classify(C classifiable)
Classify the given object and return an object of a different type, possibly an enumerated type. |
void |
setDelegate(Classifier<C,T> delegate)
|
void |
setDelegate(Object delegate)
Search for the Classifier annotation on a method in the supplied delegate and use that
to create a Classifier from the parameter type to the return
type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassifierAdapter()
public ClassifierAdapter(Object delegate)
Classifier
from the delegate provided. Use the
constructor as an alternative to the setDelegate(Object)
method.
delegate
- public ClassifierAdapter(Classifier<C,T> delegate)
Classifier
from the delegate provided. Use the
constructor as an alternative to the setDelegate(Classifier)
method.
delegate
- Method Detail |
---|
public void setDelegate(Classifier<C,T> delegate)
public final void setDelegate(Object delegate)
Classifier
annotation on a method in the supplied delegate and use that
to create a Classifier
from the parameter type to the return
type. If the annotation is not found a unique non-void method with a
single parameter will be used, if it exists. The signature of the method
cannot be checked here, so might be a runtime exception when the method
is invoked if the signature doesn't match the classifier types.
delegate
- an object with an annotated methodpublic T classify(C classifiable)
classify
in interface Classifier<C,T>
classifiable
- the input object. Can be null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |