anchor.diff:  }
   ----
   
  -== Custom types
  -
  -=== By annotation
  -
  -By default, JCommander parses the command line into basic types only (strings, booleans, integers and longs). Very often, your application actually needs more complex types, such as files, host names, lists, etc... To achieve this, you can write a type converter by implementing the following interface:
  +== Custom types (converters and splitters)
  +
  +To bind parameters to custom types or change the way how JCommander splits parameters (default is to split via comma) JCommander provides two
  +interfaces `IStringConverter` and `IParameterSplitter`.
  +
  +[[single-value]]
  +=== Single value
  +
  +Use either the `converter=` attribute of the `@Parameter` or implement `IStringConverterFactory`.
  +
  +==== By annotation
  +
  +By default, JCommander parses the command line into basic types only (strings, booleans, integers and longs). Very often, your application actually needs more complex types (such as files, host names, lists, etc.). To achieve this, you can write a type converter by implementing the following interface:
   
   [source,java]
   ----
  
positive.code: File file;
  ----
  
  JCommander ships with a few common converters (e.g. one that turns a comma separated list into a List<String>).
  
  === By factory
  
  If the custom types you use appear multiple times in your application, having to specify the converter in each annotation can become tedious. To address this, you can use an `IStringConverterFactory`:
  
  
negative.code: ----
  
  Another advantage of using string converter factories is that your factories can come from a dependency injection framework.
  
  [[list-value]]
  === List value
  
  Use the `listConverter=` attribute of the `@Parameter` annotation and assign a custom `IStringConverter` implementation to convert a `String` into a `List` of values
  
  ==== By annotation
  
  If your application needs a list of complex types write a list type converter by implementing the same interface as before:
  
  [source,java]
  ----
  public interface IStringConverter<T> {
    T convert(String value);
  }
  ----
  where `T` is a `List`.
  
  
  For example, here is a list converter that turns a string into a `List<File>`:
  
  [source,java]
  ----
  public class FileListConverter implements IStringConverter<List<File>> {
    @Override
    public File convert(String files) {
      String [] paths = files.split(",");
      List<File> files = new ArrayList<>();
      for(String path : paths){
          files.add(new File(path));
      }
      return files;
    }
  }
  ----
  
  Then, all you need to do is declare your field with the correct type and specify the list converter as an attribute:
  
  [source,java]
  ----
  @Parameter(names = "-files", listConverter = FileListConverter.class)
  List<File> file;
  ----
  
  JCommander ships with a default converter for `String` values.
  
  
  === Splitting
  
  Use the `splitter=` attribute of the `@Parameter` annotation and assign a custom `IParameterSplitter` implementation to handle how parameters are split in sub-parts
  
  ==== By annotation
  
  As already mentioned in <<single-value>>, by default, JCommander tries to split parameters for List field types on comma.
  
  To split parameters on other characters, you can write a custom splitter by implementing the following interface:
  
  [source,java]
  ----
  public interface IParameterSplitter {
    List<String> split(String value);
  }
  ----
  
  For example, here is a splitter that splits a string on semicolon:
  
  [source,java]
  ----
  public static class SemiColonSplitter implements IParameterSplitter {
      public List<String> split(String value) {
        return Arrays.asList(value.split(";"));
      }
  }
  ----
  
  Then, all you need to do is declare your field with the correct type and specify the splitter as an attribute:
  
  [source,java]
  ----
  @Parameter(names = "-files", converter = FileConverter.class, splitter = SemiColonSplitter.class)
  List<File> files;
  ----
  
  JCommander will split the string `file1;file2;file3` into `file1`, `file2`, `file3` and feed it one by one to the converter.
  
  
  == Parameter validation
  
  