├── .github
├── dependabot.yml
└── workflows
│ ├── codeql-analysis.yml
│ ├── default.yml
│ ├── default_oracle.yml
│ ├── default_temurin.yml
│ ├── dropStaging.yml
│ ├── jacoco.yml
│ └── release.yml
├── .gitignore
├── .mvn
└── wrapper
│ ├── MavenWrapperDownloader.java
│ ├── maven-wrapper.jar
│ └── maven-wrapper.properties
├── LICENSE
├── README.md
├── annotationwrapper
├── README.md
├── api
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── java
│ │ └── io
│ │ └── toolisticon
│ │ └── aptk
│ │ └── annotationwrapper
│ │ └── api
│ │ ├── AnnotationWrapper.java
│ │ ├── CustomCodeMethod.java
│ │ └── CustomInterface.java
├── integrationtest
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── java
│ │ │ └── io
│ │ │ └── toolisticon
│ │ │ └── aptk
│ │ │ └── annotationwrapper
│ │ │ └── test
│ │ │ ├── EmbeddedAnnotation.java
│ │ │ ├── ExampleTestAnnotation.java
│ │ │ ├── TestDefaultsAnnotation.java
│ │ │ ├── TestEnum.java
│ │ │ ├── annotationonpackage
│ │ │ ├── AutoDetectedCustomCodeClass.java
│ │ │ ├── CustomCodeClass.java
│ │ │ └── package-info.java
│ │ │ └── annotationontype
│ │ │ ├── AutoDetectedCustomCodeClass.java
│ │ │ ├── CustomCodeClass.java
│ │ │ └── PackagePlaceholder.java
│ │ └── test
│ │ └── java
│ │ └── io
│ │ └── toolisticon
│ │ └── aptk
│ │ └── annotationwrapper
│ │ └── test
│ │ ├── annotationonpackage
│ │ └── IntegrationTest.java
│ │ └── annotationontype
│ │ └── IntegrationTest.java
├── pom.xml
└── processor
│ ├── pom.xml
│ └── src
│ ├── main
│ ├── java
│ │ └── io
│ │ │ └── toolisticon
│ │ │ └── aptk
│ │ │ └── annotationwrapper
│ │ │ └── processor
│ │ │ ├── AnnotationWrapperProcessor.java
│ │ │ └── AnnotationWrapperProcessorMessages.java
│ └── resources
│ │ └── AnnotationWrapper.tpl
│ └── test
│ ├── java
│ └── io
│ │ └── toolisticon
│ │ └── aptk
│ │ └── annotationwrapper
│ │ └── processor
│ │ ├── AnnotationWrapperProcessorTest.java
│ │ └── WrapperAnnotationProcessorMessagesTest.java
│ └── resources
│ └── testcase
│ ├── common
│ ├── EmbeddedAnnotation.java
│ ├── TestAnnotation.java
│ └── TestEnum.java
│ ├── withCustomCode
│ ├── CustomCodeClass.java
│ └── package-info.java
│ ├── withCustomCodeButNonStaticMethod
│ ├── CustomCodeClass.java
│ └── package-info.java
│ ├── withCustomCodeButNotVisibleMethod
│ ├── CustomCodeClass.java
│ └── package-info.java
│ ├── withCustomCodeButWrongFirstParameter
│ ├── CustomCodeClass.java
│ └── package-info.java
│ ├── withCustomCodeReferencingGeneratedType
│ ├── CustomCodeClass.java
│ ├── TestAnnotation2.java
│ ├── otherTest
│ │ ├── TestAnnotation3.java
│ │ └── package-info.java
│ └── package-info.java
│ ├── withCustomInterface
│ └── package-info.java
│ ├── withWrappingOfEmbedded
│ └── package-info.java
│ └── withoutWrappingOfEmbedded
│ └── package-info.java
├── aptk-api
├── pom.xml
└── src
│ └── main
│ └── java
│ └── io
│ └── toolisticon
│ └── aptk
│ └── api
│ └── AnnotationToClassMapper.java
├── common
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── io
│ │ └── toolisticon
│ │ └── aptk
│ │ └── common
│ │ └── ToolingProvider.java
│ └── test
│ └── java
│ └── io
│ └── toolisticon
│ └── aptk
│ └── ToolingProviderTest.java
├── compilermessages
├── api
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── java
│ │ └── io
│ │ └── toolisticon
│ │ └── aptk
│ │ └── compilermessage
│ │ └── api
│ │ ├── DeclareCompilerMessage.java
│ │ ├── DeclareCompilerMessageCodePrefix.java
│ │ └── DeclareCompilerMessages.java
├── integrationtest
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── java
│ │ │ └── io
│ │ │ └── toolisticon
│ │ │ └── aptk
│ │ │ └── compilermessage
│ │ │ └── test
│ │ │ ├── ByAnnotationAttribute.java
│ │ │ └── OnClassAndNestedClass.java
│ │ └── test
│ │ └── java
│ │ └── io
│ │ └── toolisticon
│ │ └── aptk
│ │ └── annotationwrapper
│ │ └── annotationonpackage
│ │ └── IntegrationTest.java
├── pom.xml
└── processor
│ ├── pom.xml
│ └── src
│ ├── main
│ ├── java
│ │ └── io
│ │ │ └── toolisticon
│ │ │ └── aptk
│ │ │ └── compilermessage
│ │ │ └── processor
│ │ │ ├── CompilerMessageProcessor.java
│ │ │ ├── CompilerMessageProcessorMessages.java
│ │ │ ├── CompilerMessageWrapperCustomCode.java
│ │ │ └── package-info.java
│ └── resources
│ │ └── CompilerMessageEnum.tpl
│ └── test
│ ├── java
│ └── io
│ │ └── toolisticon
│ │ └── aptk
│ │ └── compilermessage
│ │ └── processor
│ │ └── CompilerMessageProcessorTest.java
│ └── resources
│ └── testcase
│ ├── error_nonUniqueCode
│ └── TestClass.java
│ ├── error_nonUniqueEnumValueName
│ └── TestClass.java
│ └── happyPath_OnClass
│ ├── RemoteTestClass.java
│ └── TestClass.java
├── config
├── findbugs-excludes.xml
└── sun_checks.xml
├── cute
├── pom.xml
└── src
│ └── main
│ └── java
│ └── io
│ └── toolisticon
│ └── aptk
│ └── cute
│ ├── APTKUnitTestProcessor.java
│ ├── APTKUnitTestProcessorForTestingAnnotationProcessors.java
│ ├── APTKUnitTestProcessorForTestingAnnotationProcessorsWithouPassIn.java
│ └── APTKUnitTestProcessorWithoutPassIn.java
├── example
├── README.md
├── example-annotationprocessor
│ ├── README.md
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── java
│ │ │ └── io
│ │ │ └── toolisticon
│ │ │ └── aptk
│ │ │ └── example
│ │ │ └── annotationprocessor
│ │ │ ├── ImplementsSpecificInterfaceCheckAnnotationProcessor.java
│ │ │ └── MethodHasStringParameterAndVoidReturnTypeCheckAnnotationProcessor.java
│ │ └── test
│ │ ├── java
│ │ └── io
│ │ │ └── toolisticon
│ │ │ └── aptk
│ │ │ └── example
│ │ │ └── annotationprocessor
│ │ │ ├── ImplementsSpecificInterfaceCheckAnnotationProcessorTest.java
│ │ │ ├── ImplementsSpecificInterfaceCheckAnnotationProcessorUnitTest.java
│ │ │ └── MethodWithOneStringParameterAndVoidReturnTypeProcessorTest.java
│ │ └── resources
│ │ └── testcases
│ │ ├── implementsSpecificInterfaceCheckAnnotationProcessor
│ │ ├── InvalidUsageTest.java
│ │ ├── ValidUsageTest.java
│ │ └── ValidUsageTestExtendsCase.java
│ │ └── methodWithOneStringParameterAndVoidReturn
│ │ ├── InvalidUsageNonStringParameter.java
│ │ ├── InvalidUsageNonVoidReturnType.java
│ │ └── ValidUsageTest.java
├── example-annotations
│ ├── README.md
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── java
│ │ └── io
│ │ └── toolisticon
│ │ └── aptk
│ │ └── example
│ │ └── annotations
│ │ ├── ImplementsSpecificInterfaceCheckAnnotation.java
│ │ ├── MethodWithOneStringParameterAndVoidReturnTypeAnnotation.java
│ │ └── SpecificInterface.java
├── example-usecase
│ ├── .gitignore
│ ├── README.md
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ └── java
│ │ └── io
│ │ └── toolisticon
│ │ └── aptk
│ │ └── example
│ │ └── usecase
│ │ └── TestClass.java
└── pom.xml
├── idea_aptk_codestyle.xml
├── integrationtest
├── java16
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── java
│ │ │ └── io
│ │ │ └── toolisticon
│ │ │ └── aptk
│ │ │ └── integrationtest
│ │ │ └── java16
│ │ │ ├── DummyClass.java
│ │ │ └── package-info.java
│ │ └── test
│ │ └── java
│ │ └── io
│ │ └── toolisticon
│ │ └── aptk
│ │ └── integrationtest
│ │ └── java16
│ │ └── Java16Tests.java
├── java17
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── java
│ │ │ └── io
│ │ │ └── toolisticon
│ │ │ └── aptk
│ │ │ └── integrationtest
│ │ │ └── java17
│ │ │ ├── DummyClass.java
│ │ │ └── package-info.java
│ │ └── test
│ │ └── java
│ │ └── io
│ │ └── toolisticon
│ │ └── aptk
│ │ └── integrationtest
│ │ └── java17
│ │ └── Java17Tests.java
├── java9
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ └── java
│ │ │ └── io
│ │ │ └── toolisticon
│ │ │ └── aptk
│ │ │ └── integrationtest
│ │ │ └── java9
│ │ │ ├── DummyClass.java
│ │ │ └── package-info.java
│ │ └── test
│ │ ├── java
│ │ └── io
│ │ │ └── toolisticon
│ │ │ └── aptk
│ │ │ └── integrationtest
│ │ │ └── java9
│ │ │ └── ModuleElementWrapperTest.java
│ │ └── resources
│ │ └── testcases
│ │ └── namedModule
│ │ ├── MyProcessor.java
│ │ ├── TestClass.java
│ │ └── module-info.java
└── pom.xml
├── mvnw
├── mvnw.cmd
├── pom.xml
├── templating
├── README.md
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── io
│ │ └── toolisticon
│ │ └── aptk
│ │ └── templating
│ │ ├── ModelPathResolver.java
│ │ ├── NextDetectedBlockResult.java
│ │ ├── ParseUtilities.java
│ │ ├── TemplateProcessor.java
│ │ ├── exceptions
│ │ ├── InvalidElseIfException.java
│ │ ├── InvalidExpressionResult.java
│ │ ├── InvalidIncludeModelExpression.java
│ │ ├── InvalidPathException.java
│ │ └── MissingClosingTagException.java
│ │ ├── expressions
│ │ ├── AbstractSearchResult.java
│ │ ├── Expression.java
│ │ ├── ExpressionParser.java
│ │ ├── operands
│ │ │ ├── BooleanOperand.java
│ │ │ ├── DoubleOperand.java
│ │ │ ├── DynamicOperand.java
│ │ │ ├── ExpressionOperand.java
│ │ │ ├── InternalOperandTypeForCalculations.java
│ │ │ ├── LongOperand.java
│ │ │ ├── NullValueOperand.java
│ │ │ ├── Operand.java
│ │ │ ├── OperandFactory.java
│ │ │ ├── OperandType.java
│ │ │ ├── OperandTypeSearchResult.java
│ │ │ ├── OperationResultOperand.java
│ │ │ ├── ParsedOperand.java
│ │ │ ├── StringOperand.java
│ │ │ └── UnaryOperationWrapperOperand.java
│ │ └── operations
│ │ │ ├── OperationType.java
│ │ │ ├── OperationTypeMode.java
│ │ │ └── OperationTypeSearchResult.java
│ │ └── templateblocks
│ │ ├── ForTemplateBlock.java
│ │ ├── IfTemplateBlock.java
│ │ ├── IncludeTemplateBlock.java
│ │ ├── PlainTextTemplateBlock.java
│ │ ├── StaticTemplateBlock.java
│ │ ├── TemplateBlock.java
│ │ ├── TemplateBlockBinder.java
│ │ ├── TemplateBlockType.java
│ │ └── VariableTextTemplateBlock.java
│ └── test
│ ├── java
│ └── io
│ │ └── toolisticon
│ │ └── aptk
│ │ └── templating
│ │ ├── ModelPathResolverTest.java
│ │ ├── ParseUtilitiesTest.java
│ │ ├── TemplateProcessorTest.java
│ │ ├── expressions
│ │ ├── ExpressionParserTest.java
│ │ ├── ExpressionTest.java
│ │ ├── operands
│ │ │ ├── BooleanOperandTest.java
│ │ │ ├── DoubleOperandTest.java
│ │ │ ├── DynamicOperandTest.java
│ │ │ ├── LongOperandTest.java
│ │ │ ├── NullValueOperandTest.java
│ │ │ ├── OperandFactoryTest.java
│ │ │ ├── OperandTest.java
│ │ │ ├── OperandTypeTest.java
│ │ │ ├── StringOperandTest.java
│ │ │ └── UnaryOperationWrapperOperandTest.java
│ │ └── operations
│ │ │ ├── OperationTest.java
│ │ │ └── OperationTypeTest.java
│ │ ├── templateblocks
│ │ ├── ForTemplateBlockTest.java
│ │ ├── IfTemplateBlockTest.java
│ │ ├── IncludeTemplateBlockTest.java
│ │ ├── PlainTextTemplateBlockTest.java
│ │ ├── StaticTemplateBlockTest.java
│ │ ├── TemplateBlockBinderTest.java
│ │ ├── TemplateBlockTypeTest.java
│ │ └── VariableTextTemplateBlockTest.java
│ │ └── testclasses
│ │ ├── TestClass1.java
│ │ └── TestClass2.java
│ └── resources
│ ├── ComplexTemplateWithAllBlockTypes.expectedResult
│ ├── ComplexTemplateWithAllBlockTypes.tpl
│ ├── ComplexTemplateWithAllBlockTypesIncludedTemplate.tpl
│ ├── ComplexTemplateWithControlBlock.expectedResult
│ ├── ComplexTemplateWithControlBlock.tpl
│ ├── GetControlBlockTemplateStringTestTemplate.expectedResult
│ ├── GetControlBlockTemplateStringTestTemplate.tpl
│ ├── IfStatementBlockType.expectedResult1
│ ├── IfStatementBlockType.expectedResult2
│ ├── IfStatementBlockType.expectedResult3
│ ├── IfStatementBlockType.tpl
│ ├── IncludeTemplateBlockTest.expectedResult
│ ├── IncludeTemplateBlockTest.tpl
│ ├── IncludeTestWithModelAttribute.tpl
│ ├── IncludeTestWithModelDefinitionInContent.tpl
│ ├── MultipleVariableTextWithoutControlBlock.expectedResult
│ ├── MultipleVariableTextWithoutControlBocks.tpl
│ ├── ReadResourceToStringTest.txt
│ ├── TestTemplateProcessorTemplateFile.tpl
│ ├── TestTemplateWithDifferentIfStatements.expectedResult
│ ├── TestTemplateWithDifferentIfStatments.tpl
│ ├── TestTemplateWithDifferentVariableTextBlocks.expectedResult
│ └── TestTemplateWithDifferentVariableTextBlocks.tpl
└── tools
├── pom.xml
├── src
├── main
│ └── java
│ │ └── io
│ │ └── toolisticon
│ │ └── aptk
│ │ └── tools
│ │ ├── AbstractAnnotationProcessor.java
│ │ ├── AnnotationToClassMapperHelper.java
│ │ ├── AnnotationUtils.java
│ │ ├── AnnotationValueUtils.java
│ │ ├── BeanUtils.java
│ │ ├── ElementUtils.java
│ │ ├── FilerUtils.java
│ │ ├── InterfaceUtils.java
│ │ ├── MessagerUtils.java
│ │ ├── ProcessingEnvironmentUtils.java
│ │ ├── TypeMirrorWrapper.java
│ │ ├── TypeUtils.java
│ │ ├── Utilities.java
│ │ ├── command
│ │ ├── Command.java
│ │ ├── CommandWithReturnType.java
│ │ └── impl
│ │ │ ├── GetAttributesCommand.java
│ │ │ └── GetAttributesCommandWithInheritance.java
│ │ ├── corematcher
│ │ ├── AbstractBaseCoreMatcher.java
│ │ ├── AptkCoreMatchers.java
│ │ ├── CompilerMessage.java
│ │ ├── CoreMatcherValidationMessages.java
│ │ ├── CoreMatchers.java
│ │ ├── ExclusiveCriteriaCoreMatcher.java
│ │ ├── ExclusiveCriteriaElementBasedCoreMatcher.java
│ │ ├── ImplicitCoreMatcher.java
│ │ ├── ImplicitElementBasedCoreMatcher.java
│ │ ├── InclusiveCharacteristicElementBasedCoreMatcher.java
│ │ ├── InclusiveCriteriaCoreMatcher.java
│ │ ├── IsCoreMatcher.java
│ │ ├── IsElementBasedCoreMatcher.java
│ │ ├── PlainValidationMessage.java
│ │ ├── ValidationMessage.java
│ │ └── package-info.java
│ │ ├── filter
│ │ ├── ExclusiveCriteriaElementFilter.java
│ │ ├── ImplicitFilter.java
│ │ ├── InclusiveCriteriaElementFilter.java
│ │ ├── impl
│ │ │ └── CriteriaElementFilterImpl.java
│ │ └── package-info.java
│ │ ├── fluentfilter
│ │ ├── FluentElementFilter.java
│ │ ├── TransitionFilters.java
│ │ ├── impl
│ │ │ ├── ChildElementsTransitionFilter.java
│ │ │ ├── ElementBasedTransitionFilter.java
│ │ │ ├── ParentElementTransitionFilter.java
│ │ │ ├── RemoveDuplicatesTransitionFilter.java
│ │ │ ├── SuperTypesTransitionFilter.java
│ │ │ └── TransitionFilter.java
│ │ └── package-info.java
│ │ ├── fluentvalidator
│ │ ├── FluentElementValidator.java
│ │ ├── impl
│ │ │ ├── FluentValidatorMessage.java
│ │ │ ├── FluentValidatorState.java
│ │ │ └── package-info.java
│ │ └── package-info.java
│ │ ├── generators
│ │ ├── FileObjectSimpleWriter.java
│ │ ├── SimpleJavaWriter.java
│ │ ├── SimpleKotlinWriter.java
│ │ ├── SimpleResourceReader.java
│ │ ├── SimpleResourceWriter.java
│ │ ├── SimpleWriter.java
│ │ └── package-info.java
│ │ ├── generics
│ │ ├── GenericType.java
│ │ ├── GenericTypeKind.java
│ │ ├── GenericTypeParameter.java
│ │ ├── GenericTypeWildcard.java
│ │ └── package-info.java
│ │ ├── matcher
│ │ ├── BaseMatcher.java
│ │ ├── CriteriaMatcher.java
│ │ ├── ImplicitMatcher.java
│ │ ├── impl
│ │ │ ├── ByAnnotationMatcher.java
│ │ │ ├── ByElementKindMatcher.java
│ │ │ ├── ByGenericTypeMatcher.java
│ │ │ ├── ByModifierMatcher.java
│ │ │ ├── ByNameMatcher.java
│ │ │ ├── ByNameRegexMatcher.java
│ │ │ ├── ByNestingKindMatcher.java
│ │ │ ├── ByNumberOfParametersMatcher.java
│ │ │ ├── ByPackageNameMatcher.java
│ │ │ ├── ByParameterTypeFqnMatcher.java
│ │ │ ├── ByParameterTypeMatcher.java
│ │ │ ├── ByParameterTypeMirrorMatcher.java
│ │ │ ├── ByQualifiedNameMatcher.java
│ │ │ ├── ByQualifiedNameRegexMatcher.java
│ │ │ ├── ByRawTypeFqnMatcher.java
│ │ │ ├── ByRawTypeMatcher.java
│ │ │ ├── ByReturnTypeFqnMatcher.java
│ │ │ ├── ByReturnTypeMatcher.java
│ │ │ ├── ByReturnTypeMirrorMatcher.java
│ │ │ ├── HasNoParametersMatcher.java
│ │ │ ├── HasNoThrownTypesMatcher.java
│ │ │ ├── HasPublicNoargConstructorMatcher.java
│ │ │ ├── HasVoidReturnTypeMatcher.java
│ │ │ ├── IsAnnotationTypeMatcher.java
│ │ │ ├── IsAssignableToFqnMatcher.java
│ │ │ ├── IsAssignableToMatcher.java
│ │ │ ├── IsAssignableToTypeMirrorMatcher.java
│ │ │ ├── IsAttributeFieldMatcher.java
│ │ │ ├── IsClassMatcher.java
│ │ │ ├── IsConstructorMatcher.java
│ │ │ ├── IsEnumMatcher.java
│ │ │ ├── IsExecutableElementMatcher.java
│ │ │ ├── IsFieldMatcher.java
│ │ │ ├── IsGetterMethodMatcher.java
│ │ │ ├── IsInterfaceMatcher.java
│ │ │ ├── IsMethodMatcher.java
│ │ │ ├── IsPackageElementMatcher.java
│ │ │ ├── IsPackageMatcher.java
│ │ │ ├── IsParameterMatcher.java
│ │ │ ├── IsRecordMatcher.java
│ │ │ ├── IsSetterMethodMatcher.java
│ │ │ ├── IsTypeElementMatcher.java
│ │ │ ├── IsTypeEqualFqnMatcher.java
│ │ │ ├── IsTypeEqualMatcher.java
│ │ │ ├── IsTypeMatcher.java
│ │ │ ├── IsVariableElementMatcher.java
│ │ │ └── package-info.java
│ │ └── package-info.java
│ │ ├── package-info.java
│ │ ├── validator
│ │ ├── AbstractBaseValidator.java
│ │ ├── ExclusiveCriteriaElementValidator.java
│ │ ├── ImplicitValidator.java
│ │ ├── InclusiveCriteriaElementValidator.java
│ │ ├── impl
│ │ │ └── CriteriaElementValidatorImpl.java
│ │ └── package-info.java
│ │ └── wrapper
│ │ ├── AnnotationMirrorWrapper.java
│ │ ├── AnnotationValueWrapper.java
│ │ ├── CompileMessageWriter.java
│ │ ├── ElementWrapper.java
│ │ ├── ElementWrapperValidator.java
│ │ ├── ElementWrapperValidatorInterface.java
│ │ ├── ExecutableElementWrapper.java
│ │ ├── ModuleElementWrapper.java
│ │ ├── PackageElementWrapper.java
│ │ ├── RecordComponentElementWrapper.java
│ │ ├── TypeElementWrapper.java
│ │ ├── TypeParameterElementWrapper.java
│ │ └── VariableElementWrapper.java
└── test
│ ├── java
│ └── io
│ │ └── toolisticon
│ │ └── aptk
│ │ ├── tools
│ │ ├── AbstractAnnotationProcessorTest.java
│ │ ├── AbstractUnitTestAnnotationProcessorClass.java
│ │ ├── AnnotationToClassMapperHelperTest.java
│ │ ├── AnnotationUtilsTest.java
│ │ ├── AnnotationValueUtilsTest.java
│ │ ├── BeanUtilsTest.java
│ │ ├── DummyValidatorMessage.java
│ │ ├── ElementUtilsTest.java
│ │ ├── ElementUtils_AccessEnclosedElementsTest.java
│ │ ├── ElementUtils_AccessEnclosingElementsTest.java
│ │ ├── ElementUtils_AccessTypeHierarchyTest.java
│ │ ├── ElementUtils_CastElementTest.java
│ │ ├── ElementUtils_CheckKindOfElementTest.java
│ │ ├── ElementUtils_CheckModifierOfElementTest.java
│ │ ├── FilerUtilsTest.java
│ │ ├── FilterTestAnnotation1.java
│ │ ├── FilterTestAnnotation2.java
│ │ ├── FluentElementFilterTest.java
│ │ ├── InterfaceUtilsTest.java
│ │ ├── IsRepeatable.java
│ │ ├── IsRepeatableWrapper.java
│ │ ├── MessagerUtilsTest.java
│ │ ├── ProcessEnvironmentUtilsTest.java
│ │ ├── TestCoreMatcherFactory.java
│ │ ├── TestMatchers.java
│ │ ├── TypeMirrorWrapperTest.java
│ │ ├── TypeUtilsTest.java
│ │ ├── TypeUtils_CheckTypeKindTest.java
│ │ ├── TypeUtils_GenericsTest.java
│ │ ├── UtilitiesTest.java
│ │ ├── annotationutilstestclasses
│ │ │ ├── ClassArrayAttributeAnnotation.java
│ │ │ ├── ClassAttributeAnnotation.java
│ │ │ ├── DefaultValueAnnotation.java
│ │ │ └── NoAttributeAnnotation.java
│ │ ├── annotationvalueutilstestclasses
│ │ │ └── AnnotationValueTestAnnotation.java
│ │ ├── command
│ │ │ └── impl
│ │ │ │ ├── GetAttributesCommandTest.java
│ │ │ │ └── GetAttributesCommandWithInheritanceTest.java
│ │ ├── filter
│ │ │ ├── ImplicitFilterTest.java
│ │ │ └── InclusiveCriteriaElementFilterTest.java
│ │ ├── fluentfilter
│ │ │ ├── FluentElementFilterTest.java
│ │ │ └── impl
│ │ │ │ ├── ChildElementsTransitionFilterTest.java
│ │ │ │ ├── ParentElementTransitionFilterTest.java
│ │ │ │ ├── RemoveDuplicatesTransitionFilterTest.java
│ │ │ │ └── SuperTypesTransitionFilterTest.java
│ │ ├── fluentvalidator
│ │ │ ├── FluentElementValidatorTest.java
│ │ │ └── impl
│ │ │ │ ├── FluentValidatorMessageTest.java
│ │ │ │ └── FluentValidatorStateTest.java
│ │ ├── generators
│ │ │ ├── FileObjectUtilsTestAnnotation.java
│ │ │ ├── FileObjectUtilsTestAnnotationProcessor.java
│ │ │ ├── SimpleKotlinWriterTest.java
│ │ │ ├── SimpleResourceReaderTest.java
│ │ │ └── SimpleResourceWriterTest.java
│ │ ├── internal
│ │ │ └── UtilitiesTest.java
│ │ ├── matcher
│ │ │ └── impl
│ │ │ │ ├── ByAnnotationMatcherTest.java
│ │ │ │ ├── ByElementKindMatcherTest.java
│ │ │ │ ├── ByGenericTypeMatcherTest.java
│ │ │ │ ├── ByModifierMatcherTest.java
│ │ │ │ ├── ByNameMatcherTest.java
│ │ │ │ ├── ByNameRegexMatcherTest.java
│ │ │ │ ├── ByNestingKindMatcherTest.java
│ │ │ │ ├── ByNumberOfParametersMatcherTest.java
│ │ │ │ ├── ByPackageNameMatcherTest.java
│ │ │ │ ├── ByParameterTypeFqnMatcherTest.java
│ │ │ │ ├── ByParameterTypeMatcherTest.java
│ │ │ │ ├── ByParameterTypeMirrorMatcherTest.java
│ │ │ │ ├── ByQualifiedNameMatcherTest.java
│ │ │ │ ├── ByQualifiedNameRegexMatcherTest.java
│ │ │ │ ├── ByRawTypeFqnMatcherTest.java
│ │ │ │ ├── ByRawTypeMatcherTest.java
│ │ │ │ ├── ByReturnTypeFqnMatcherTest.java
│ │ │ │ ├── ByReturnTypeMatcherTest.java
│ │ │ │ ├── ByReturnTypeMirrorMatcherTest.java
│ │ │ │ ├── HasNoParameterMatcherTest.java
│ │ │ │ ├── HasNoThrownTypesMatcherTest.java
│ │ │ │ ├── HasPublicNoargConstructorMatcherTest.java
│ │ │ │ ├── HasVoidReturnTypeMatcherTest.java
│ │ │ │ ├── IsAnnotationTypeMatcherTest.java
│ │ │ │ ├── IsAssignableToFqnMatcherTest.java
│ │ │ │ ├── IsAssignableToMatcherTest.java
│ │ │ │ ├── IsAssignableToTypeMirrorMatcherTest.java
│ │ │ │ ├── IsAttributeFieldMatcherTest.java
│ │ │ │ ├── IsClassMatcherTest.java
│ │ │ │ ├── IsConstructorMatcherTest.java
│ │ │ │ ├── IsEnumMatcherTest.java
│ │ │ │ ├── IsExecutableElementMatcherTest.java
│ │ │ │ ├── IsFieldMatcherTest.java
│ │ │ │ ├── IsGetterMethodMatcherTest.java
│ │ │ │ ├── IsInterfaceMatcherTest.java
│ │ │ │ ├── IsMethodMatcherTest.java
│ │ │ │ ├── IsPackageElementMatcherTest.java
│ │ │ │ ├── IsPackageMatcherTest.java
│ │ │ │ ├── IsParameterMatcherTest.java
│ │ │ │ ├── IsSetterMethodMatcherTest.java
│ │ │ │ ├── IsTypeElementMatcherTest.java
│ │ │ │ ├── IsTypeEqualFqnMatcherTest.java
│ │ │ │ ├── IsTypeEqualMatcherTest.java
│ │ │ │ ├── IsVariableElementMatcherTest.java
│ │ │ │ └── ParameterTypeFqnMatcherTest.java
│ │ ├── validator
│ │ │ ├── AnnotationValidatorTest.java
│ │ │ ├── GenericMatcherTest.java
│ │ │ ├── ModifierValidatorTest.java
│ │ │ └── impl
│ │ │ │ └── CriteriaElementValidatorImplTest.java
│ │ └── wrapper
│ │ │ ├── AnnotationMirrorWrapperTest.java
│ │ │ ├── AnnotationValueWrapperTest.java
│ │ │ ├── ElementWrapperTest.java
│ │ │ ├── ExecutableElementWrapperTest.java
│ │ │ ├── ModulesElementWrapperTest.java
│ │ │ ├── PackageElementWrapperTest.java
│ │ │ ├── TypeElementWrapperTest.java
│ │ │ ├── TypeParameterElementWrapperTest.java
│ │ │ └── VariableElementWrapperTest.java
│ │ └── validators
│ │ └── FluentElementValidatorTest.java
│ └── resources
│ ├── AnnotationClassAttributeTestClass.java
│ ├── AnnotationProcessorTestClass.java
│ ├── AnnotationProcessorUnitTestClassInternal.java
│ ├── AnnotationValueUtilsTestClass.java
│ ├── GenericsTestClass.java
│ ├── mockito-extensions
│ └── org.mockito.plugins.MockMaker
│ ├── testcases.beanutils
│ ├── DefaultNoargConstructorTest.java
│ ├── ExplicitNoargConstructorTest.java
│ ├── ExplicitNoargConstructorTest2.java
│ ├── FieldLevelTestcases.java
│ └── TypeHierarchyTestClass.java
│ ├── testcases.commands
│ ├── GetAttributesCommandTestClass.java
│ └── GetAttributesCommandWithInheritanceTestClass.java
│ ├── testcases.matchers.hasnoargsconstructormatcher
│ ├── LombokNoArgsConstructorAnnotation.java
│ └── LombokNoConstructorWithAllArgsConstructorAnnotation.java
│ └── testcases
│ └── generators
│ ├── FilerUtilsTestClass.java
│ ├── expectedResult.txt
│ └── testTemplate.tpl
└── tmp
├── AnnotationValidatorTest.java
├── FluentElementValidatorTest.java
├── FluentModifierElementValidatorTest.java
├── FluentTypeElementValidatorTest.java
├── FluentValidatorTest.java
├── GenericMatcherTest.java
├── ModifierValidatorTest.java
├── TypeElementCharacteristicMatcherTest.java
└── ValidatorTest.java
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: maven
4 | directory: "/"
5 | schedule:
6 | interval: daily
7 | time: "04:00"
8 | open-pull-requests-limit: 10
9 | ignore:
10 | - dependency-name: org.mockito:mockito-core
11 | versions:
12 | - 3.7.7
13 | - 3.8.0
14 | - dependency-name: org.projectlombok:lombok
15 | versions:
16 | - 1.18.18
17 | - dependency-name: org.codehaus.mojo:animal-sniffer-maven-plugin
18 | versions:
19 | - "1.19"
20 | - dependency-name: org.apache.maven.plugins:maven-checkstyle-plugin
21 | versions:
22 | - 3.1.1
23 |
--------------------------------------------------------------------------------
/.github/workflows/default.yml:
--------------------------------------------------------------------------------
1 | name: default
2 |
3 | on:
4 | push:
5 | branches:
6 | - '*'
7 | - '**/*'
8 | - '!master'
9 |
10 | jobs:
11 | build:
12 | runs-on: ${{ matrix.os }}
13 | strategy:
14 | matrix:
15 | os: [ ubuntu-latest,macos-latest,windows-latest ]
16 | java: [ '8', '11', '17', '21' ]
17 |
18 | steps:
19 | - name: Checkout Code
20 | uses: actions/checkout@v4
21 |
22 | - name: Set up JDK ${{ matrix.java }}
23 | uses: actions/setup-java@v4
24 | with:
25 | distribution: 'zulu'
26 | java-version: ${{ matrix.java }}
27 | cache: 'maven'
28 |
29 |
30 | - name: Prepare mvnw
31 | run: chmod +x ./mvnw
32 |
33 | - name: Build
34 | run: ./mvnw clean package
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/.github/workflows/default_oracle.yml:
--------------------------------------------------------------------------------
1 | name: default_oracle
2 |
3 | on:
4 | push:
5 | branches:
6 | - '*'
7 | - '**/*'
8 | - '!master'
9 |
10 | jobs:
11 | build:
12 | runs-on: ${{ matrix.os }}
13 | strategy:
14 | matrix:
15 | os: [ ubuntu-latest,macos-latest,windows-latest ]
16 | java: [ '17', '21' ]
17 |
18 | steps:
19 | - name: Checkout Code
20 | uses: actions/checkout@v4
21 |
22 | - name: Set up JDK ${{ matrix.java }}
23 | uses: actions/setup-java@v4
24 | with:
25 | distribution: 'oracle'
26 | java-version: ${{ matrix.java }}
27 | cache: 'maven'
28 |
29 |
30 | - name: Prepare mvnw
31 | run: chmod +x ./mvnw
32 |
33 | - name: Build
34 | run: ./mvnw clean package
35 |
36 |
--------------------------------------------------------------------------------
/.github/workflows/default_temurin.yml:
--------------------------------------------------------------------------------
1 | name: default_temurin
2 |
3 | on:
4 | push:
5 | branches:
6 | - '*'
7 | - '**/*'
8 | - '!master'
9 |
10 | jobs:
11 | build:
12 | runs-on: ${{ matrix.os }}
13 | strategy:
14 | matrix:
15 | os: [ ubuntu-latest,macos-latest,windows-latest ]
16 | java: [ '11', '17', '21' ]
17 |
18 | steps:
19 | - name: Checkout Code
20 | uses: actions/checkout@v4
21 |
22 | - name: Set up JDK ${{ matrix.java }}
23 | uses: actions/setup-java@v4
24 | with:
25 | distribution: 'temurin'
26 | java-version: ${{ matrix.java }}
27 | cache: 'maven'
28 |
29 |
30 | - name: Prepare mvnw
31 | run: chmod +x ./mvnw
32 |
33 | - name: Build
34 | run: ./mvnw clean package
35 |
36 |
--------------------------------------------------------------------------------
/.github/workflows/dropStaging.yml:
--------------------------------------------------------------------------------
1 | # This is a basic workflow to help you get started with Actions
2 |
3 | name: Drop Staging Repository
4 |
5 | # Controls when the workflow will run
6 | on:
7 | # Allows you to run this workflow manually from the Actions tab
8 | workflow_dispatch:
9 |
10 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel
11 | jobs:
12 | # This workflow contains a single job called "build"
13 | build:
14 | # The type of runner that the job will run on
15 | runs-on: ubuntu-latest
16 |
17 | # Steps represent a sequence of tasks that will be executed as part of the job
18 | steps:
19 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
20 | - uses: actions/checkout@v4
21 |
22 | # Setup JDK and Maven
23 | - name: Set up JDK 9
24 | uses: actions/setup-java@v4
25 | with:
26 | distribution: 'zulu'
27 | java-version: 17
28 | cache: 'maven'
29 | server-id: sonatype-nexus-staging
30 | server-username: OSS_CENTRAL_USERNAME # env variable for Maven Central
31 | server-password: OSS_CENTRAL_PASSWORD # env variable for Maven Central
32 |
33 | # Drop staging repository
34 | - name: drop staging
35 | run: ./mvnw nexus-staging:drop -DstagingDescription="Drop staging"
36 | env:
37 | OSS_CENTRAL_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
38 | OSS_CENTRAL_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
39 |
--------------------------------------------------------------------------------
/.github/workflows/jacoco.yml:
--------------------------------------------------------------------------------
1 | name: jacoco
2 |
3 | on:
4 | push:
5 | branches:
6 | - '*'
7 | - '**/*'
8 |
9 | jobs:
10 | build:
11 |
12 | runs-on: ubuntu-latest
13 |
14 | steps:
15 | - name: Checkout code
16 | uses: actions/checkout@v4
17 |
18 | - name: Set up JDK 17
19 | uses: actions/setup-java@v4
20 | with:
21 | distribution: 'zulu'
22 | java-version: 17
23 | cache: 'maven'
24 |
25 |
26 | - name: Prepare mvnw
27 | run: chmod +x ./mvnw
28 |
29 | - name: Build
30 | run: ./mvnw verify jacoco:report-aggregate -B -q
31 |
32 | - name: Upload coverage to Codecov
33 | uses: codecov/codecov-action@v2
34 | with:
35 | token: ${{secrets.CODECOV_TOKEN}}
36 | files: target/site/jacoco-aggregate/jacoco.xml
37 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: release_on_master
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 | jobs:
8 | build:
9 |
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - name: Checkout Code
14 | uses: actions/checkout@v4
15 |
16 | # Get GPG private key into GPG
17 | - name: Import GPG Owner Trust
18 | run: echo ${{ secrets.GPG_OWNERTRUST }} | base64 --decode | gpg --import-ownertrust
19 | - name: Import GPG key
20 | run: echo ${{ secrets.GPG_SECRET_KEYS }} | base64 --decode | gpg --import --no-tty --batch --yes
21 |
22 | # Setup JDK and Maven
23 | - name: Set up JDK 17
24 | uses: actions/setup-java@v4
25 | with:
26 | distribution: 'zulu'
27 | java-version: 17
28 | cache: 'maven'
29 | server-id: sonatype-nexus-staging
30 | server-username: OSS_CENTRAL_USERNAME # env variable for Maven Central
31 | server-password: OSS_CENTRAL_PASSWORD # env variable for Maven Central
32 |
33 | - name: Prepare mvnw
34 | run: chmod +x ./mvnw
35 |
36 | - name: Build
37 | run: ./mvnw clean package
38 |
39 | - name: Deploy a new version to central
40 | run: ./mvnw clean install javadoc:jar source:jar deploy -B -DskipTests -Prelease -Dgpg.keyname=${{secrets.GPG_KEYNAME}} -Dgpg.passphrase="${{secrets.GPG_PASSPHRASE}}"
41 | env:
42 | OSS_CENTRAL_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
43 | OSS_CENTRAL_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
44 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Build and Release Folders
2 | target
3 | .settings
4 | .project
5 | .classpath
6 | *.iml
7 | .idea
8 | atlassian-ide-plugin.xml
9 | **/dependency-reduced-pom.xml
10 | **/.factorypath
11 |
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/toolisticon/aptk/00148fc03a2e6c5dfb5ee541bec3af78f5b91686/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.1/apache-maven-3.6.1-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 TOOListicon
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/annotationwrapper/api/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4.0.0
4 |
5 | aptk-annotationwrapper-api
6 | jar
7 |
8 |
9 | io.toolisticon.aptk
10 | aptk-annotationwrapper-parent
11 | 0.30.3-SNAPSHOT
12 |
13 |
14 | aptk-annotationwrapper-api
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | maven-compiler-plugin
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/annotationwrapper/api/src/main/java/io/toolisticon/aptk/annotationwrapper/api/AnnotationWrapper.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.annotationwrapper.api;
2 |
3 | import java.lang.annotation.Annotation;
4 | import java.lang.annotation.Documented;
5 | import java.lang.annotation.ElementType;
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.RetentionPolicy;
8 | import java.lang.annotation.Target;
9 |
10 | /**
11 | * Annotation to create a wrapper class for an annotation.
12 | * The wrapper
13 | */
14 | @Target({ElementType.PACKAGE, ElementType.TYPE})
15 | @Retention(RetentionPolicy.RUNTIME)
16 | @Documented
17 | public @interface AnnotationWrapper {
18 | /**
19 | * The annotations to create wrappers for.
20 | *
21 | * @return
22 | */
23 | Class extends Annotation>[] value();
24 |
25 | /**
26 | * Adds a custom interface to the wrapper.
27 | *
28 | * @return
29 | */
30 | CustomInterface[] customInterfaces() default {};
31 |
32 | /**
33 | * Bind custom code into the api.
34 | *
35 | * @return
36 | */
37 | Class[] bindCustomCode() default {};
38 |
39 | /**
40 | * Configures to generate wrappers for all embedded annotations as well.
41 | * Defaults to true.
42 | *
43 | * @return
44 | */
45 | boolean automaticallyWrapEmbeddedAnnotations() default true;
46 |
47 | /**
48 | * Configures to use public visibility for all wrappers.
49 | * Package private visibility will be used, if set to false
50 | * Defaults to false.
51 | *
52 | * @return
53 | */
54 | boolean usePublicVisibility() default false;
55 | }
56 |
--------------------------------------------------------------------------------
/annotationwrapper/api/src/main/java/io/toolisticon/aptk/annotationwrapper/api/CustomCodeMethod.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.annotationwrapper.api;
2 |
3 | import java.lang.annotation.Annotation;
4 | import java.lang.annotation.Documented;
5 | import java.lang.annotation.ElementType;
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.RetentionPolicy;
8 | import java.lang.annotation.Target;
9 |
10 | /**
11 | * Marks method to be included as custom code to wrapper api.
12 | *
13 | * Annotated methods must be non private, static and their first parameter must match the Annotation wrapper type to which the method should be bound.
14 | */
15 | @Target(ElementType.METHOD)
16 | @Retention(RetentionPolicy.RUNTIME)
17 | @Documented
18 | public @interface CustomCodeMethod {
19 | /** The annotation to which the code method should be bound with. */
20 | Class extends Annotation> value();
21 | }
22 |
--------------------------------------------------------------------------------
/annotationwrapper/api/src/main/java/io/toolisticon/aptk/annotationwrapper/api/CustomInterface.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.annotationwrapper.api;
2 |
3 | import java.lang.annotation.Annotation;
4 | import java.lang.annotation.Documented;
5 | import java.lang.annotation.ElementType;
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.RetentionPolicy;
8 | import java.lang.annotation.Target;
9 |
10 | /**
11 | * Adds custom interfaces to AnnotationWrapper
12 | */
13 | @Target(ElementType.ANNOTATION_TYPE)
14 | @Retention(RetentionPolicy.RUNTIME)
15 | @Documented
16 | public @interface CustomInterface {
17 |
18 | /**
19 | * Annotation type.
20 | * @return
21 | */
22 | Class extends Annotation> annotationToWrap();
23 |
24 | /**
25 | * Interfaces to apply
26 | * @return
27 | */
28 | Class>[] interfacesToApply();
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/annotationwrapper/integrationtest/src/main/java/io/toolisticon/aptk/annotationwrapper/test/EmbeddedAnnotation.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.annotationwrapper.test;
2 |
3 | import java.lang.annotation.Retention;
4 | import java.lang.annotation.RetentionPolicy;
5 |
6 | @Retention(RetentionPolicy.RUNTIME)
7 | public @interface EmbeddedAnnotation {
8 | long value();
9 | }
10 |
--------------------------------------------------------------------------------
/annotationwrapper/integrationtest/src/main/java/io/toolisticon/aptk/annotationwrapper/test/ExampleTestAnnotation.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.annotationwrapper.test;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 |
9 | @Target(ElementType.TYPE)
10 | @Retention(RetentionPolicy.RUNTIME)
11 | @Documented
12 | public @interface ExampleTestAnnotation {
13 |
14 | // single value attributes
15 |
16 | String stringAttribute();
17 |
18 | char charAttribute() default 'X';
19 |
20 | int intAttribute() default 0;
21 |
22 | long longAttribute();
23 |
24 | float floatAttribute() default 0.0f;
25 |
26 | double doubleAttribute();
27 |
28 | short shortAttribute() default 0;
29 |
30 | byte byteAttribute() default 0;
31 |
32 | boolean booleanAttribute() default false;
33 |
34 | Class> typeAttribute();
35 |
36 | TestEnum enumAttribute();
37 |
38 | EmbeddedAnnotation annotationAttribute();
39 |
40 | // Array based attributes
41 |
42 | String[] stringArrayAttribute() default {};
43 |
44 | char[] charArrayAttribute() default {};
45 |
46 | int[] intArrayAttribute() default {};
47 |
48 | long[] longArrayAttribute() default {};
49 |
50 | float[] floatArrayAttribute() default {};
51 |
52 | double[] doubleArrayAttribute() default {};
53 |
54 | boolean[] booleanArrayAttribute() default {};
55 |
56 | short[] shortArrayAttribute() default {};
57 |
58 | byte[] byteArrayAttribute() default {};
59 |
60 | TestEnum[] enumArrayAttribute();
61 |
62 | Class>[] typeArrayAttribute();
63 |
64 | EmbeddedAnnotation[] annotationArrayAttribute();
65 |
66 | }
--------------------------------------------------------------------------------
/annotationwrapper/integrationtest/src/main/java/io/toolisticon/aptk/annotationwrapper/test/TestDefaultsAnnotation.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.annotationwrapper.test;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | @Target(ElementType.TYPE)
9 | @Retention(RetentionPolicy.RUNTIME)
10 | public @interface TestDefaultsAnnotation {
11 |
12 | String withDefault() default "default";
13 |
14 | String withoutDefault() default "notDefault";
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/annotationwrapper/integrationtest/src/main/java/io/toolisticon/aptk/annotationwrapper/test/TestEnum.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.annotationwrapper.test;
2 |
3 | public enum TestEnum {
4 | ONE, TWO, THREE;
5 | }
--------------------------------------------------------------------------------
/annotationwrapper/integrationtest/src/main/java/io/toolisticon/aptk/annotationwrapper/test/annotationonpackage/AutoDetectedCustomCodeClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.annotationwrapper.test.annotationonpackage;
2 |
3 | import io.toolisticon.aptk.annotationwrapper.api.CustomCodeMethod;
4 | import io.toolisticon.aptk.annotationwrapper.test.ExampleTestAnnotation;
5 |
6 | public class AutoDetectedCustomCodeClass {
7 |
8 | @CustomCodeMethod(ExampleTestAnnotation.class)
9 | public static String autoDetectedMethod(ExampleTestAnnotationWrapper testAnnotationWrapper, String firstArg) {
10 | testAnnotationWrapper.enumAttribute();
11 | return "it worked : " + firstArg;
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/annotationwrapper/integrationtest/src/main/java/io/toolisticon/aptk/annotationwrapper/test/annotationonpackage/CustomCodeClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.annotationwrapper.test.annotationonpackage;
2 |
3 | import io.toolisticon.aptk.annotationwrapper.api.CustomCodeMethod;
4 | import io.toolisticon.aptk.annotationwrapper.test.ExampleTestAnnotation;
5 |
6 | public class CustomCodeClass {
7 |
8 | @CustomCodeMethod(ExampleTestAnnotation.class)
9 | public static String forwardedMethod(ExampleTestAnnotationWrapper testAnnotationWrapper, String firstArg) {
10 | testAnnotationWrapper.enumAttribute();
11 | return "it worked : " + firstArg;
12 | }
13 |
14 | @CustomCodeMethod(ExampleTestAnnotation.class)
15 | public static void forwardedMethodWithNoReturnValue(ExampleTestAnnotationWrapper testAnnotationWrapper, String firstArg) {
16 | testAnnotationWrapper.enumAttribute();
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/annotationwrapper/integrationtest/src/main/java/io/toolisticon/aptk/annotationwrapper/test/annotationonpackage/package-info.java:
--------------------------------------------------------------------------------
1 | @AnnotationWrapper(
2 | value = {ExampleTestAnnotation.class, TestDefaultsAnnotation.class},
3 | bindCustomCode = {CustomCodeClass.class},
4 | automaticallyWrapEmbeddedAnnotations = true)
5 | package io.toolisticon.aptk.annotationwrapper.test.annotationonpackage;
6 |
7 | import io.toolisticon.aptk.annotationwrapper.api.AnnotationWrapper;
8 | import io.toolisticon.aptk.annotationwrapper.test.ExampleTestAnnotation;
9 | import io.toolisticon.aptk.annotationwrapper.test.TestDefaultsAnnotation;
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/annotationwrapper/integrationtest/src/main/java/io/toolisticon/aptk/annotationwrapper/test/annotationontype/AutoDetectedCustomCodeClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.annotationwrapper.test.annotationontype;
2 |
3 | import io.toolisticon.aptk.annotationwrapper.api.CustomCodeMethod;
4 | import io.toolisticon.aptk.annotationwrapper.test.ExampleTestAnnotation;
5 |
6 | public class AutoDetectedCustomCodeClass {
7 |
8 | @CustomCodeMethod(ExampleTestAnnotation.class)
9 | public static String autoDetectedMethod(ExampleTestAnnotationWrapper testAnnotationWrapper, String firstArg) {
10 | testAnnotationWrapper.enumAttribute();
11 | return "it worked : " + firstArg;
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/annotationwrapper/integrationtest/src/main/java/io/toolisticon/aptk/annotationwrapper/test/annotationontype/CustomCodeClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.annotationwrapper.test.annotationontype;
2 |
3 | import io.toolisticon.aptk.annotationwrapper.api.CustomCodeMethod;
4 | import io.toolisticon.aptk.annotationwrapper.test.ExampleTestAnnotation;
5 |
6 | public class CustomCodeClass {
7 |
8 | @CustomCodeMethod(ExampleTestAnnotation.class)
9 | public static String forwardedMethod(ExampleTestAnnotationWrapper testAnnotationWrapper, String firstArg) {
10 | testAnnotationWrapper.enumAttribute();
11 | return "it worked : " + firstArg;
12 | }
13 |
14 | @CustomCodeMethod(ExampleTestAnnotation.class)
15 | public static void forwardedMethodWithNoReturnValue(ExampleTestAnnotationWrapper testAnnotationWrapper, String firstArg) {
16 | testAnnotationWrapper.enumAttribute();
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/annotationwrapper/integrationtest/src/main/java/io/toolisticon/aptk/annotationwrapper/test/annotationontype/PackagePlaceholder.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.annotationwrapper.test.annotationontype;
2 |
3 | import io.toolisticon.aptk.annotationwrapper.api.AnnotationWrapper;
4 | import io.toolisticon.aptk.annotationwrapper.test.ExampleTestAnnotation;
5 | import io.toolisticon.aptk.annotationwrapper.test.TestDefaultsAnnotation;
6 |
7 |
8 | @AnnotationWrapper(
9 | value = {ExampleTestAnnotation.class, TestDefaultsAnnotation.class},
10 | bindCustomCode = {CustomCodeClass.class},
11 | automaticallyWrapEmbeddedAnnotations = true)
12 |
13 | public class PackagePlaceholder {
14 | }
15 |
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/main/java/io/toolisticon/aptk/annotationwrapper/processor/AnnotationWrapperProcessorMessages.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.annotationwrapper.processor;
2 |
3 | import io.toolisticon.aptk.annotationwrapper.api.CustomCodeMethod;
4 | import io.toolisticon.aptk.tools.corematcher.ValidationMessage;
5 |
6 | public enum AnnotationWrapperProcessorMessages implements ValidationMessage {
7 |
8 | ERROR_CUSTOMCODEMETHOD_REFERENCES_NO_WRAPPER("ANNOTATION_WRAPPER_ERROR_001", CustomCodeMethod.class.getSimpleName().toString() + " annotated methods first parameter must be a known annotation wrapper but is ${0}"),
9 | ERROR_CANT_CREATE_WRAPPER("ANNOTATION_WRAPPER_ERROR_001", "Can't create wrapper class for Annotation ${0}"),
10 | ERROR_FIRST_PARAMETER_OF_CUSTOM_CODE_METHOD_MUST_BE_WRAPPER_TYPE("ANNOTATION_WRAPPER_ERROR_001", "The first parameter of a custom code method for an annotation wrapper must be of the annotation wrapper type '${0}' but has is '${1}'");
11 |
12 | /**
13 | * the message code.
14 | */
15 | private final String code;
16 | /**s
17 | * the message text.
18 | */
19 | private final String message;
20 |
21 | /**
22 | * Constructor.
23 | *
24 | * @param code the message code
25 | * @param message the message text
26 | */
27 | AnnotationWrapperProcessorMessages(String code, String message) {
28 | this.code = code;
29 | this.message = message;
30 | }
31 |
32 | /**
33 | * Gets the code of the message.
34 | *
35 | * @return the message code
36 | */
37 | public String getCode() {
38 | return this.code;
39 | }
40 |
41 | /**
42 | * Gets the message text.
43 | *
44 | * @return the message text
45 | */
46 | public String getMessage() {
47 | return message;
48 | }
49 |
50 |
51 | }
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/test/java/io/toolisticon/aptk/annotationwrapper/processor/WrapperAnnotationProcessorMessagesTest.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.annotationwrapper.processor;
2 |
3 | import org.hamcrest.MatcherAssert;
4 | import org.hamcrest.Matchers;
5 | import org.junit.Test;
6 |
7 | /**
8 | * Unit test for {@link AnnotationWrapperProcessorMessages}.
9 | *
10 | */
11 | public class WrapperAnnotationProcessorMessagesTest {
12 |
13 | @Test
14 | public void test_enum() {
15 |
16 | MatcherAssert.assertThat(AnnotationWrapperProcessorMessages.ERROR_CANT_CREATE_WRAPPER.getCode(), Matchers.is("ANNOTATION_WRAPPER_ERROR_001"));
17 | MatcherAssert.assertThat(AnnotationWrapperProcessorMessages.ERROR_CANT_CREATE_WRAPPER.getMessage(), Matchers.notNullValue());
18 | }
19 |
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/test/resources/testcase/common/EmbeddedAnnotation.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.wrapper.test;
2 |
3 | import java.lang.annotation.Retention;
4 | import java.lang.annotation.RetentionPolicy;
5 |
6 | @Retention(RetentionPolicy.RUNTIME)
7 | public @interface EmbeddedAnnotation {
8 | long value();
9 | }
10 |
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/test/resources/testcase/common/TestAnnotation.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.wrapper.test;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 |
9 | @Target(ElementType.TYPE)
10 | @Retention(RetentionPolicy.RUNTIME)
11 | @Documented
12 | public @interface TestAnnotation {
13 |
14 | char charAttribute() default 'X';
15 |
16 | String stringAttribute();
17 |
18 | int intAttribute();
19 |
20 | long longAttribute();
21 |
22 | float floatAttribute() default 0.0f;
23 |
24 | double doubleAttribute();
25 |
26 | boolean booleanAttribute() default false;
27 |
28 | Class> typeAttribute();
29 |
30 | TestEnum enumAttribute();
31 |
32 | EmbeddedAnnotation annotationAttribute();
33 |
34 |
35 | int[] intArrayAttribute() default{};
36 | long[] longArrayAttribute() default{};
37 | float[] floatArrayAttribute() default{};
38 | double[] doubleArrayAttribute() default{};
39 | boolean[] booleanArrayAttribute() default{};
40 | char[] charArrayAttribute() default {};
41 |
42 | String[] stringArrayAttribute() default {};
43 |
44 | TestEnum[] enumArrayAttribute();
45 |
46 | Class>[] typeArrayAttribute();
47 |
48 | EmbeddedAnnotation[] annotationArrayAttribute();
49 |
50 | }
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/test/resources/testcase/common/TestEnum.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.wrapper.test;
2 |
3 | public enum TestEnum {
4 | ONE, TWO, THREE;
5 | }
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/test/resources/testcase/withCustomCode/CustomCodeClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.wrapper.test;
2 |
3 | import io.toolisticon.aptk.annotationwrapper.api.CustomCodeMethod;
4 | import io.toolisticon.cute.TestAnnotation;
5 |
6 | public class CustomCodeClass {
7 |
8 | @CustomCodeMethod(TestAnnotation.class)
9 | public static String shouldWork(TestAnnotationWrapper testAnnotationWrapper, String arg1) {
10 | return "yes " + arg1;
11 | }
12 |
13 | @CustomCodeMethod(TestAnnotation.class)
14 | public static void shouldWorkWithVoidReturnValue(TestAnnotationWrapper testAnnotationWrapper, String arg1) {
15 |
16 | }
17 |
18 | }
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/test/resources/testcase/withCustomCode/package-info.java:
--------------------------------------------------------------------------------
1 | @AnnotationWrapper(value = {TestAnnotation.class}, bindCustomCode = {CustomCodeClass.class}, automaticallyWrapEmbeddedAnnotations = false)
2 | package io.toolisticon.aptk.wrapper.test;
3 |
4 | import io.toolisticon.aptk.annotationwrapper.api.AnnotationWrapper;
5 | import io.toolisticon.cute.TestAnnotation;
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/test/resources/testcase/withCustomCodeButNonStaticMethod/CustomCodeClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.wrapper.test;
2 |
3 | import io.toolisticon.aptk.annotationwrapper.api.CustomCodeMethod;
4 | import io.toolisticon.cute.TestAnnotation;
5 |
6 | public class CustomCodeClass {
7 |
8 | @CustomCodeMethod(TestAnnotation.class)
9 | public String shouldntWork(TestAnnotationWrapper testAnnotationWrapper, String arg1) {
10 | return "yes " + arg1;
11 | }
12 |
13 | }
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/test/resources/testcase/withCustomCodeButNonStaticMethod/package-info.java:
--------------------------------------------------------------------------------
1 | @AnnotationWrapper(value = {TestAnnotation.class}, bindCustomCode = {CustomCodeClass.class}, automaticallyWrapEmbeddedAnnotations = false)
2 | package io.toolisticon.aptk.wrapper.test;
3 |
4 | import io.toolisticon.aptk.annotationwrapper.api.AnnotationWrapper;
5 | import io.toolisticon.cute.TestAnnotation;
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/test/resources/testcase/withCustomCodeButNotVisibleMethod/CustomCodeClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.wrapper.test;
2 |
3 | import io.toolisticon.aptk.annotationwrapper.api.CustomCodeMethod;
4 | import io.toolisticon.cute.TestAnnotation;
5 |
6 | public class CustomCodeClass {
7 |
8 | @CustomCodeMethod(TestAnnotation.class)
9 | private static String shouldntWork(TestAnnotationWrapper testAnnotationWrapper, String arg1) {
10 | return "yes " + arg1;
11 | }
12 |
13 | }
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/test/resources/testcase/withCustomCodeButNotVisibleMethod/package-info.java:
--------------------------------------------------------------------------------
1 | @AnnotationWrapper(value = {TestAnnotation.class}, bindCustomCode = {CustomCodeClass.class}, automaticallyWrapEmbeddedAnnotations = false)
2 | package io.toolisticon.aptk.wrapper.test;
3 |
4 | import io.toolisticon.aptk.annotationwrapper.api.AnnotationWrapper;
5 | import io.toolisticon.cute.TestAnnotation;
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/test/resources/testcase/withCustomCodeButWrongFirstParameter/CustomCodeClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.wrapper.test;
2 |
3 | import io.toolisticon.aptk.annotationwrapper.api.CustomCodeMethod;
4 | import io.toolisticon.cute.TestAnnotation;
5 |
6 | public class CustomCodeClass {
7 |
8 | @CustomCodeMethod(TestAnnotation.class)
9 | public static String shouldntWork(String arg1) {
10 | return "yes " + arg1;
11 | }
12 |
13 | }
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/test/resources/testcase/withCustomCodeButWrongFirstParameter/package-info.java:
--------------------------------------------------------------------------------
1 | @AnnotationWrapper(value = {TestAnnotation.class}, bindCustomCode = {CustomCodeClass.class}, automaticallyWrapEmbeddedAnnotations = false)
2 | package io.toolisticon.aptk.wrapper.test;
3 |
4 | import io.toolisticon.aptk.annotationwrapper.api.AnnotationWrapper;
5 | import io.toolisticon.cute.TestAnnotation;
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/test/resources/testcase/withCustomCodeReferencingGeneratedType/CustomCodeClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.wrapper.test;
2 |
3 | import io.toolisticon.aptk.annotationwrapper.api.CustomCodeMethod;
4 | import io.toolisticon.aptk.wrapper.test.TestAnnotation;
5 |
6 | public class CustomCodeClass {
7 |
8 | @CustomCodeMethod(TestAnnotation.class)
9 | public static TestAnnotation2Wrapper shouldWork(TestAnnotationWrapper testAnnotationWrapper) {
10 | return null;
11 | }
12 |
13 | @CustomCodeMethod(TestAnnotation.class)
14 | public static io.toolisticon.aptk.wrapper.othertest.TestAnnotation3Wrapper shouldWorkAsWell(TestAnnotationWrapper testAnnotationWrapper) {
15 | return null;
16 | }
17 |
18 | }
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/test/resources/testcase/withCustomCodeReferencingGeneratedType/TestAnnotation2.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.wrapper.test;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 |
9 | @Target(ElementType.TYPE)
10 | @Retention(RetentionPolicy.RUNTIME)
11 | @Documented
12 | public @interface TestAnnotation2 {
13 |
14 | String value();
15 |
16 | }
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/test/resources/testcase/withCustomCodeReferencingGeneratedType/otherTest/TestAnnotation3.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.wrapper.othertest;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 |
9 | @Target(ElementType.TYPE)
10 | @Retention(RetentionPolicy.RUNTIME)
11 | @Documented
12 | public @interface TestAnnotation3 {
13 |
14 | String value();
15 |
16 | }
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/test/resources/testcase/withCustomCodeReferencingGeneratedType/otherTest/package-info.java:
--------------------------------------------------------------------------------
1 | @AnnotationWrapper(value = { TestAnnotation3.class}, automaticallyWrapEmbeddedAnnotations = false, usePublicVisibility = true)
2 | package io.toolisticon.aptk.wrapper.othertest;
3 |
4 | import io.toolisticon.aptk.annotationwrapper.api.AnnotationWrapper;
5 | import io.toolisticon.cute.TestAnnotation;
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/test/resources/testcase/withCustomCodeReferencingGeneratedType/package-info.java:
--------------------------------------------------------------------------------
1 | @AnnotationWrapper(value = {TestAnnotation.class, TestAnnotation2.class}, bindCustomCode = {CustomCodeClass.class}, automaticallyWrapEmbeddedAnnotations = false)
2 | package io.toolisticon.aptk.wrapper.test;
3 |
4 | import io.toolisticon.aptk.annotationwrapper.api.AnnotationWrapper;
5 | import io.toolisticon.aptk.wrapper.test.TestAnnotation;
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/test/resources/testcase/withCustomInterface/package-info.java:
--------------------------------------------------------------------------------
1 | @AnnotationWrapper(value = {TestAnnotation.class}, customInterfaces = {@CustomInterface(annotationToWrap = TestAnnotation.class, interfacesToApply = {Serializable.class, Cloneable.class})})
2 | package io.toolisticon.aptk.wrapper.test;
3 |
4 | import io.toolisticon.aptk.annotationwrapper.api.AnnotationWrapper;
5 | import io.toolisticon.aptk.annotationwrapper.api.CustomInterface;
6 | import io.toolisticon.cute.TestAnnotation;
7 |
8 | import java.io.Serializable;
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/test/resources/testcase/withWrappingOfEmbedded/package-info.java:
--------------------------------------------------------------------------------
1 | @AnnotationWrapper(value = {TestAnnotation.class},automaticallyWrapEmbeddedAnnotations = true)
2 | package io.toolisticon.aptk.wrapper.test;
3 |
4 | import io.toolisticon.aptk.annotationwrapper.api.AnnotationWrapper;
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/annotationwrapper/processor/src/test/resources/testcase/withoutWrappingOfEmbedded/package-info.java:
--------------------------------------------------------------------------------
1 | @AnnotationWrapper(value = {TestAnnotation.class},automaticallyWrapEmbeddedAnnotations = false)
2 | package io.toolisticon.aptk.wrapper.test;
3 |
4 | import io.toolisticon.aptk.annotationwrapper.api.AnnotationWrapper;
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/aptk-api/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 | io.toolisticon.aptk
5 | aptk-parent
6 | 0.30.3-SNAPSHOT
7 |
8 | aptk-api
9 | aptk-api
10 |
11 |
12 |
13 |
14 | maven-compiler-plugin
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/aptk-api/src/main/java/io/toolisticon/aptk/api/AnnotationToClassMapper.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.api;
2 |
3 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
4 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
5 |
6 | import java.lang.annotation.Documented;
7 | import java.lang.annotation.Retention;
8 | import java.lang.annotation.Target;
9 |
10 |
11 | /**
12 | * This annotation supports mapping of annotation attributes to constructor or static method invocations.
13 | * It also allows mapping of annotated method parameters if annotated annotation type can be placed on method parameters.
14 | *
15 | */
16 |
17 | @Documented
18 | @Retention(RUNTIME)
19 | @Target(ANNOTATION_TYPE)
20 | public @interface AnnotationToClassMapper {
21 |
22 | Class> mappedClass();
23 |
24 | /**
25 | * the attribute names to map against method or constructor parameters.
26 | * In case if an annotated annotation can be placed on Method Parameters, an empty String will trigger the usage of the corresponding parameter name.
27 | * Names enclosed in {} will be handled as wildcards (local variable references) which cannot be validated at compile time. So be careful if you use them.
28 | * @return
29 | */
30 | String[] mappedAttributeNames();
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/compilermessages/api/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4.0.0
4 |
5 | aptk-compilermessages-api
6 | jar
7 |
8 |
9 | io.toolisticon.aptk
10 | aptk-compilermessages-parent
11 | 0.30.3-SNAPSHOT
12 |
13 |
14 | aptk-compilermessages-api
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | maven-compiler-plugin
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/compilermessages/api/src/main/java/io/toolisticon/aptk/compilermessage/api/DeclareCompilerMessage.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.compilermessage.api;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Repeatable;
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.RetentionPolicy;
8 | import java.lang.annotation.Target;
9 |
10 | /**
11 | * This annotation allows to define a compiler message directly at the processor code or a method.
12 | * The annotation will be used to generate an enum that represents the available compiler messages.
13 | */
14 | @Target({ElementType.METHOD, ElementType.TYPE})
15 | @Retention(RetentionPolicy.RUNTIME)
16 | @Repeatable(DeclareCompilerMessages.class)
17 | @Documented
18 | public @interface DeclareCompilerMessage {
19 |
20 | /*+
21 | * The compiler messages code. Must be unique.
22 | * Defaults to empty String which will result in that the enumValueName is going to be used.
23 | * @return the code of the message
24 | */
25 | String code() default "";
26 |
27 |
28 | /**
29 | * The name of the enum value.
30 | * Must be a valid enum name and must be unique within a compiler message enum.
31 | * @return the enum value name
32 | */
33 | String enumValueName();
34 |
35 | /**
36 | * The compiler message. Might contain zero based placeholders "${INDEX}".
37 | * @return the message
38 | */
39 | String message();
40 |
41 | /**
42 | * Binds the compiler message to a class.
43 | * If not set the compiler message will be generated in a file
44 | * @return
45 | */
46 | Class> processorClass() default Void.class;
47 |
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/compilermessages/api/src/main/java/io/toolisticon/aptk/compilermessage/api/DeclareCompilerMessageCodePrefix.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.compilermessage.api;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 |
9 | /**
10 | * Used to define a message code prefix.
11 | */
12 | @Target({ElementType.TYPE})
13 | @Retention(RetentionPolicy.RUNTIME)
14 | @Documented
15 | public @interface DeclareCompilerMessageCodePrefix {
16 |
17 | /**
18 | * The prefix to be used in compiler message codes.
19 | * Defaults to class name if not explicitly set.
20 | * @return the message code prefix
21 | */
22 | String value() default "";
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/compilermessages/api/src/main/java/io/toolisticon/aptk/compilermessage/api/DeclareCompilerMessages.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.compilermessage.api;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.ElementType;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 |
9 | @Target({ElementType.METHOD, ElementType.TYPE})
10 | @Retention(RetentionPolicy.RUNTIME)
11 | @Documented
12 | public @interface DeclareCompilerMessages {
13 | DeclareCompilerMessage[] value();
14 | }
15 |
--------------------------------------------------------------------------------
/compilermessages/integrationtest/src/main/java/io/toolisticon/aptk/compilermessage/test/ByAnnotationAttribute.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.compilermessage.test;
2 |
3 | import io.toolisticon.aptk.compilermessage.api.DeclareCompilerMessage;
4 |
5 | public class ByAnnotationAttribute {
6 |
7 | @DeclareCompilerMessage(processorClass = OnClassAndNestedClass.class, enumValueName = "BY_ANNOTATION", code="001", message = "Test ${0}")
8 | public static void doSomething() {
9 | System.out.println(OnClassAndNestedClassCompilerMessages.BY_ANNOTATION.getCode());
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/compilermessages/integrationtest/src/main/java/io/toolisticon/aptk/compilermessage/test/OnClassAndNestedClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.compilermessage.test;
2 |
3 | import io.toolisticon.aptk.compilermessage.api.DeclareCompilerMessage;
4 | import io.toolisticon.aptk.compilermessage.api.DeclareCompilerMessageCodePrefix;
5 |
6 | @DeclareCompilerMessageCodePrefix("WTF")
7 | @DeclareCompilerMessage(enumValueName = "ON_CLASS", code = "002",message = "ON CLASS Test ${0}")
8 | public class OnClassAndNestedClass {
9 |
10 | @DeclareCompilerMessage(enumValueName = "ON_CLASS_METHOD", code = "003",message = "ON CLASS METHOD Test ${0}")
11 | public void anotherMethod() {
12 |
13 | }
14 |
15 | @DeclareCompilerMessage(enumValueName = "ON_NESTED_CLASS", code = "004",message = "ON NESTED CLASS Test ${0}")
16 | @DeclareCompilerMessage(enumValueName = "FOR_EMPTY_CODE_TEST1", message = "FOR_EMPTY_CODE_TEST")
17 | @DeclareCompilerMessage(enumValueName = "FOR_EMPTY_CODE_TEST2", message = "FOR_EMPTY_CODE_TEST")
18 | static class nestedClass {
19 |
20 |
21 | @DeclareCompilerMessage(enumValueName = "ON_NESTED_CLASS_METHOD", code = "005",message = "ON NESTED CLASS METHOD Test ${0}")
22 | public void anotherNestedMethod() {
23 |
24 | }
25 |
26 |
27 | }
28 |
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/compilermessages/processor/src/main/java/io/toolisticon/aptk/compilermessage/processor/package-info.java:
--------------------------------------------------------------------------------
1 | @AnnotationWrapper(
2 | value = {DeclareCompilerMessage.class, DeclareCompilerMessageCodePrefix.class},
3 | bindCustomCode = {CompilerMessageWrapperCustomCode.class},
4 | automaticallyWrapEmbeddedAnnotations = true,
5 | usePublicVisibility = true)
6 | package io.toolisticon.aptk.compilermessage.processor;
7 |
8 | import io.toolisticon.aptk.annotationwrapper.api.AnnotationWrapper;
9 | import io.toolisticon.aptk.compilermessage.api.DeclareCompilerMessage;
10 | import io.toolisticon.aptk.compilermessage.api.DeclareCompilerMessageCodePrefix;
11 |
--------------------------------------------------------------------------------
/compilermessages/processor/src/test/resources/testcase/error_nonUniqueCode/TestClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.compilermessage.processor.test;
2 |
3 |
4 | import io.toolisticon.aptk.compilermessage.api.DeclareCompilerMessage;
5 | import io.toolisticon.aptk.compilermessage.api.DeclareCompilerMessageCodePrefix;
6 |
7 | @DeclareCompilerMessageCodePrefix("WTF")
8 | public class TestClass {
9 |
10 |
11 | @DeclareCompilerMessage(enumValueName = "FIRST", code = "002", message = "TEST 1")
12 | @DeclareCompilerMessage(enumValueName = "SECOND", code = "002", message = "TEST 2")
13 | private void method1() {
14 |
15 | }
16 |
17 | }
--------------------------------------------------------------------------------
/compilermessages/processor/src/test/resources/testcase/error_nonUniqueEnumValueName/TestClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.compilermessage.processor.test;
2 |
3 |
4 | import io.toolisticon.aptk.compilermessage.api.DeclareCompilerMessage;
5 | import io.toolisticon.aptk.compilermessage.api.DeclareCompilerMessageCodePrefix;
6 |
7 | @DeclareCompilerMessageCodePrefix("WTF")
8 | @DeclareCompilerMessage(enumValueName = "ON_CLASS", code = "001", message = "TEST 1")
9 | public class TestClass {
10 |
11 |
12 |
13 | @DeclareCompilerMessage(enumValueName = "ON_METHOD", code = "002", message = "TEST 2")
14 | private void aMethod() {
15 |
16 | }
17 |
18 | @DeclareCompilerMessage(enumValueName = "ON_NESTED_CLASS", code = "003", message = "TEST 3")
19 | static class NestedClass {
20 |
21 |
22 | @DeclareCompilerMessage(enumValueName = "ON_NESTED_CLASS_METHOD", code = "004", message = "TEST 4")
23 | private void anotherMethod() {
24 |
25 | }
26 |
27 | }
28 |
29 |
30 | }
--------------------------------------------------------------------------------
/compilermessages/processor/src/test/resources/testcase/happyPath_OnClass/RemoteTestClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.compilermessage.processor.test;
2 |
3 |
4 | import io.toolisticon.aptk.compilermessage.api.DeclareCompilerMessage;
5 |
6 | @DeclareCompilerMessage(processorClass = io.toolisticon.aptk.compilermessage.processor.test.TestClass.class, enumValueName = "ON_REMOTE_CLASS", code = "005", message = "TEST 5")
7 | public class RemoteTestClass {
8 |
9 | }
--------------------------------------------------------------------------------
/compilermessages/processor/src/test/resources/testcase/happyPath_OnClass/TestClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.compilermessage.processor.test;
2 |
3 |
4 | import io.toolisticon.aptk.compilermessage.api.DeclareCompilerMessage;
5 | import io.toolisticon.aptk.compilermessage.api.DeclareCompilerMessageCodePrefix;
6 |
7 | @DeclareCompilerMessageCodePrefix("WTF")
8 | @DeclareCompilerMessage(enumValueName = "ON_CLASS", code = "001", message = "TEST 1")
9 | @DeclareCompilerMessage(enumValueName = "ON_CLASS_WO_CODE", message = "TEST 6")
10 | public class TestClass {
11 |
12 |
13 |
14 | @DeclareCompilerMessage(enumValueName = "ON_METHOD", code = "002", message = "TEST 2")
15 | private void aMethod() {
16 |
17 | }
18 |
19 | @DeclareCompilerMessage(enumValueName = "ON_NESTED_CLASS", code = "003", message = "TEST 3")
20 | static class NestedClass {
21 |
22 |
23 | @DeclareCompilerMessage(enumValueName = "ON_NESTED_CLASS_METHOD", code = "004", message = "TEST 4")
24 | private void anotherMethod() {
25 |
26 | }
27 |
28 | }
29 |
30 |
31 | }
--------------------------------------------------------------------------------
/config/findbugs-excludes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/cute/src/main/java/io/toolisticon/aptk/cute/APTKUnitTestProcessor.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.cute;
2 |
3 | import io.toolisticon.aptk.common.ToolingProvider;
4 | import io.toolisticon.cute.UnitTest;
5 |
6 | import javax.annotation.processing.ProcessingEnvironment;
7 | import javax.lang.model.element.Element;
8 |
9 | /**
10 | * Convenient unit test processor for unit testing code based on APTK with toolisticon's cute framework.
11 | */
12 | public abstract class APTKUnitTestProcessor implements UnitTest {
13 |
14 | /**
15 | * The original unit test processor method. Contains logic to initialize the ToolingProvider.
16 | * Will be called by cute framework. Propagates call to aptkUnitTest method after initializations.
17 | *
18 | * @param processingEnvironment the processing environment
19 | * @param element the passed in element
20 | */
21 | @Override
22 | public final void unitTest(ProcessingEnvironment processingEnvironment, ELEMENT_TYPE element) {
23 |
24 | try {
25 | // do initializations
26 | ToolingProvider.setTooling(processingEnvironment);
27 |
28 | // propagate to unit test implementation
29 | this.aptkUnitTest(processingEnvironment, element);
30 |
31 | } finally {
32 | ToolingProvider.clearTooling();
33 | }
34 |
35 | }
36 |
37 | /**
38 | * The unit test method.
39 | *
40 | * @param processingEnvironment the processingEnvironment
41 | * @param typeElement the element the underlying annotation processor is applied on
42 | */
43 | public abstract void aptkUnitTest(ProcessingEnvironment processingEnvironment, ELEMENT_TYPE typeElement);
44 | }
45 |
--------------------------------------------------------------------------------
/cute/src/main/java/io/toolisticon/aptk/cute/APTKUnitTestProcessorWithoutPassIn.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.cute;
2 |
3 | import io.toolisticon.aptk.common.ToolingProvider;
4 | import io.toolisticon.cute.UnitTestWithoutPassIn;
5 |
6 | import javax.annotation.processing.ProcessingEnvironment;
7 |
8 | public abstract class APTKUnitTestProcessorWithoutPassIn implements UnitTestWithoutPassIn {
9 |
10 | /**
11 | * The original unit test processor method. Contains logic to initialize the ToolingProvider.
12 | * Will be called by cute framework. Propagates call to aptkUnitTest method after initializations.
13 | *
14 | * @param processingEnvironment the processing environment
15 | */
16 | @Override
17 | public final void unitTest(ProcessingEnvironment processingEnvironment) {
18 |
19 | try {
20 | // do initializations
21 | ToolingProvider.setTooling(processingEnvironment);
22 |
23 | // propagate to unit test implementation
24 | this.aptkUnitTest(processingEnvironment);
25 |
26 | } finally {
27 | ToolingProvider.clearTooling();
28 | }
29 |
30 | }
31 |
32 | /**
33 | * The unit test method.
34 | *
35 | * @param processingEnvironment the processingEnvironment
36 | */
37 | public abstract void aptkUnitTest(ProcessingEnvironment processingEnvironment);
38 | }
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # Annotation-Processor-Toolkit Example
2 |
3 | This example demonstrates how annotation processors can be build using the annotation-processor-toolkit and how they can be used.
4 |
5 | The example consists of 3 parts:
6 |
7 | - module that contains the annotations : [example-annotations/](example-annotations/)
8 | - module of the annotation processor : [example-annotationprocessor](example-annotationprocessor/)
9 | - An usecase that demonstrates the usage of the annotation processor : [example-usecase](example-usecase/)
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/example/example-annotationprocessor/src/test/resources/testcases/implementsSpecificInterfaceCheckAnnotationProcessor/InvalidUsageTest.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.example.annotationprocessor;
2 |
3 | import io.toolisticon.aptk.example.annotations.ImplementsSpecificInterfaceCheckAnnotation;
4 |
5 | @ImplementsSpecificInterfaceCheckAnnotation
6 | public class InvalidUsageTest {
7 |
8 |
9 | }
--------------------------------------------------------------------------------
/example/example-annotationprocessor/src/test/resources/testcases/implementsSpecificInterfaceCheckAnnotationProcessor/ValidUsageTest.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.example.annotationprocessor;
2 |
3 | import io.toolisticon.aptk.example.annotations.ImplementsSpecificInterfaceCheckAnnotation;
4 | import io.toolisticon.aptk.example.annotations.SpecificInterface;
5 |
6 | @ImplementsSpecificInterfaceCheckAnnotation
7 | public class ValidUsageTest implements SpecificInterface{
8 |
9 |
10 | public String testMethod() {
11 | return null;
12 | }
13 |
14 | }
--------------------------------------------------------------------------------
/example/example-annotationprocessor/src/test/resources/testcases/implementsSpecificInterfaceCheckAnnotationProcessor/ValidUsageTestExtendsCase.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.example.annotationprocessor;
2 |
3 | import io.toolisticon.aptk.example.annotations.ImplementsSpecificInterfaceCheckAnnotation;
4 | import io.toolisticon.aptk.example.annotations.SpecificInterface;
5 |
6 |
7 | public class ValidUsageTestExtendsCase {
8 |
9 | public static class SuperClass implements SpecificInterface {
10 |
11 | public String testMethod() {
12 | return null;
13 | }
14 |
15 | }
16 |
17 |
18 | @ImplementsSpecificInterfaceCheckAnnotation
19 | public static class SubClass extends SuperClass {
20 |
21 | }
22 |
23 | }
--------------------------------------------------------------------------------
/example/example-annotationprocessor/src/test/resources/testcases/methodWithOneStringParameterAndVoidReturn/InvalidUsageNonStringParameter.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.example.annotationprocessor;
2 |
3 | import io.toolisticon.aptk.example.annotations.MethodWithOneStringParameterAndVoidReturnTypeAnnotation;
4 |
5 | public class InvalidUsageNonStringParameter {
6 |
7 | @MethodWithOneStringParameterAndVoidReturnTypeAnnotation
8 | public void test(Object x) {
9 | }
10 |
11 | }
--------------------------------------------------------------------------------
/example/example-annotationprocessor/src/test/resources/testcases/methodWithOneStringParameterAndVoidReturn/InvalidUsageNonVoidReturnType.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.example.annotationprocessor;
2 |
3 | import io.toolisticon.aptk.example.annotations.MethodWithOneStringParameterAndVoidReturnTypeAnnotation;
4 |
5 | public class InvalidUsageNonVoidReturnType {
6 |
7 | @MethodWithOneStringParameterAndVoidReturnTypeAnnotation
8 | public String test(String x) {
9 | return "XXX";
10 | }
11 |
12 | }
--------------------------------------------------------------------------------
/example/example-annotationprocessor/src/test/resources/testcases/methodWithOneStringParameterAndVoidReturn/ValidUsageTest.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.example.annotationprocessor;
2 |
3 | import io.toolisticon.aptk.example.annotations.MethodWithOneStringParameterAndVoidReturnTypeAnnotation;
4 |
5 | public class ValidUsageTest {
6 |
7 | @MethodWithOneStringParameterAndVoidReturnTypeAnnotation
8 | public void test(String x) {
9 |
10 | }
11 |
12 | }
--------------------------------------------------------------------------------
/example/example-annotations/README.md:
--------------------------------------------------------------------------------
1 | # Annotation-Processor-Toolkit Example Annotations
2 |
3 | This module contains some example annotation which are processed by the [example annotation processor](../example-annotationprocessor).
4 |
5 | ## Annotations
6 | ### MethodWithOneStringParameterAndVoidReturnTypeAnnotation
7 | This annotation must be used on methods which must have exactly one parameter of type String and a void return type.
8 |
9 | ### TypeThatIsAssignableToInterfaceAnnotation
10 | This annotation must be used on type which must implement the _SomeInterface_ interface
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/example/example-annotations/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 | aptk-example-annotations
5 | jar
6 |
7 |
8 | io.toolisticon.aptk
9 | aptk-example-parent
10 | 0.30.3-SNAPSHOT
11 |
12 |
13 | aptk-example-annotations
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/example/example-annotations/src/main/java/io/toolisticon/aptk/example/annotations/ImplementsSpecificInterfaceCheckAnnotation.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.example.annotations;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * Test annotation for annotating classes that must implement a the {@link SpecificInterface} interface.
10 | */
11 | @Retention(RetentionPolicy.RUNTIME)
12 | @Target(ElementType.TYPE)
13 | public @interface ImplementsSpecificInterfaceCheckAnnotation {
14 | }
15 |
--------------------------------------------------------------------------------
/example/example-annotations/src/main/java/io/toolisticon/aptk/example/annotations/MethodWithOneStringParameterAndVoidReturnTypeAnnotation.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.example.annotations;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * Test annotation for annotating methods that must have exactly one Parameter of type String and a void return type.
10 | */
11 | @Retention(value = RetentionPolicy.RUNTIME)
12 | @Target(value = ElementType.METHOD)
13 | public @interface MethodWithOneStringParameterAndVoidReturnTypeAnnotation {
14 | }
15 |
--------------------------------------------------------------------------------
/example/example-annotations/src/main/java/io/toolisticon/aptk/example/annotations/SpecificInterface.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.example.annotations;
2 |
3 |
4 | public interface SpecificInterface {
5 | String testMethod();
6 | }
7 |
--------------------------------------------------------------------------------
/example/example-usecase/.gitignore:
--------------------------------------------------------------------------------
1 | /.apt_generated_tests/
2 |
--------------------------------------------------------------------------------
/example/example-usecase/README.md:
--------------------------------------------------------------------------------
1 | # Annotation-Processor-Toolkit Example Usecase
2 |
3 | This example usecase demonstrates how the annotation processor can be used.
4 |
5 | Feel free to play around a bit and to change the example usecase into invalid usage of the annotations.
6 | Afterwards build everything with:
7 |
8 | mvn clean install
9 |
10 | In this case of broken constraints compiling of the example should result into a compile error.
11 |
12 | This will be shown both on console and even in your IDE.
13 |
14 |
--------------------------------------------------------------------------------
/example/example-usecase/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 | aptk-example-usecase
5 | jar
6 |
7 |
8 | io.toolisticon.aptk
9 | aptk-example-parent
10 | 0.30.3-SNAPSHOT
11 |
12 |
13 | aptk-example-usecase
14 |
15 |
16 |
17 |
18 |
19 | io.toolisticon.aptk
20 | aptk-example-annotations
21 |
22 |
23 |
24 | io.toolisticon.aptk
25 | aptk-example-annotationprocessor
26 | provided
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/example/example-usecase/src/main/java/io/toolisticon/aptk/example/usecase/TestClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.example.usecase;
2 |
3 | import io.toolisticon.aptk.example.annotations.MethodWithOneStringParameterAndVoidReturnTypeAnnotation;
4 | import io.toolisticon.aptk.example.annotations.SpecificInterface;
5 | import io.toolisticon.aptk.example.annotations.ImplementsSpecificInterfaceCheckAnnotation;
6 |
7 | /**
8 | * Test class to show that the annotation processors are working correctly.
9 | */
10 |
11 |
12 | @ImplementsSpecificInterfaceCheckAnnotation
13 | public class TestClass implements SpecificInterface {
14 |
15 | @MethodWithOneStringParameterAndVoidReturnTypeAnnotation
16 | public void testMethod(String a) {
17 |
18 | }
19 |
20 | @Override
21 | public String testMethod() {
22 | return null;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/idea_aptk_codestyle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/integrationtest/java16/src/main/java/io/toolisticon/aptk/integrationtest/java16/DummyClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.integrationtest.java16;
2 |
3 | /**
4 | * Dummy Class for fixing build.
5 | */
6 | public class DummyClass {
7 | }
8 |
--------------------------------------------------------------------------------
/integrationtest/java16/src/main/java/io/toolisticon/aptk/integrationtest/java16/package-info.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.integrationtest.java16;
--------------------------------------------------------------------------------
/integrationtest/java17/src/main/java/io/toolisticon/aptk/integrationtest/java17/DummyClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.integrationtest.java17;
2 |
3 | /**
4 | * Dummy Class for fixing build.
5 | */
6 | public class DummyClass {
7 | }
8 |
--------------------------------------------------------------------------------
/integrationtest/java17/src/main/java/io/toolisticon/aptk/integrationtest/java17/package-info.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.integrationtest.java17;
--------------------------------------------------------------------------------
/integrationtest/java9/src/main/java/io/toolisticon/aptk/integrationtest/java9/DummyClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.integrationtest.java9;
2 |
3 | /**
4 | * Dummy Class for fixing build.
5 | */
6 | public class DummyClass {
7 | }
8 |
--------------------------------------------------------------------------------
/integrationtest/java9/src/main/java/io/toolisticon/aptk/integrationtest/java9/package-info.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.integrationtest.java9;
--------------------------------------------------------------------------------
/integrationtest/java9/src/test/resources/testcases/namedModule/MyProcessor.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.example.regularmodule;
2 |
3 | import javax.annotation.processing.AbstractProcessor;
4 | import javax.annotation.processing.RoundEnvironment;
5 | import javax.lang.model.element.TypeElement;
6 | import java.util.Set;
7 |
8 | public class MyProcessor extends AbstractProcessor {
9 |
10 |
11 | @Override
12 | public boolean process(Set extends TypeElement> annotations, RoundEnvironment roundEnv) {
13 | return false;
14 | }
15 | }
--------------------------------------------------------------------------------
/integrationtest/java9/src/test/resources/testcases/namedModule/TestClass.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.example.regularmodule;
2 |
3 | import io.toolisticon.cute.PassIn;
4 |
5 | @PassIn
6 | public class TestClass{
7 |
8 | }
--------------------------------------------------------------------------------
/integrationtest/java9/src/test/resources/testcases/namedModule/module-info.java:
--------------------------------------------------------------------------------
1 | import javax.annotation.processing.Processor;
2 |
3 | module io.toolisticon.aptk.example {
4 |
5 | exports io.toolisticon.aptk.example.regularmodule to cute;
6 | requires transitive cute;
7 | requires static jdk.compiler;
8 | uses Processor;
9 | opens io.toolisticon.aptk.example.regularmodule to cute;
10 | provides Processor with io.toolisticon.aptk.example.regularmodule.MyProcessor;
11 |
12 | }
--------------------------------------------------------------------------------
/templating/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 | aptk-templating
5 | jar
6 |
7 |
8 | io.toolisticon.aptk
9 | aptk-parent
10 | 0.30.3-SNAPSHOT
11 |
12 |
13 | aptk-templating
14 |
15 |
16 |
17 |
18 |
19 |
20 | maven-compiler-plugin
21 |
22 | true
23 | ${java.compile.source.version}
24 | ${java.compile.target.version}
25 | none
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/templating/src/main/java/io/toolisticon/aptk/templating/NextDetectedBlockResult.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.templating;
2 |
3 | import io.toolisticon.aptk.templating.templateblocks.TemplateBlockType;
4 |
5 | /**
6 | * Used by {@link TemplateBlockType} to return next detected block.
7 | */
8 | public class NextDetectedBlockResult {
9 |
10 | private final TemplateBlockType templateBlockType;
11 | private final int beginIndex;
12 | private final int endIndex;
13 | private final String attributes;
14 | private final String content;
15 | private final String remainingStringToBeProcessed;
16 |
17 | public NextDetectedBlockResult(
18 | TemplateBlockType templateBlockType,
19 | int beginIndex,
20 | int endIndex,
21 | String attributes,
22 | String content,
23 | String remainingStringToBeProcessed) {
24 | this.templateBlockType = templateBlockType;
25 | this.beginIndex = beginIndex;
26 | this.endIndex = endIndex;
27 | this.attributes = attributes;
28 | this.content = content;
29 | this.remainingStringToBeProcessed = remainingStringToBeProcessed;
30 | }
31 |
32 | public TemplateBlockType getTemplateBlockType() {
33 | return templateBlockType;
34 | }
35 |
36 | public int getBeginIndex() {
37 | return beginIndex;
38 | }
39 |
40 | public int getEndIndex() {
41 | return endIndex;
42 | }
43 |
44 | public String getAttributes() {
45 | return attributes;
46 | }
47 |
48 | public String getContent() {
49 | return content;
50 | }
51 |
52 | public String getRemainingStringToBeProcessed() {
53 | return this.remainingStringToBeProcessed;
54 | }
55 |
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/templating/src/main/java/io/toolisticon/aptk/templating/TemplateProcessor.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.templating;
2 |
3 | import io.toolisticon.aptk.templating.templateblocks.TemplateBlockBinder;
4 |
5 | import java.util.Map;
6 |
7 | /**
8 | * Base class for parsing templates.
9 | */
10 | public class TemplateProcessor {
11 |
12 |
13 | public static String processTemplate(String templateString, Map values) {
14 |
15 | TemplateBlockBinder binder = ParseUtilities.parseString(templateString);
16 | return binder.getContent(values);
17 |
18 | }
19 |
20 | public static String processTemplateResourceFile(String templateFileName, Map values) {
21 |
22 | String templateString = null;
23 | try {
24 | templateString = ParseUtilities.readResourceToString(templateFileName);
25 | } catch (Exception e) {
26 | throw new IllegalArgumentException("Cannot open template file '" + templateFileName + "'", e);
27 | }
28 |
29 | return processTemplate(templateString, values);
30 | }
31 |
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/templating/src/main/java/io/toolisticon/aptk/templating/exceptions/InvalidElseIfException.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.templating.exceptions;
2 |
3 | /**
4 | * Exception that is thrown if an if control block has multiple else cases.
5 | */
6 | public class InvalidElseIfException extends RuntimeException {
7 |
8 | public InvalidElseIfException(String message) {
9 | super(message);
10 | }
11 |
12 | public InvalidElseIfException(String message, Throwable e) {
13 | super(message, e);
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/templating/src/main/java/io/toolisticon/aptk/templating/exceptions/InvalidExpressionResult.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.templating.exceptions;
2 |
3 | /**
4 | * Exception is thrown if the result of an expression has an unexpected type.
5 | */
6 | public class InvalidExpressionResult extends RuntimeException {
7 |
8 | public InvalidExpressionResult(String message) {
9 | super(message);
10 | }
11 |
12 | public InvalidExpressionResult(String message, Throwable e) {
13 | super(message,e);
14 | }
15 |
16 | }
--------------------------------------------------------------------------------
/templating/src/main/java/io/toolisticon/aptk/templating/exceptions/InvalidIncludeModelExpression.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.templating.exceptions;
2 |
3 | /**
4 | * Exception is thrown if a statement to setup the model in include command is incorrect.
5 | */
6 | public class InvalidIncludeModelExpression extends RuntimeException{
7 |
8 | public InvalidIncludeModelExpression(String message) {
9 | super(message);
10 | }
11 |
12 | public InvalidIncludeModelExpression(String message, Throwable e) {
13 | super(message,e);
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/templating/src/main/java/io/toolisticon/aptk/templating/exceptions/InvalidPathException.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.templating.exceptions;
2 |
3 | /**
4 | * Exception that is thrown if a path seems to be invalid.
5 | *
6 | * This may occur if a path token is applied on a primitive or array.
7 | */
8 | public class InvalidPathException extends RuntimeException {
9 |
10 | public InvalidPathException(String message) {
11 | super(message);
12 | }
13 |
14 | public InvalidPathException(String message, Throwable e) {
15 | super(message, e);
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/templating/src/main/java/io/toolisticon/aptk/templating/exceptions/MissingClosingTagException.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.templating.exceptions;
2 |
3 | /**
4 | * Exception that is thrown if a control block seems not to be properly ended.
5 | */
6 | public class MissingClosingTagException extends RuntimeException {
7 |
8 | public MissingClosingTagException(String message) {
9 | super(message);
10 | }
11 |
12 | public MissingClosingTagException(String message, Throwable e) {
13 | super(message, e);
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/templating/src/main/java/io/toolisticon/aptk/templating/expressions/AbstractSearchResult.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.templating.expressions;
2 |
3 | /**
4 | * Abstract search result for parsing of expressions.
5 | */
6 | public abstract class AbstractSearchResult {
7 |
8 |
9 | private final int startIndex;
10 | private final int endIndex;
11 | private final T value;
12 |
13 | public AbstractSearchResult(T value, int startIndex, int endIndex ) {
14 | this.startIndex = startIndex;
15 | this.endIndex = endIndex;
16 | this.value = value;
17 | }
18 |
19 | public int getStartIndex() {
20 | return startIndex;
21 | }
22 |
23 | public int getEndIndex() {
24 | return endIndex;
25 | }
26 |
27 | public T getValue() {
28 | return value;
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/templating/src/main/java/io/toolisticon/aptk/templating/expressions/operands/BooleanOperand.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.templating.expressions.operands;
2 |
3 | /**
4 | * Boolean based operand.
5 | * Uses Boolean.valueOf to determine value of passed expression string.
6 | */
7 | public class BooleanOperand extends ParsedOperand {
8 |
9 | public BooleanOperand(String expressionString) {
10 | super(expressionString);
11 | }
12 |
13 |
14 | @Override
15 | public Class getOperandsJavaType() {
16 | return Boolean.class;
17 | }
18 |
19 | @Override
20 | public Boolean value() {
21 | return Boolean.valueOf(getExpressionString());
22 | }
23 |
24 | @Override
25 | public OperandType getOperandType() {
26 | return OperandType.BOOLEAN;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/templating/src/main/java/io/toolisticon/aptk/templating/expressions/operands/DoubleOperand.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.templating.expressions.operands;
2 |
3 |
4 | /**
5 | * Floating point based operand.
6 | *
7 | * Uses Double.valueOf to get value from expression.
8 | */
9 | public class DoubleOperand extends ParsedOperand {
10 |
11 | public DoubleOperand( String expressionString) {
12 | super( expressionString);
13 |
14 | }
15 |
16 | @Override
17 | public Class getOperandsJavaType() {
18 | return Double.class;
19 | }
20 |
21 | @Override
22 | public Double value() {
23 | return Double.valueOf(getExpressionString());
24 | }
25 |
26 | @Override
27 | public OperandType getOperandType() {
28 | return OperandType.DOUBLE;
29 | }
30 | }
--------------------------------------------------------------------------------
/templating/src/main/java/io/toolisticon/aptk/templating/expressions/operands/DynamicOperand.java:
--------------------------------------------------------------------------------
1 | package io.toolisticon.aptk.templating.expressions.operands;
2 |
3 | import io.toolisticon.aptk.templating.ModelPathResolver;
4 |
5 |
6 | /**
7 | * Dynamic operand queried from models.
8 | */
9 | public class DynamicOperand extends ParsedOperand