jTransfo, 0.14

org.jtransfo.internal
Class TaggedConverter

java.lang.Object
  extended by org.jtransfo.internal.TaggedConverter
All Implemented Interfaces:
Converter

public class TaggedConverter
extends Object
implements Converter

Converter which delegated to the specified converters for the tags. It will always also handle "*" as first tag.


Constructor Summary
TaggedConverter()
           
 
Method Summary
 void addConverters(String[] tags, Converter converter)
          Add the converter which should be used for a specific tag.
 void convert(Object source, Object target, String... tags)
          Conversion from (part of) the source object to the target object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaggedConverter

public TaggedConverter()
Method Detail

addConverters

public void addConverters(String[] tags,
                          Converter converter)
Add the converter which should be used for a specific tag.

Parameters:
tags - tags for which the converter applies
converter - converter for the tag

convert

public void convert(Object source,
                    Object target,
                    String... tags)
             throws JTransfoException
Description copied from interface: Converter
Conversion from (part of) the source object to the target object.

Specified by:
convert in interface Converter
Parameters:
source - source to read from
target - target to write into
tags - tags which indicate which fields can be converted based on MapOnly annotations
Throws:
JTransfoException - problem during conversion

jTransfo, 0.14

Copyright © 2014. All rights reserved.