anchor.diff:  }
   ----
   
  -[[TypeConverter-WritingyourownTypeConverters]]
   == Writing your own Type Converters
   
   You are welcome to write your own converters. Remember to use the
   `@Converter` annotations on the classes and methods you wish to use.
  -And on the top-level class add `Converter(loader = true)` to support the _fast way_
  +And on the top-level class add `Converter(generateLoader = true)` to support the _fast way_
   of using type converters.
   
   * static methods are encouraged to reduce caching, but instance methods
  
positive.code: * `byte[]` and `ByteBuffer`
  * `InputStream` and `OutputStream`
  * `Reader` and `Writer`
  * `Document` and `Source`
  
  To convert the body of a message to another type:
  
  [source,java]
  ----
  Message message = exchange.getIn();
  Document document = message.getBody(Document.class); // <1>
  ----
  <1> where https://www.javadoc.io/doc/org.apache.camel/camel-api/current/org/apache/camel/Message.html#getBody-java.lang.Class-[`Message#getBody(Class)`] performs the conversion.
  
  [[TypeConverter-HowTypeConversionworks]]
  == How Type Conversion works
  
  The type conversion strategy is defined by the
  https://www.javadoc.io/doc/org.apache.camel/camel-api/current/org/apache/camel/TypeConverter.html[TypeConverter]
  interface that can be customized on a
  https://www.javadoc.io/doc/org.apache.camel/camel-api/current/org/apache/camel/CamelContext.html[CamelContext].
  
  Camel provides a default type converter registry.
  From Camel 3 onwards, the type converter registry implementation generates source code using the Camel Maven
  Package Plugin, allowing Camel, at runtime, to load and invoke these type converters via
  quick Java method invocations. In Camel 2, type converters are registered using annotation based discovery, invoking the type converters via the https://docs.oracle.com/javase/tutorial/reflect/[Java Reflection API].
  
  
  [[TypeConverter-TypeConverterRegistry]]
  == TypeConverterRegistry
  
  Add a `TypeConverter` to the
  https://www.javadoc.io/doc/org.apache.camel/camel-api/current/org/apache/camel/spi/TypeConverterRegistry.html[`TypeConverterRegistry`]
  at runtime using the xref:camelcontext.adoc[CamelContext]:
  
  [source,java]
  ----
  CamelContext context = ...;
  context.getTypeConverterRegistry();
  ----
  
  NOTE: This is useful on platforms where the automatic type converters discovery fails due to classloading issues.
  
  [[TypeConverter-TypeConverterRegistryutilizationstatistics]]
  === TypeConverterRegistry utilization statistics
  
  Camel can gather utilization statistics of the runtime usage of type
  converters. These statistics are available in JMX as well as
  from https://www.javadoc.io/doc/org.apache.camel/camel-api/latest/org/apache/camel/spi/TypeConverterRegistry.html#getStatistics--[`TypeConverterRegistry#getStatistics()`].
  
  These statistics are turned off by
  default as there is some performance overhead under very high concurrent
  load.
  
  Enabling statistics in Java:
  
  
negative.code: 
  - fallback converters is not supported
  - the order of the `@Converter` methods matters. If you have multiple `@Converter` methods that accept as _from_ type
  types which are from the same class hierachy then put the methods first that are the most concrete.
  
  For example in `camel-xml-jaxp` we have in the `XmlConverter` multiple `@Converter` methods which can convert to `DomSource`.
  We had to put the method that takes `org.w3c.dom.Document` before the method that takes `org.w3c.dom.Node` as `Document` extends `Node`.
  