remove ilo run command file
[yosql.git] / yosql-website / content / configuration / annotations / methodMembers.md
blob8fe6aeedc23755f21fcce4abd8937076753c0f7c
1 ---
2 title: methodMembers
3 date: 2019-09-27T18:51:08+02:00
4 menu:
5   main:
6     parent: Annotations
7 categories:
8   - Configuration
9 tags:
10   - annotations
11   - methods
12 ---
14 Controls which `@Generated` annotation members should be added to generated methods. Defaults to `WITHOUT_DATE` which uses all members except `date` in order to support reproducible builds (otherwise the generated classes would change on each generation).
16 ## Configuration Options
18 ### Option: 'WITHOUT_DATE'
20 The default value of the `methodMembers` configuration option is `WITHOUT_DATE`. Setting the option to `WITHOUT_DATE` therefore produces the same code generated as the default configuration.
22 ```java
23 package com.example.persistence;
25 import javax.annotation.processing.Generated;
27 public class SomeRepository {
29     @Generated(
30         value = "YoSQL",
31         comments = "DO NOT MODIFY - automatically generated by YoSQL"
32     )
33     public void someMethod() {
34       // ... some code    
35     }
37     // ... rest of generated code
40 ```
42 ### Option: 'ALL'
44 Changing the `methodMembers` configuration option to `ALL` outputs all annotation members.
46 ```java
47 package com.example.persistence;
49 import javax.annotation.processing.Generated;
51 public class SomeRepository {
53     @Generated(
54         value = "YoSQL",
55         date = "<current_timestamp>",
56         comments = "DO NOT MODIFY - automatically generated by YoSQL"
57     )
58     public void someMethod() {
59         // ... some code    
60     }
62      // ... rest of generated code (same as above)
65 ```
67 ### Option: 'NONE'
69 Changing the `methodMembers` configuration option to `NONE` outputs no annotation members.
71 ```java
72 package com.example.persistence;
74 import javax.annotation.processing.Generated;
76 public class SomeRepository {
78     @Generated
79     public void someMethod() {
80         // ... some code    
81     }
83     // ... rest of generated code (same as above)
86 ```
88 ### Option: 'VALUE'
90 Changing the `methodMembers` configuration option to `VALUE` outputs only the `value` member.
92 ```java
93 package com.example.persistence;
95 import javax.annotation.processing.Generated;
97 public class SomeRepository {
99     @Generated(
100         value = "YoSQL"
101     )
102     public void someMethod() {
103       // ... some code    
104     }
105   
106     // ... rest of generated code (same as above)
111 ### Option: 'DATE'
113 Changing the `methodMembers` configuration option to `DATE` outputs only the `date` member.
115 ```java
116 package com.example.persistence;
118 import javax.annotation.processing.Generated;
120 public class SomeRepository {
122     @Generated(
123         date = "<current_timestamp>"
124     )
125     public void someMethod() {
126         // ... some code    
127     }
128   
129     // ... rest of generated code (same as above)
134 ### Option: 'COMMENT'
136 Changing the `methodMembers` configuration option to `COMMENT` outputs only the `comment` member.
138 ```java
139 package com.example.persistence;
141 import javax.annotation.processing.Generated;
143 public class SomeRepository {
145     @Generated(
146         comments = "DO NOT MODIFY - automatically generated by YoSQL"
147     )
148     public void someMethod() {
149         // ... some code    
150     }
152     // ... rest of generated code (same as above)
157 ## Related Options
159 - [annotateMethods](../annotatemethods/): Controls whether the `@Generated` annotation should be added at all.
160 - [methodComment](../methodcomment/): Controls the comment used in the `@Generated` annotation.
161 - [generatorName](../generatorname/): Controls the value used in the `@Generated` annotation.
163 ## Tooling
165 ### Maven
167 In order to use `YoSQL` together with [Maven](https://maven.apache.org/), take a look at the tooling [documentation
168 for Maven](/tooling/maven/).
170 {{< maven/config/annotations/methodMembers >}}
172 ### Gradle
174 In order to use `YoSQL` together with [Gradle](https://gradle.org/), take a look at the tooling [documentation for Gradle](/tooling/gradle/).
176 ```groovy
177 plugins {
178   id("wtf.metio.yosql")
181 yosql {
182   annotations {
183     methodMembers = ALL
184   }
188 ### Bazel
190 In order to use `YoSQL` together with [Bazel](https://bazel.build/), take a look at the tooling [documentation for
191 Bazel](/tooling/bazel/).
193 ### CLI
195 In order to use YoSQL on the command line, take a look at the tooling [documentation for CLI](/tooling/cli/).
197 ```shell
198 $ yosql --annotations-method-members=ALL
201 The shorter form is available as well:
203 ```shell
204 $ yosql --method-members=ALL