com.humegatech.mule.modules.car2go.generated.config.GetLocationsDefinitionParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of car2go-connector Show documentation
Show all versions of car2go-connector Show documentation
Mule Anypoint Connector for the Car2Go API v2.1
The newest version!
package com.humegatech.mule.modules.car2go.generated.config;
import com.humegatech.mule.modules.car2go.generated.processors.GetLocationsMessageProcessor;
import javax.annotation.Generated;
import org.mule.config.MuleManifest;
import org.mule.security.oauth.config.AbstractDevkitBasedDefinitionParser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
import org.springframework.beans.factory.parsing.Location;
import org.springframework.beans.factory.parsing.Problem;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.ParserContext;
import org.w3c.dom.Element;
@SuppressWarnings("all")
@Generated(value = "Mule DevKit Version 3.8.0", date = "2017-04-01T05:55:33-05:00", comments = "Build UNNAMED.2762.e3b1307")
public class GetLocationsDefinitionParser
extends AbstractDevkitBasedDefinitionParser
{
private static Logger logger = LoggerFactory.getLogger(GetLocationsDefinitionParser.class);
private BeanDefinitionBuilder getBeanDefinitionBuilder(ParserContext parserContext) {
try {
return BeanDefinitionBuilder.rootBeanDefinition(GetLocationsMessageProcessor.class.getName());
} catch (NoClassDefFoundError noClassDefFoundError) {
String muleVersion = "";
try {
muleVersion = MuleManifest.getProductVersion();
} catch (Exception _x) {
logger.error("Problem while reading mule version");
}
logger.error(("Cannot launch the mule app, the @Processor [get-locations] within the connector [car2go] is not supported in mule "+ muleVersion));
throw new BeanDefinitionParsingException(new Problem(("Cannot launch the mule app, the @Processor [get-locations] within the connector [car2go] is not supported in mule "+ muleVersion), new Location(parserContext.getReaderContext().getResource()), null, noClassDefFoundError));
}
}
public BeanDefinition parse(Element element, ParserContext parserContext) {
BeanDefinitionBuilder builder = getBeanDefinitionBuilder(parserContext);
builder.addConstructorArgValue("getLocations");
builder.setScope(BeanDefinition.SCOPE_PROTOTYPE);
if (!hasAttribute(element, "config-ref")) {
throw new BeanDefinitionParsingException(new Problem("It seems that the config-ref for @Processor [get-locations] within the connector [car2go] is null or missing. Please, fill the value with the correct global element.", new Location(parserContext.getReaderContext().getResource()), null));
}
parseConfigRef(element, builder);
BeanDefinition definition = builder.getBeanDefinition();
setNoRecurseOnDefinition(definition);
attachProcessorDefinition(parserContext, definition);
return definition;
}
}