Package org.apache.camel.maven
Class AbstractApiMethodGeneratorMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.camel.maven.AbstractGeneratorMojo
-
- org.apache.camel.maven.AbstractSourceGeneratorMojo
-
- org.apache.camel.maven.AbstractApiMethodBaseMojo
-
- org.apache.camel.maven.AbstractApiMethodGeneratorMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
JavaSourceApiMethodGeneratorMojo
public abstract class AbstractApiMethodGeneratorMojo extends AbstractApiMethodBaseMojo
Base Mojo class for ApiMethod generators.
-
-
Field Summary
Fields Modifier and Type Field Description protected List<ApiMethodAlias>
aliases
Method alias patterns for all APIs.protected String
apiDescription
protected String
apiName
protected String
classPrefix
protected boolean
consumerOnly
protected String[]
nullableOptions
Names of options that can be set to null value if not specified.protected boolean
producerOnly
protected String
proxyClass
-
Fields inherited from class org.apache.camel.maven.AbstractApiMethodBaseMojo
excludeConfigNames, excludeConfigTypes, extraOptions, substitutions
-
Fields inherited from class org.apache.camel.maven.AbstractSourceGeneratorMojo
addCompileSourceRoots, generatedSrcDir, generatedTestDir
-
Fields inherited from class org.apache.camel.maven.AbstractGeneratorMojo
COMPONENT_PACKAGE, componentName, componentPackage, log, OUT_PACKAGE, outPackage, PREFIX, project, scheme
-
-
Constructor Summary
Constructors Constructor Description AbstractApiMethodGeneratorMojo()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected org.apache.camel.support.component.ApiMethodParser
createAdapterParser(Class proxyType)
void
executeInternal()
Template Method which assumesAbstractGeneratorMojo.projectClassLoader
is set.String
getAliases()
String
getApiDescription(String apiDescription)
File
getApiMethodFile()
String
getApiMethods(List<org.apache.camel.support.component.ApiMethodParser.ApiMethodModel> models)
static String
getApiMethodsForParam(List<org.apache.camel.support.component.ApiMethodParser.ApiMethodModel> models, org.apache.camel.support.component.ApiMethodArg argument)
String
getApiName(String apiName)
org.apache.camel.support.component.ArgumentSubstitutionParser.Substitution[]
getArgumentSubstitutions()
static String
getBeanPropertySuffix(String parameter)
String
getCanonicalName(org.apache.camel.support.component.ApiMethodArg argument)
static String
getDefaultArgValue(Class<?> aClass)
String
getDoc(org.apache.camel.support.component.ApiMethodArg argument)
String
getExchangePropertyPrefix()
Class<?>
getProxyType()
static String
getResultDeclaration(Class<?> resultType)
abstract List<SignatureModel>
getSignatureList()
static String
getTestName(org.apache.camel.support.component.ApiMethodParser.ApiMethodModel model)
static String
getType(Class<?> clazz)
boolean
hasDoc(org.apache.camel.support.component.ApiMethodArg argument)
boolean
isOptionalParameter(org.apache.camel.support.component.ApiMethodArg argument)
static boolean
isVoidType(Class<?> resultType)
-
Methods inherited from class org.apache.camel.maven.AbstractSourceGeneratorMojo
setCompileSourceRoots
-
Methods inherited from class org.apache.camel.maven.AbstractGeneratorMojo
execute, getCanonicalName, getEngine, getProjectClassLoader, mergeTemplate, refresh, setProjectClassLoader, updateResource
-
-
-
-
Field Detail
-
proxyClass
@Parameter(required=true, property="org.apache.camel.proxyClass") protected String proxyClass
-
classPrefix
@Parameter protected String classPrefix
-
apiName
@Parameter protected String apiName
-
apiDescription
@Parameter protected String apiDescription
-
consumerOnly
@Parameter protected boolean consumerOnly
-
producerOnly
@Parameter protected boolean producerOnly
-
aliases
@Parameter protected List<ApiMethodAlias> aliases
Method alias patterns for all APIs.
-
nullableOptions
@Parameter protected String[] nullableOptions
Names of options that can be set to null value if not specified.
-
-
Method Detail
-
executeInternal
public void executeInternal() throws org.apache.maven.plugin.MojoExecutionException
Description copied from class:AbstractGeneratorMojo
Template Method which assumesAbstractGeneratorMojo.projectClassLoader
is set.- Specified by:
executeInternal
in classAbstractGeneratorMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
createAdapterParser
protected org.apache.camel.support.component.ApiMethodParser createAdapterParser(Class proxyType)
-
getSignatureList
public abstract List<SignatureModel> getSignatureList() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getProxyType
public Class<?> getProxyType() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getApiMethodFile
public File getApiMethodFile() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getArgumentSubstitutions
public org.apache.camel.support.component.ArgumentSubstitutionParser.Substitution[] getArgumentSubstitutions()
-
getAliases
public String getAliases()
-
getApiMethodsForParam
public static String getApiMethodsForParam(List<org.apache.camel.support.component.ApiMethodParser.ApiMethodModel> models, org.apache.camel.support.component.ApiMethodArg argument)
-
getTestName
public static String getTestName(org.apache.camel.support.component.ApiMethodParser.ApiMethodModel model)
-
isVoidType
public static boolean isVoidType(Class<?> resultType)
-
getExchangePropertyPrefix
public String getExchangePropertyPrefix()
-
hasDoc
public boolean hasDoc(org.apache.camel.support.component.ApiMethodArg argument)
-
getDoc
public String getDoc(org.apache.camel.support.component.ApiMethodArg argument)
-
isOptionalParameter
public boolean isOptionalParameter(org.apache.camel.support.component.ApiMethodArg argument)
-
getApiMethods
public String getApiMethods(List<org.apache.camel.support.component.ApiMethodParser.ApiMethodModel> models)
-
getCanonicalName
public String getCanonicalName(org.apache.camel.support.component.ApiMethodArg argument) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
-