Skip to content

Commit 22fdd10

Browse files
committed
add documentation for @priority
1 parent cc133b0 commit 22fdd10

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,26 @@ override: true
292292
# OVERRIDE is set to true.
293293
```
294294

295+
#### @Priority
296+
297+
Used to set the position / order of a node instead of
298+
using the position of the static member in the class.
299+
300+
Nodes have a priority of `Integer.MAX_VALUE` by default.
301+
302+
```java
303+
@Priority(2)
304+
public static int EXAMPLE = 3;
305+
306+
@Priority(1)
307+
public static class TEST { }
308+
```
309+
310+
```yaml
311+
test: {}
312+
example: 3
313+
```
314+
295315
#### @Header & @Footer
296316

297317
- @Header is used to add a header comment to the top of a config document.
@@ -413,7 +433,7 @@ For more information about resolvers, please refer to the internal javadocs.
413433
### Limitations
414434

415435
Due to the way that class members are retrieved in java, fields are always above
416-
subclasses meaning the following is not possible.
436+
subclasses meaning the following is not possible without using @Priority.
417437

418438
<details>
419439
<summary>Expand</summary>

0 commit comments

Comments
 (0)