org.apache.camel.impl
Class UriComponentConfiguration

java.lang.Object
  extended by org.apache.camel.impl.ComponentConfigurationSupport
      extended by org.apache.camel.impl.UriComponentConfiguration
All Implemented Interfaces:
ComponentConfiguration

public class UriComponentConfiguration
extends ComponentConfigurationSupport

Implements EndpointConfiguration for Endpoint implementations which are annotated with UriEndpoint to use the UriParam and UriParams annotations to denote its parameters which can be specified via URI query parameters.


Field Summary
 
Fields inherited from class org.apache.camel.impl.ComponentConfigurationSupport
component
 
Constructor Summary
UriComponentConfiguration(Component component, Class<? extends Endpoint> endpointClass)
           
UriComponentConfiguration(Component component, Class<? extends Endpoint> endpointClass, SortedMap<String,ParameterConfiguration> parameterConfigurationMap)
           
UriComponentConfiguration(UriEndpointComponent component)
           
 
Method Summary
 CamelContext getCamelContext()
           
 Class<? extends Endpoint> getEndpointClass()
           
 Object getEndpointParameter(Endpoint endpoint, String name)
          Gets the named URI parameter value on the given endpoint
 SortedMap<String,ParameterConfiguration> getParameterConfigurationMap()
          Returns the sorted map of all the parameter names to their ParameterConfiguration objects
 boolean isStrictOnParameterNames()
           
 void setEndpointParameter(Endpoint endpoint, String name, Object value)
          Sets the named URI query parameter value on the given endpoint
 void setStrictOnParameterNames(boolean strictOnParameterNames)
          Strict mode is enabled by default but if disabled then invalid parameter names will not result in exceptions but we will just log warnings about their use
protected  void unknownPropertyName(String name)
           
protected  void validatePropertyName(String name)
          Allow implementations to validate whether a property name is valid and either throw an exception or log a warning of an unknown property being used
protected  Object validatePropertyValue(String name, Object value)
          Allow implementations to validate whether a property name is valid and either throw an exception or log a warning of an unknown property being used and to convert the given value to the correct type before updating the value.
 
Methods inherited from class org.apache.camel.impl.ComponentConfigurationSupport
completeEndpointPath, configureEndpoint, createEndpoint, createParameterJsonSchema, getBaseUri, getParameter, getParameterConfiguration, getParameters, getUriString, setBaseUri, setParameter, setParameters, setUriString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UriComponentConfiguration

public UriComponentConfiguration(Component component,
                                 Class<? extends Endpoint> endpointClass,
                                 SortedMap<String,ParameterConfiguration> parameterConfigurationMap)

UriComponentConfiguration

public UriComponentConfiguration(Component component,
                                 Class<? extends Endpoint> endpointClass)

UriComponentConfiguration

public UriComponentConfiguration(UriEndpointComponent component)
Method Detail

getEndpointParameter

public Object getEndpointParameter(Endpoint endpoint,
                                   String name)
                            throws RuntimeCamelException
Description copied from interface: ComponentConfiguration
Gets the named URI parameter value on the given endpoint

Parameters:
endpoint - the endpoint instance
name - the name of the URI query parameter
Returns:
the value of the parameter
Throws:
RuntimeCamelException - if the parameter name does not exist on the endpoint

setEndpointParameter

public void setEndpointParameter(Endpoint endpoint,
                                 String name,
                                 Object value)
                          throws RuntimeCamelException
Description copied from interface: ComponentConfiguration
Sets the named URI query parameter value on the given endpoint

Parameters:
endpoint - the endpoint instance
name - the name of the URI query parameter
value - the new value of the URI query parameter
Throws:
RuntimeCamelException

getCamelContext

public CamelContext getCamelContext()

getEndpointClass

public Class<? extends Endpoint> getEndpointClass()

isStrictOnParameterNames

public boolean isStrictOnParameterNames()

setStrictOnParameterNames

public void setStrictOnParameterNames(boolean strictOnParameterNames)
Strict mode is enabled by default but if disabled then invalid parameter names will not result in exceptions but we will just log warnings about their use

Parameters:
strictOnParameterNames - whether to throw exceptions if invalid parameter names are used or not

getParameterConfigurationMap

public SortedMap<String,ParameterConfiguration> getParameterConfigurationMap()
Description copied from interface: ComponentConfiguration
Returns the sorted map of all the parameter names to their ParameterConfiguration objects


validatePropertyName

protected void validatePropertyName(String name)
Description copied from class: ComponentConfigurationSupport
Allow implementations to validate whether a property name is valid and either throw an exception or log a warning of an unknown property being used

Overrides:
validatePropertyName in class ComponentConfigurationSupport

validatePropertyValue

protected Object validatePropertyValue(String name,
                                       Object value)
Description copied from class: ComponentConfigurationSupport
Allow implementations to validate whether a property name is valid and either throw an exception or log a warning of an unknown property being used and to convert the given value to the correct type before updating the value.

Overrides:
validatePropertyValue in class ComponentConfigurationSupport

unknownPropertyName

protected void unknownPropertyName(String name)


Apache Camel