|
jTransfo, 0.14 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jtransfo.JTransfoImpl
public class JTransfoImpl
jTransfo main access point standard implementation.
| Field Summary |
|---|
| Fields inherited from interface org.jtransfo.JTransfo |
|---|
DEFAULT_TAG_WHEN_NO_TAGS |
| Constructor Summary | |
|---|---|
JTransfoImpl()
Constructor. |
|
| Method Summary | ||
|---|---|---|
void |
clearCaches()
Clear cache with converters. |
|
Object |
convert(Object source)
Create a new domain object from the source transfer object. |
|
|
convert(Object source,
T target,
boolean targetIsTo,
String... tags)
Fill the target object with the values from the source object. |
|
|
convert(Object source,
T target,
String... tags)
Fill the target object with the values from the source object. |
|
|
convertList(List<?> source,
Class<T> targetClass,
String... tags)
Convert a list of object to the given type. |
|
|
convertTo(Object source,
Class<T> targetClass,
String... tags)
Create a new domain object from the source transfer object. |
|
|
findTarget(Object source,
Class<T> targetClass)
Get the base target (domain) object for the source (transfer) object. |
|
List<ConvertInterceptor> |
getConvertInterceptors()
Get the list of ConvertInterceptors to allow customization. |
|
Class<?> |
getDomainClass(Class<?> toClass)
Get domain class for transfer object. |
|
List<ObjectFinder> |
getObjectFinders()
Get the list of ObjectFinders to allow customization. |
|
Class<?> |
getToSubType(Class<?> toType,
Object domainObject)
Get the correct transfer object type for the given domain object. |
|
List<TypeConverter> |
getTypeConverters()
Get the set of type converters which are used by this jTransfo instance. |
|
boolean |
isToClass(Class<?> toClass)
Is the given class a transfer object class? True when there is a DomainClass annotation on the class. |
|
void |
updateConvertInterceptors()
Update the list of convert interceptors which is used based on the internal list (see getConvertInterceptors(). |
|
void |
updateConvertInterceptors(List<ConvertInterceptor> newConvertInterceptors)
Update the list of convert interceptors which is used. |
|
void |
updateObjectFinders()
Update the list of object finders which is used based on the internal list (see getObjectFinders(). |
|
void |
updateObjectFinders(List<ObjectFinder> newObjectFinders)
Update the list of object finders which is used. |
|
void |
updateTypeConverters()
Update the list of type converters which is used based on the internal list (see getTypeConverters(). |
|
void |
updateTypeConverters(List<TypeConverter> newConverters)
Update the list of type converters which is used. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JTransfoImpl()
| Method Detail |
|---|
public List<TypeConverter> getTypeConverters()
updateTypeConverters().
public void updateTypeConverters()
getTypeConverters().
public void updateTypeConverters(List<TypeConverter> newConverters)
getTypeConverters().
Alternatively, you can pass the new list explicitly.
newConverters - new list of type converterspublic List<ObjectFinder> getObjectFinders()
ObjectFinders to allow customization.
The elements are tried in reverse order (from end to start of list).
You are explicitly allowed to change this list, but beware to do this from one thread only.
Changes in the list are not used until you call updateObjectFinders().
public void updateObjectFinders()
getObjectFinders().
public void updateObjectFinders(List<ObjectFinder> newObjectFinders)
getObjectFinders().
Alternatively, you can pass the new list explicitly.
newObjectFinders - new list of type converterspublic List<ConvertInterceptor> getConvertInterceptors()
ConvertInterceptors to allow customization.
The elements are tried in reverse order (from end to start of list).
You are explicitly allowed to change this list, but beware to do this from one thread only.
Changes in the list are not used until you call updateObjectFinders().
public void updateConvertInterceptors()
getConvertInterceptors().
public void updateConvertInterceptors(List<ConvertInterceptor> newConvertInterceptors)
getConvertInterceptors().
Alternatively, you can pass the new list explicitly.
newConvertInterceptors - new list of convert interceptors
public <T> T convert(Object source,
T target,
String... tags)
JTransfo
convert in interface JTransfoT - type of object for targetsource - source object. Should not be null.target - target object. Should not be null.tags - tags which indicate which fields can be converted based on MapOnly annotations.
Tags are processed from left to right.
public <T> T convert(Object source,
T target,
boolean targetIsTo,
String... tags)
ConvertSourceTarget
convert in interface ConvertSourceTargetT - type of object for targetsource - source object. Should not be null.target - target object. Should not be null.targetIsTo - is the target class the transfer object?tags - tags which indicate which fields can be converted based on MapOnly annotations.
Tags are processed from left to right.
public Object convert(Object source)
JTransfo
convert in interface JTransfosource - source transfer object
public <T> T convertTo(Object source,
Class<T> targetClass,
String... tags)
JTransfo
convertTo in interface JTransfoT - type of object for targetsource - source transfer objecttargetClass - target class to convert totags - tags which indicate which fields can be converted based on MapOnly annotations.
Tags are processed from left to right.
public <T> List<T> convertList(List<?> source,
Class<T> targetClass,
String... tags)
JTransfoJTransfo.convertTo(Object, Class, String...) on each object.
When the source is null, the result is also null.
convertList in interface JTransfoT - type of object for targetsource - source list of objectstargetClass - target class to convert each object totags - tags which indicate which fields can be converted based on MapOnly annotations.
Tags are processed from left to right.
public <T> T findTarget(Object source,
Class<T> targetClass)
JTransfo
findTarget in interface JTransfoT - type of object for targetsource - source transfer objecttargetClass - target class to convert to
public Class<?> getDomainClass(Class<?> toClass)
JTransfo
getDomainClass in interface JTransfotoClass - transfer object class
public boolean isToClass(Class<?> toClass)
JTransfoDomainClass annotation on the class.
isToClass in interface JTransfotoClass - object class to test
public Class<?> getToSubType(Class<?> toType,
Object domainObject)
JTransfo
getToSubType in interface JTransfotoType - base transfer object typedomainObject - domain object (instance)
public void clearCaches()
|
jTransfo, 0.14 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||