org.apache.camel.support
Class LanguageSupport

java.lang.Object
  extended by org.apache.camel.support.LanguageSupport
All Implemented Interfaces:
CamelContextAware, IsSingleton, Language
Direct Known Subclasses:
SimpleLanguage, XPathLanguage

public abstract class LanguageSupport
extends Object
implements Language, IsSingleton, CamelContextAware

Base language for Language implementations.


Field Summary
static String RESOURCE
           
 
Constructor Summary
LanguageSupport()
           
 
Method Summary
 CamelContext getCamelContext()
          Get the CamelContext
 boolean isSingleton()
          Whether this class supports being singleton or not.
protected  String loadResource(String expression)
          Loads the resource if the given expression is referring to an external resource by using the syntax resource:scheme:uri.
 void setCamelContext(CamelContext camelContext)
          Injects the CamelContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.camel.spi.Language
createExpression, createPredicate
 

Field Detail

RESOURCE

public static final String RESOURCE
See Also:
Constant Field Values
Constructor Detail

LanguageSupport

public LanguageSupport()
Method Detail

getCamelContext

public CamelContext getCamelContext()
Description copied from interface: CamelContextAware
Get the CamelContext

Specified by:
getCamelContext in interface CamelContextAware
Returns:
camelContext the Camel context

setCamelContext

public void setCamelContext(CamelContext camelContext)
Description copied from interface: CamelContextAware
Injects the CamelContext

Specified by:
setCamelContext in interface CamelContextAware
Parameters:
camelContext - the Camel context

isSingleton

public boolean isSingleton()
Description copied from interface: IsSingleton
Whether this class supports being singleton or not.

Specified by:
isSingleton in interface IsSingleton
Returns:
true to be a single shared instance, false to create new instances.

loadResource

protected String loadResource(String expression)
                       throws 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:
ExpressionIllegalSyntaxException - is thrown if error loading the resource


Apache Camel