public class SimplePOJODataMapper extends Object implements SULMapper<MethodInput,AbstractMethodOutput,ConcreteMethodInput,Object>
SULMapper.MappedException<AO>
Modifier | Constructor and Description |
---|---|
protected |
SimplePOJODataMapper(Constructor<?> initMethod,
Object... initParams) |
Modifier and Type | Method and Description |
---|---|
boolean |
canFork()
Checks whether it is possible to
fork this mapper. |
SULMapper<MethodInput,AbstractMethodOutput,ConcreteMethodInput,Object> |
fork()
Forks this mapper, i.e., returns a mapper that behaves in exactly the same way as this mapper, but allows for
being used independently of this mapper.
|
ConcreteMethodInput |
mapInput(MethodInput abstractInput)
Method that maps an abstract input to a corresponding concrete input.
|
AbstractMethodOutput |
mapOutput(Object concreteOutput)
Method that maps a concrete output to a corresponding abstract output.
|
SULMapper.MappedException<? extends AbstractMethodOutput> |
mapUnwrappedException(RuntimeException exception)
Maps an unwrapped
RuntimeException to an abstract output symbol, or rethrows it if it is unmappable. |
void |
post()
Method that is invoked after all translation steps on a word are performed.
|
void |
pre()
Method that is invoked before any translation steps on a word are performed.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
mapWrappedException
protected Object delegate
protected SimplePOJODataMapper(Constructor<?> initMethod, Object... initParams)
public void pre()
Mapper
pre
in interface Mapper<MethodInput,AbstractMethodOutput,ConcreteMethodInput,Object>
public void post()
Mapper
post
in interface Mapper<MethodInput,AbstractMethodOutput,ConcreteMethodInput,Object>
public SULMapper.MappedException<? extends AbstractMethodOutput> mapUnwrappedException(RuntimeException exception) throws RuntimeException
SULMapper
RuntimeException
to an abstract output symbol, or rethrows it if it is unmappable.mapUnwrappedException
in interface SULMapper<MethodInput,AbstractMethodOutput,ConcreteMethodInput,Object>
exception
- the runtime exception that was thrownSULException
- if a new exception occurs while trying to map the given exceptionRuntimeException
- if the given exception cannot be mapped, or if a new exception occurs while trying to map the given
exceptionpublic ConcreteMethodInput mapInput(MethodInput abstractInput)
Mapper
mapInput
in interface Mapper<MethodInput,AbstractMethodOutput,ConcreteMethodInput,Object>
abstractInput
- the abstract inputpublic AbstractMethodOutput mapOutput(Object concreteOutput)
Mapper
mapOutput
in interface Mapper<MethodInput,AbstractMethodOutput,ConcreteMethodInput,Object>
concreteOutput
- the concrete outputpublic boolean canFork()
SULMapper
fork
this mapper.canFork
in interface SULMapper<MethodInput,AbstractMethodOutput,ConcreteMethodInput,Object>
true
if this mapper can be forked, false
otherwise.public SULMapper<MethodInput,AbstractMethodOutput,ConcreteMethodInput,Object> fork()
SULMapper
If SULMapper.canFork()
returned false
, this method must throw an UnsupportedOperationException
.
Otherwise, it must return a non-null
object representing the fork of this mapper.
fork
in interface SULMapper<MethodInput,AbstractMethodOutput,ConcreteMethodInput,Object>
this
should be returned)Copyright © 2018. All rights reserved.