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, 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()
    • 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.