Class ConvertHeaderDefinition

All Implemented Interfaces:
org.apache.camel.CamelContextAware, org.apache.camel.LineNumberAware, Block, org.apache.camel.NamedNode, org.apache.camel.spi.HasCamelContext, org.apache.camel.spi.HasId, org.apache.camel.spi.IdAware

@Metadata(label="eip,transformation") public class ConvertHeaderDefinition extends NoOutputDefinition<ConvertHeaderDefinition>
Converts the message header to another type
  • Constructor Details

    • ConvertHeaderDefinition

      public ConvertHeaderDefinition()
    • ConvertHeaderDefinition

      public ConvertHeaderDefinition(String name, String type)
    • ConvertHeaderDefinition

      public ConvertHeaderDefinition(String name, Class<?> typeClass)
    • ConvertHeaderDefinition

      public ConvertHeaderDefinition(String name, String toName, Class<?> typeClass)
    • ConvertHeaderDefinition

      public ConvertHeaderDefinition(String name, Class<?> typeClass, boolean mandatory)
    • ConvertHeaderDefinition

      public ConvertHeaderDefinition(String name, Class<?> typeClass, String charset)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getShortName

      public String getShortName()
    • getLabel

      public String getLabel()
      Description copied from class: ProcessorDefinition
      Returns a label to describe this node such as the expression if some kind of expression node
      Specified by:
      getLabel in interface org.apache.camel.NamedNode
      Overrides:
      getLabel in class ProcessorDefinition<ConvertHeaderDefinition>
    • setName

      public void setName(String name)
      Name of message header to convert its value

      The simple language can be used to define a dynamic evaluated header name to be used. Otherwise a constant name will be used.

    • getName

      public String getName()
    • getToName

      public String getToName()
    • setToName

      public void setToName(String toName)
      To use another header to store the result. By default, the result is stored in the same header. This option allows to use another header.

      The simple language can be used to define a dynamic evaluated header name to be used. Otherwise a constant name will be used.

    • getType

      public String getType()
    • setType

      public void setType(String type)
      The java type to convert to
    • getTypeClass

      public Class<?> getTypeClass()
    • setTypeClass

      public void setTypeClass(Class<?> typeClass)
    • getCharset

      public String getCharset()
    • setCharset

      public void setCharset(String charset)
      To use a specific charset when converting
    • getMandatory

      public String getMandatory()
    • setMandatory

      public void setMandatory(String mandatory)
      When mandatory then the conversion must return a value (cannot be null), if this is not possible then NoTypeConversionAvailableException is thrown. Setting this to false could mean conversion is not possible and the value is null.