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: ----
  
  Another advantage of using string converter factories is that your factories can come from a dependency injection framework.
  
  == Parameter validation
  
  
negative.code: File file;
  ----
  
  JCommander ships with a few common converters (for more info please see the implementations of `IStringConverter`).
  
  ===== Note
  
  If a converter is used for a List field, JCommander tries to use this converter on the value provided.
  
  For example, suppose you provide a string representing a list of files:
  
  [source,bash]
  ----
  $ java App -files file1,file2,file3
  ----
  
  And you declared your field as List and specified the converter as an attribute:
  
  [source,java]
  ----
  @Parameter(names = "-files", converter = FileConverter.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.
  
  For an alternative solution to parse a list of values see <<list-value>>.
  
  ==== 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`:
  
  