Class ConvertBodyDefinition

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

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

    • ConvertBodyDefinition

      public ConvertBodyDefinition()
    • ConvertBodyDefinition

      public ConvertBodyDefinition(String type)
    • ConvertBodyDefinition

      public ConvertBodyDefinition(Class<?> typeClass)
    • ConvertBodyDefinition

      public ConvertBodyDefinition(Class<?> typeClass, boolean mandatory)
    • ConvertBodyDefinition

      public ConvertBodyDefinition(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<ConvertBodyDefinition>
    • 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.