Class LanguageSupport

  • All Implemented Interfaces:
    org.apache.camel.CamelContextAware, org.apache.camel.IsSingleton, org.apache.camel.spi.Language

    public abstract class LanguageSupport
    extends Object
    implements org.apache.camel.spi.Language, org.apache.camel.IsSingleton, org.apache.camel.CamelContextAware
    Base language for Language implementations.
    • Constructor Detail

      • LanguageSupport

        public LanguageSupport()
    • Method Detail

      • getCamelContext

        public org.apache.camel.CamelContext getCamelContext()
        Specified by:
        getCamelContext in interface org.apache.camel.CamelContextAware
      • setCamelContext

        public void setCamelContext​(org.apache.camel.CamelContext camelContext)
        Specified by:
        setCamelContext in interface org.apache.camel.CamelContextAware
      • isSingleton

        public boolean isSingleton()
        Specified by:
        isSingleton in interface org.apache.camel.IsSingleton
      • loadResource

        protected String loadResource​(String expression)
                               throws org.apache.camel.ExpressionIllegalSyntaxException
        Loads the resource if the given expression is referring to an external resource by using the syntax resource:scheme:uri. If the expression is not referring to a resource, then its returned as is.

        For example resource:classpath:mygroovy.groovy to refer to a groovy script on the classpath.

        Parameters:
        expression - the expression
        Returns:
        the expression
        Throws:
        org.apache.camel.ExpressionIllegalSyntaxException - is thrown if error loading the resource
      • hasSimpleFunction

        public static boolean hasSimpleFunction​(String expression)
        Does the expression include a simple function.
        Parameters:
        expression - the expression
        Returns:
        true if one or more simple function is included in the expression