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 Detail

      • 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 Detail

      • getShortName

        public String getShortName()
      • 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.