Class ConvertVariableDefinition

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 ConvertVariableDefinition extends NoOutputDefinition<ConvertVariableDefinition>
Converts the variable to another type
  • Constructor Details

    • ConvertVariableDefinition

      public ConvertVariableDefinition()
    • ConvertVariableDefinition

      public ConvertVariableDefinition(String name, String type)
    • ConvertVariableDefinition

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

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

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

      public ConvertVariableDefinition(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<ConvertVariableDefinition>
    • setName

      public void setName(String name)
      Name of variable 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 variable to store the result. By default, the result is stored in the same variable. This option allows to use another variable.

      The simple language can be used to define a dynamic evaluated variable 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.