Class StandaloneCommandProcessor
java.lang.Object
javax.annotation.processing.AbstractProcessor
io.github.projectunified.craftcommand.processor.BaseCommandProcessor
io.github.projectunified.craftcommand.processor.standalone.StandaloneCommandProcessor
- All Implemented Interfaces:
Processor
@AutoService(javax.annotation.processing.Processor.class)
@SupportedAnnotationTypes("io.github.projectunified.craftcommand.annotation.Command")
@SupportedSourceVersion(RELEASE_8)
public class StandaloneCommandProcessor
extends BaseCommandProcessor
Annotation processor for standalone command platforms.
Generates custom wrapper command executors implementing
io.github.projectunified.craftcommand.standalone.StandaloneCommand.-
Field Summary
Fields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbuildEntryMethods(com.palantir.javapoet.TypeSpec.Builder typeSpec, CommandModel model, TypeElement typeElement) Generates all standalone-specific entry methods for the wrapper class.protected voidconfigureSuperType(com.palantir.javapoet.TypeSpec.Builder typeSpec) Configures the super interfaces/classes that the generated wrapper should implement/extend.protected com.palantir.javapoet.TypeNameReturns the platform-specific command manager type.protected com.palantir.javapoet.ClassNameReturns the platform-specific command sender type name (e.g.protected StringReturns the wrapper class suffix specific to the platform.Methods inherited from class io.github.projectunified.craftcommand.processor.BaseCommandProcessor
buildAdditionalHelpers, buildAliasesExpression, buildBuiltInParameter, buildExecutionRouting, buildLocalResolverParameter, buildMethodExecution, buildMethodExecution, buildParameterSuggestionHelper, buildParameterSuggestions, buildSenderResolution, buildSubcommandSuggestionRouting, buildSuggestionRouting, buildWrapperClass, configureConstructor, findLocalResolver, findModelForClass, findSuggestMethod, firstParamIsSender, generateDefaultSenderCastForSuggestion, generateExecuteMethodBody, generateFieldsAndConstructorStatements, generateLocalResolverInvocation, generatePlatformParamSuggestions, generateSubcommandClassExecutors, generateUnknownSubcommandMessage, getAssignmentValueForType, getDefaultPrimitiveValue, getDynamicResolverTypes, getInstanceVarExpression, getLocalResolverMaxWidth, getLocalResolverMinWidth, getParameterSuggestionMethodName, getPlatformBuiltInWidth, getResolverMethodName, getSenderExpression, getSimpleName, getSubcommandFieldName, getSubcommandNames, getUsage, init, isBuiltInType, isField, isPlatformBuiltInType, isSenderBaseType, isSenderType, onBeforeExecute, onBeforeSuggest, onSuggestionAdd, process, resolvePlatformMultiParameter, resolvePlatformParameterMethods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, isInitialized
-
Constructor Details
-
StandaloneCommandProcessor
public StandaloneCommandProcessor()
-
-
Method Details
-
getWrapperClassSuffix
Description copied from class:BaseCommandProcessorReturns the wrapper class suffix specific to the platform.- Specified by:
getWrapperClassSuffixin classBaseCommandProcessor- Returns:
- the class name suffix (e.g. "_Executor" or "_Standalone")
-
configureSuperType
protected void configureSuperType(com.palantir.javapoet.TypeSpec.Builder typeSpec) Description copied from class:BaseCommandProcessorConfigures the super interfaces/classes that the generated wrapper should implement/extend.- Specified by:
configureSuperTypein classBaseCommandProcessor- Parameters:
typeSpec- the class definition builder
-
getSenderTypeName
protected com.palantir.javapoet.ClassName getSenderTypeName()Description copied from class:BaseCommandProcessorReturns the platform-specific command sender type name (e.g. Bukkit CommandSender or Object).- Specified by:
getSenderTypeNamein classBaseCommandProcessor
-
getManagerType
protected com.palantir.javapoet.TypeName getManagerType()Description copied from class:BaseCommandProcessorReturns the platform-specific command manager type.- Specified by:
getManagerTypein classBaseCommandProcessor
-
buildEntryMethods
protected void buildEntryMethods(com.palantir.javapoet.TypeSpec.Builder typeSpec, CommandModel model, TypeElement typeElement) Generates all standalone-specific entry methods for the wrapper class. This includes getName(), getAliases(), getDescription(), execute(), and tabComplete().- Specified by:
buildEntryMethodsin classBaseCommandProcessor
-