Skip to content

hheg/codegenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A maven plugin for generating annotations on classes, methods and fields on generated files.

Example configuration:

  <plugin>
    <groupId>codegen</groupId>
    <artifactId>codegen-maven-plugin</artifactId>
    <version>${codegen.version}</version>
    <executions>
       <execution>
          <id>annotate</id>
          <phase>generate-sources</phase>
          <goals>
             <goal>codegen</goal>
          </goals>
          <inherited>false</inherited>
          <configuration>
             <srcDirectory>${project.build.directory}/generated-sources/xjc</srcDirectory>
             <configFile>src/main/resources/annotations.json</configFile>
          </configuration>
       </execution>
    </executions>
  </plugin>

Example configuration file

{
"classes":{
	"codegen.NestedTestClass":
		{
			"classAnnotations":["@ClassAnnotation"],
			"methodAnnotations":{"method()":["@MethodAnnotation"]},
			"fieldAnnotations":{"field":["@FieldAnnotation"]}
		},
	"codegen.NestedTestClass.InternalClass":
		{
			"classAnnotations":["@ClassAnnotation"],
			"methodAnnotations":{"method()":["@MethodAnnotation"]},
			"fieldAnnotations":{"field":["@FieldAnnotation"]}
		}
	}
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages