From 2d1db7728a52dd245fa0902f9a47ca9fc2f7abb4 Mon Sep 17 00:00:00 2001 From: "Dmitriy.Panov" Date: Thu, 8 Oct 2020 02:15:30 +0300 Subject: [PATCH] IJI-460 code generated previously by Gradle tasks is now committed into vcs (MIT license) GitOrigin-RevId: b5052b9eaae638736f774784603ad6f4864db938 --- .../lombok/core/handlers/singulars.txt | 56 ++ .../plugin/language/LombokConfigLexer.java | 558 ++++++++++++++++++ .../language/parser/LombokConfigParser.java | 108 ++++ .../language/psi/LombokConfigCleaner.java | 14 + .../language/psi/LombokConfigOperation.java | 10 + .../language/psi/LombokConfigProperty.java | 21 + .../language/psi/LombokConfigTypes.java | 38 ++ .../language/psi/LombokConfigVisitor.java | 26 + .../psi/impl/LombokConfigCleanerImpl.java | 29 + .../psi/impl/LombokConfigOperationImpl.java | 29 + .../psi/impl/LombokConfigPropertyImpl.java | 35 ++ .../generated/src/lombok/AccessLevel.java | 31 + .../src/lombok/AllArgsConstructor.java | 81 +++ .../lombok/generated/src/lombok/Builder.java | 201 +++++++ .../lombok/generated/src/lombok/Cleanup.java | 77 +++ .../generated/src/lombok/CustomLog.java | 75 +++ plugins/lombok/generated/src/lombok/Data.java | 61 ++ .../lombok/generated/src/lombok/Delegate.java | 56 ++ .../src/lombok/EqualsAndHashCode.java | 126 ++++ .../lombok/generated/src/lombok/Getter.java | 84 +++ .../src/lombok/NoArgsConstructor.java | 90 +++ .../lombok/generated/src/lombok/NonNull.java | 39 ++ .../src/lombok/RequiredArgsConstructor.java | 80 +++ .../lombok/generated/src/lombok/Setter.java | 95 +++ .../lombok/generated/src/lombok/Singular.java | 41 ++ .../generated/src/lombok/SneakyThrows.java | 67 +++ .../generated/src/lombok/Synchronized.java | 50 ++ .../lombok/generated/src/lombok/ToString.java | 122 ++++ .../lombok/generated/src/lombok/Value.java | 60 ++ plugins/lombok/generated/src/lombok/With.java | 94 +++ .../src/lombok/core/handlers/Singulars.java | 86 +++ .../src/lombok/experimental/Accessors.java | 66 +++ .../src/lombok/experimental/Delegate.java | 68 +++ .../lombok/experimental/ExtensionMethod.java | 73 +++ .../lombok/experimental/FieldDefaults.java | 46 ++ .../experimental/FieldNameConstants.java | 62 ++ .../src/lombok/experimental/Helper.java | 35 ++ .../src/lombok/experimental/NonFinal.java | 35 ++ .../lombok/experimental/PackagePrivate.java | 35 ++ .../src/lombok/experimental/SuperBuilder.java | 65 ++ .../src/lombok/experimental/Tolerate.java | 36 ++ .../src/lombok/experimental/UtilityClass.java | 43 ++ .../src/lombok/experimental/Wither.java | 98 +++ .../src/lombok/experimental/package-info.java | 33 ++ .../src/lombok/experimental/var.java | 31 + .../extern/apachecommons/CommonsLog.java | 67 +++ .../src/lombok/extern/flogger/Flogger.java | 63 ++ .../generated/src/lombok/extern/java/Log.java | 66 +++ .../src/lombok/extern/jbosslog/JBossLog.java | 66 +++ .../src/lombok/extern/log4j/Log4j.java | 67 +++ .../src/lombok/extern/log4j/Log4j2.java | 67 +++ .../src/lombok/extern/slf4j/Slf4j.java | 67 +++ .../src/lombok/extern/slf4j/XSlf4j.java | 66 +++ plugins/lombok/generated/src/lombok/val.java | 34 ++ plugins/lombok/generated/src/lombok/var.java | 35 ++ 55 files changed, 3864 insertions(+) create mode 100644 plugins/lombok/generated/resources/lombok/core/handlers/singulars.txt create mode 100644 plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/LombokConfigLexer.java create mode 100644 plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/parser/LombokConfigParser.java create mode 100644 plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/LombokConfigCleaner.java create mode 100644 plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/LombokConfigOperation.java create mode 100644 plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/LombokConfigProperty.java create mode 100644 plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/LombokConfigTypes.java create mode 100644 plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/LombokConfigVisitor.java create mode 100644 plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/impl/LombokConfigCleanerImpl.java create mode 100644 plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/impl/LombokConfigOperationImpl.java create mode 100644 plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/impl/LombokConfigPropertyImpl.java create mode 100644 plugins/lombok/generated/src/lombok/AccessLevel.java create mode 100644 plugins/lombok/generated/src/lombok/AllArgsConstructor.java create mode 100644 plugins/lombok/generated/src/lombok/Builder.java create mode 100644 plugins/lombok/generated/src/lombok/Cleanup.java create mode 100644 plugins/lombok/generated/src/lombok/CustomLog.java create mode 100644 plugins/lombok/generated/src/lombok/Data.java create mode 100644 plugins/lombok/generated/src/lombok/Delegate.java create mode 100644 plugins/lombok/generated/src/lombok/EqualsAndHashCode.java create mode 100644 plugins/lombok/generated/src/lombok/Getter.java create mode 100644 plugins/lombok/generated/src/lombok/NoArgsConstructor.java create mode 100644 plugins/lombok/generated/src/lombok/NonNull.java create mode 100644 plugins/lombok/generated/src/lombok/RequiredArgsConstructor.java create mode 100644 plugins/lombok/generated/src/lombok/Setter.java create mode 100644 plugins/lombok/generated/src/lombok/Singular.java create mode 100644 plugins/lombok/generated/src/lombok/SneakyThrows.java create mode 100644 plugins/lombok/generated/src/lombok/Synchronized.java create mode 100644 plugins/lombok/generated/src/lombok/ToString.java create mode 100644 plugins/lombok/generated/src/lombok/Value.java create mode 100644 plugins/lombok/generated/src/lombok/With.java create mode 100644 plugins/lombok/generated/src/lombok/core/handlers/Singulars.java create mode 100644 plugins/lombok/generated/src/lombok/experimental/Accessors.java create mode 100644 plugins/lombok/generated/src/lombok/experimental/Delegate.java create mode 100644 plugins/lombok/generated/src/lombok/experimental/ExtensionMethod.java create mode 100644 plugins/lombok/generated/src/lombok/experimental/FieldDefaults.java create mode 100644 plugins/lombok/generated/src/lombok/experimental/FieldNameConstants.java create mode 100644 plugins/lombok/generated/src/lombok/experimental/Helper.java create mode 100644 plugins/lombok/generated/src/lombok/experimental/NonFinal.java create mode 100644 plugins/lombok/generated/src/lombok/experimental/PackagePrivate.java create mode 100644 plugins/lombok/generated/src/lombok/experimental/SuperBuilder.java create mode 100644 plugins/lombok/generated/src/lombok/experimental/Tolerate.java create mode 100644 plugins/lombok/generated/src/lombok/experimental/UtilityClass.java create mode 100644 plugins/lombok/generated/src/lombok/experimental/Wither.java create mode 100644 plugins/lombok/generated/src/lombok/experimental/package-info.java create mode 100644 plugins/lombok/generated/src/lombok/experimental/var.java create mode 100644 plugins/lombok/generated/src/lombok/extern/apachecommons/CommonsLog.java create mode 100644 plugins/lombok/generated/src/lombok/extern/flogger/Flogger.java create mode 100644 plugins/lombok/generated/src/lombok/extern/java/Log.java create mode 100644 plugins/lombok/generated/src/lombok/extern/jbosslog/JBossLog.java create mode 100644 plugins/lombok/generated/src/lombok/extern/log4j/Log4j.java create mode 100644 plugins/lombok/generated/src/lombok/extern/log4j/Log4j2.java create mode 100644 plugins/lombok/generated/src/lombok/extern/slf4j/Slf4j.java create mode 100644 plugins/lombok/generated/src/lombok/extern/slf4j/XSlf4j.java create mode 100644 plugins/lombok/generated/src/lombok/val.java create mode 100644 plugins/lombok/generated/src/lombok/var.java diff --git a/plugins/lombok/generated/resources/lombok/core/handlers/singulars.txt b/plugins/lombok/generated/resources/lombok/core/handlers/singulars.txt new file mode 100644 index 000000000000..d77308cb3813 --- /dev/null +++ b/plugins/lombok/generated/resources/lombok/core/handlers/singulars.txt @@ -0,0 +1,56 @@ +#Based on https://github.com/rails/rails/blob/efff6c1fd4b9e2e4c9f705a45879373cb34a5b0e/activesupport/lib/active_support/inflections.rb + +quizzes = quiz +matrices = matrix +indices = index +vertices = vertex +statuses = status +aliases = alias +alias = ! +species = ! +Axes = ! +-axes = axe +sexes = sex +Testes = testis +movies = movie +octopodes = octopus +buses = bus +Mice = mouse +Lice = louse +News = ! +# We could add more detail (axemen, boatsmen, boogymen, cavemen, gentlemen, etc, but (A) there's stuff like 'cerumen', and (B) the 'men' ending is common in singulars and other languages.) +# Therefore, the odds of a mistake are too high, so other than these 2 well known cases, force the explicit singular. +Men = man +Women = woman +minutiae = minutia +shoes = shoe +synopses = synopsis +prognoses = prognosis +theses = thesis +diagnoses = diagnosis +bases = base +analyses = analysis +Crises = crisis +children = child +moves = move +zombies = zombie +-quies = quy +-us = ! +-is = ! +series = ! +-ies = y +-oes = o +hives = hive +-tives = tive +-sses = ss +-ches = ch +-xes = x +-shes = sh +-lves = lf +-rves = rf +saves = save +Leaves = leaf +-ves = ! +-ss = ! +-us = ! +-s = diff --git a/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/LombokConfigLexer.java b/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/LombokConfigLexer.java new file mode 100644 index 000000000000..902f9d80952b --- /dev/null +++ b/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/LombokConfigLexer.java @@ -0,0 +1,558 @@ +/* The following code was generated by JFlex 1.7.0-1 tweaked for IntelliJ platform */ + +package de.plushnikov.intellij.plugin.language; + +import com.intellij.lexer.FlexLexer; +import com.intellij.psi.tree.IElementType; +import com.intellij.psi.TokenType; + +import de.plushnikov.intellij.plugin.language.psi.LombokConfigTypes; + + +/** + * This class is a scanner generated by + * JFlex 1.7.0-1 + * from the specification file /Users/jetbrains/IdeaProjects/IDEA/community/plugins/lombok/src/main/resources/de/plushnikov/intellij/plugin/language/lombokConfig.flex + */ +class LombokConfigLexer implements FlexLexer { + + /** This character denotes the end of file */ + public static final int YYEOF = -1; + + /** initial size of the lookahead buffer */ + private static final int ZZ_BUFFERSIZE = 16384; + + /** lexical states */ + public static final int YYINITIAL = 0; + public static final int IN_VALUE = 2; + public static final int IN_KEY_VALUE_SEPARATOR = 4; + + /** + * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l + * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l + * at the beginning of a line + * l is of the form l = 2*k, k a non negative integer + */ + private static final int ZZ_LEXSTATE[] = { + 0, 0, 1, 1, 2, 2 + }; + + /** + * Translates characters to character classes + * Chosen bits are [9, 6, 6] + * Total runtime size is 1568 bytes + */ + public static int ZZ_CMAP(int ch) { + return ZZ_CMAP_A[(ZZ_CMAP_Y[ZZ_CMAP_Z[ch>>12]|((ch>>6)&0x3f)]<<6)|(ch&0x3f)]; + } + + /* The ZZ_CMAP_Z table has 272 entries */ + static final char ZZ_CMAP_Z[] = zzUnpackCMap( + "\1\0\1\100\1\200\u010d\100"); + + /* The ZZ_CMAP_Y table has 192 entries */ + static final char ZZ_CMAP_Y[] = zzUnpackCMap( + "\1\0\1\1\1\2\175\3\1\4\77\3"); + + /* The ZZ_CMAP_A table has 320 entries */ + static final char ZZ_CMAP_A[] = zzUnpackCMap( + "\11\0\1\3\1\1\1\14\1\15\1\2\22\0\1\3\2\0\1\4\7\0\1\17\1\0\1\17\14\0\1\12\2"+ + "\0\1\16\36\0\1\13\4\0\1\10\1\0\1\5\1\0\1\7\6\0\1\6\5\0\1\11\22\0\1\14\242"+ + "\0\2\14\26\0"); + + /** + * Translates DFA states to action switch labels. + */ + private static final int [] ZZ_ACTION = zzUnpackAction(); + + private static final String ZZ_ACTION_PACKED_0 = + "\3\0\1\1\1\2\1\3\1\1\2\4\1\5\1\6"+ + "\1\5\1\4\1\2\1\7\1\10\1\0\2\3\2\1"+ + "\1\0\1\5\2\1\1\11"; + + private static int [] zzUnpackAction() { + int [] result = new int[26]; + int offset = 0; + offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAction(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /** + * Translates a state to a row index in the transition table + */ + private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); + + private static final String ZZ_ROWMAP_PACKED_0 = + "\0\0\0\20\0\40\0\60\0\100\0\120\0\140\0\160"+ + "\0\200\0\220\0\240\0\260\0\300\0\320\0\340\0\160"+ + "\0\200\0\360\0\u0100\0\u0110\0\u0120\0\300\0\u0130\0\u0140"+ + "\0\u0150\0\60"; + + private static int [] zzUnpackRowMap() { + int [] result = new int[26]; + int offset = 0; + offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackRowMap(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int high = packed.charAt(i++) << 16; + result[j++] = high | packed.charAt(i++); + } + return j; + } + + /** + * The transition table of the DFA + */ + private static final int [] ZZ_TRANS = zzUnpackTrans(); + + private static final String ZZ_TRANS_PACKED_0 = + "\1\4\3\5\1\6\1\7\4\4\1\10\1\11\1\4"+ + "\1\5\1\10\1\4\1\12\2\13\1\14\6\12\1\10"+ + "\1\15\1\12\1\5\1\10\1\12\1\10\2\13\1\16"+ + "\10\10\1\0\1\5\1\17\1\20\1\4\3\0\6\4"+ + "\1\0\1\21\1\4\2\0\1\4\1\0\3\5\11\0"+ + "\1\5\2\0\1\6\2\0\1\22\6\6\1\22\1\23"+ + "\1\6\2\22\1\6\1\4\3\0\2\4\1\24\3\4"+ + "\1\0\1\21\1\4\2\0\1\4\20\0\2\4\1\25"+ + "\11\4\2\0\2\4\1\12\2\0\7\12\1\0\1\26"+ + "\1\12\2\0\1\12\1\0\3\13\11\0\1\13\2\0"+ + "\1\12\2\5\1\14\6\12\1\0\1\26\1\12\1\5"+ + "\1\0\3\12\1\27\11\12\2\0\2\12\1\0\2\5"+ + "\1\16\11\0\1\5\1\17\1\20\3\0\1\17\14\0"+ + "\1\22\2\0\15\22\1\6\1\4\1\25\11\6\2\22"+ + "\2\6\1\4\3\0\3\4\1\30\2\4\1\0\1\21"+ + "\1\4\2\0\3\4\2\0\6\4\1\0\1\21\1\4"+ + "\2\0\1\4\2\12\1\0\7\12\1\0\1\26\1\12"+ + "\2\0\1\12\1\4\3\0\4\4\1\31\1\4\1\0"+ + "\1\21\1\4\2\0\2\4\3\0\5\4\1\32\1\0"+ + "\1\21\1\4\2\0\1\4"; + + private static int [] zzUnpackTrans() { + int [] result = new int[352]; + int offset = 0; + offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackTrans(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + value--; + do result[j++] = value; while (--count > 0); + } + return j; + } + + + /* error codes */ + private static final int ZZ_UNKNOWN_ERROR = 0; + private static final int ZZ_NO_MATCH = 1; + private static final int ZZ_PUSHBACK_2BIG = 2; + + /* error messages for the codes above */ + private static final String[] ZZ_ERROR_MSG = { + "Unknown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; + + /** + * ZZ_ATTRIBUTE[aState] contains the attributes of state aState + */ + private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); + + private static final String ZZ_ATTRIBUTE_PACKED_0 = + "\3\0\4\1\1\11\7\1\1\11\1\0\4\1\1\0"+ + "\4\1"; + + private static int [] zzUnpackAttribute() { + int [] result = new int[26]; + int offset = 0; + offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); + return result; + } + + private static int zzUnpackAttribute(String packed, int offset, int [] result) { + int i = 0; /* index in packed string */ + int j = offset; /* index in unpacked array */ + int l = packed.length(); + while (i < l) { + int count = packed.charAt(i++); + int value = packed.charAt(i++); + do result[j++] = value; while (--count > 0); + } + return j; + } + + /** the input device */ + private java.io.Reader zzReader; + + /** the current state of the DFA */ + private int zzState; + + /** the current lexical state */ + private int zzLexicalState = YYINITIAL; + + /** this buffer contains the current text to be matched and is + the source of the yytext() string */ + private CharSequence zzBuffer = ""; + + /** the textposition at the last accepting state */ + private int zzMarkedPos; + + /** the current text position in the buffer */ + private int zzCurrentPos; + + /** startRead marks the beginning of the yytext() string in the buffer */ + private int zzStartRead; + + /** endRead marks the last character in the buffer, that has been read + from input */ + private int zzEndRead; + + /** + * zzAtBOL == true <=> the scanner is currently at the beginning of a line + */ + private boolean zzAtBOL = true; + + /** zzAtEOF == true <=> the scanner is at the EOF */ + private boolean zzAtEOF; + + /** denotes if the user-EOF-code has already been executed */ + private boolean zzEOFDone; + + + /** + * Creates a new scanner + * + * @param in the java.io.Reader to read input from. + */ + LombokConfigLexer(java.io.Reader in) { + this.zzReader = in; + } + + + /** + * Unpacks the compressed character translation table. + * + * @param packed the packed character translation table + * @return the unpacked character translation table + */ + private static char [] zzUnpackCMap(String packed) { + int size = 0; + for (int i = 0, length = packed.length(); i < length; i += 2) { + size += packed.charAt(i); + } + char[] map = new char[size]; + int i = 0; /* index in packed string */ + int j = 0; /* index in unpacked array */ + while (i < packed.length()) { + int count = packed.charAt(i++); + char value = packed.charAt(i++); + do map[j++] = value; while (--count > 0); + } + return map; + } + + public final int getTokenStart() { + return zzStartRead; + } + + public final int getTokenEnd() { + return getTokenStart() + yylength(); + } + + public void reset(CharSequence buffer, int start, int end, int initialState) { + zzBuffer = buffer; + zzCurrentPos = zzMarkedPos = zzStartRead = start; + zzAtEOF = false; + zzAtBOL = true; + zzEndRead = end; + yybegin(initialState); + } + + /** + * Refills the input buffer. + * + * @return false, iff there was new input. + * + * @exception java.io.IOException if any I/O-Error occurs + */ + private boolean zzRefill() throws java.io.IOException { + return true; + } + + + /** + * Returns the current lexical state. + */ + public final int yystate() { + return zzLexicalState; + } + + + /** + * Enters a new lexical state + * + * @param newState the new lexical state + */ + public final void yybegin(int newState) { + zzLexicalState = newState; + } + + + /** + * Returns the text matched by the current regular expression. + */ + public final CharSequence yytext() { + return zzBuffer.subSequence(zzStartRead, zzMarkedPos); + } + + + /** + * Returns the character at position pos from the + * matched text. + * + * It is equivalent to yytext().charAt(pos), but faster + * + * @param pos the position of the character to fetch. + * A value from 0 to yylength()-1. + * + * @return the character at position pos + */ + public final char yycharat(int pos) { + return zzBuffer.charAt(zzStartRead+pos); + } + + + /** + * Returns the length of the matched text region. + */ + public final int yylength() { + return zzMarkedPos-zzStartRead; + } + + + /** + * Reports an error that occured while scanning. + * + * In a wellformed scanner (no or only correct usage of + * yypushback(int) and a match-all fallback rule) this method + * will only be called with things that "Can't Possibly Happen". + * If this method is called, something is seriously wrong + * (e.g. a JFlex bug producing a faulty scanner etc.). + * + * Usual syntax/scanner level error handling should be done + * in error fallback rules. + * + * @param errorCode the code of the errormessage to display + */ + private void zzScanError(int errorCode) { + String message; + try { + message = ZZ_ERROR_MSG[errorCode]; + } + catch (ArrayIndexOutOfBoundsException e) { + message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; + } + + throw new Error(message); + } + + + /** + * Pushes the specified amount of characters back into the input stream. + * + * They will be read again by then next call of the scanning method + * + * @param number the number of characters to be read again. + * This number must not be greater than yylength()! + */ + public void yypushback(int number) { + if ( number > yylength() ) + zzScanError(ZZ_PUSHBACK_2BIG); + + zzMarkedPos -= number; + } + + + /** + * Contains user EOF-code, which will be executed exactly once, + * when the end of file is reached + */ + private void zzDoEOF() { + if (!zzEOFDone) { + zzEOFDone = true; + + } + } + + + /** + * Resumes scanning until the next regular expression is matched, + * the end of input is encountered or an I/O-Error occurs. + * + * @return the next token + * @exception java.io.IOException if any I/O-Error occurs + */ + public IElementType advance() throws java.io.IOException { + int zzInput; + int zzAction; + + // cached fields: + int zzCurrentPosL; + int zzMarkedPosL; + int zzEndReadL = zzEndRead; + CharSequence zzBufferL = zzBuffer; + + int [] zzTransL = ZZ_TRANS; + int [] zzRowMapL = ZZ_ROWMAP; + int [] zzAttrL = ZZ_ATTRIBUTE; + + while (true) { + zzMarkedPosL = zzMarkedPos; + + zzAction = -1; + + zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; + + zzState = ZZ_LEXSTATE[zzLexicalState]; + + // set up zzAction for empty match case: + int zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + } + + + zzForAction: { + while (true) { + + if (zzCurrentPosL < zzEndReadL) { + zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL/*, zzEndReadL*/); + zzCurrentPosL += Character.charCount(zzInput); + } + else if (zzAtEOF) { + zzInput = YYEOF; + break zzForAction; + } + else { + // store back cached positions + zzCurrentPos = zzCurrentPosL; + zzMarkedPos = zzMarkedPosL; + boolean eof = zzRefill(); + // get translated positions and possibly new buffer + zzCurrentPosL = zzCurrentPos; + zzMarkedPosL = zzMarkedPos; + zzBufferL = zzBuffer; + zzEndReadL = zzEndRead; + if (eof) { + zzInput = YYEOF; + break zzForAction; + } + else { + zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL/*, zzEndReadL*/); + zzCurrentPosL += Character.charCount(zzInput); + } + } + int zzNext = zzTransL[ zzRowMapL[zzState] + ZZ_CMAP(zzInput) ]; + if (zzNext == -1) break zzForAction; + zzState = zzNext; + + zzAttributes = zzAttrL[zzState]; + if ( (zzAttributes & 1) == 1 ) { + zzAction = zzState; + zzMarkedPosL = zzCurrentPosL; + if ( (zzAttributes & 8) == 8 ) break zzForAction; + } + + } + } + + // store back cached position + zzMarkedPos = zzMarkedPosL; + + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + zzDoEOF(); + return null; + } + else { + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 1: + { yybegin(IN_KEY_VALUE_SEPARATOR); return LombokConfigTypes.KEY; + } + // fall through + case 10: break; + case 2: + { return TokenType.WHITE_SPACE; + } + // fall through + case 11: break; + case 3: + { yybegin(YYINITIAL); return LombokConfigTypes.COMMENT; + } + // fall through + case 12: break; + case 4: + { return TokenType.BAD_CHARACTER; + } + // fall through + case 13: break; + case 5: + { yybegin(YYINITIAL); return LombokConfigTypes.VALUE; + } + // fall through + case 14: break; + case 6: + { yybegin(YYINITIAL); return TokenType.WHITE_SPACE; + } + // fall through + case 15: break; + case 7: + { yybegin(IN_VALUE); return LombokConfigTypes.SEPARATOR; + } + // fall through + case 16: break; + case 8: + { yybegin(IN_KEY_VALUE_SEPARATOR); return LombokConfigTypes.SIGN; + } + // fall through + case 17: break; + case 9: + { yybegin(YYINITIAL); return LombokConfigTypes.CLEAR; + } + // fall through + case 18: break; + default: + zzScanError(ZZ_NO_MATCH); + } + } + } + } + + +} diff --git a/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/parser/LombokConfigParser.java b/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/parser/LombokConfigParser.java new file mode 100644 index 000000000000..68cd59768bbe --- /dev/null +++ b/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/parser/LombokConfigParser.java @@ -0,0 +1,108 @@ +// This is a generated file. Not intended for manual editing. +package de.plushnikov.intellij.plugin.language.parser; + +import com.intellij.lang.PsiBuilder; +import com.intellij.lang.PsiBuilder.Marker; +import static de.plushnikov.intellij.plugin.language.psi.LombokConfigTypes.*; +import static com.intellij.lang.parser.GeneratedParserUtilBase.*; +import com.intellij.psi.tree.IElementType; +import com.intellij.lang.ASTNode; +import com.intellij.psi.tree.TokenSet; +import com.intellij.lang.PsiParser; +import com.intellij.lang.LightPsiParser; + +@SuppressWarnings({"SimplifiableIfStatement", "UnusedAssignment"}) +public class LombokConfigParser implements PsiParser, LightPsiParser { + + public ASTNode parse(IElementType root_, PsiBuilder builder_) { + parseLight(root_, builder_); + return builder_.getTreeBuilt(); + } + + public void parseLight(IElementType root_, PsiBuilder builder_) { + boolean result_; + builder_ = adapt_builder_(root_, builder_, this, null); + Marker marker_ = enter_section_(builder_, 0, _COLLAPSE_, null); + result_ = parse_root_(root_, builder_); + exit_section_(builder_, 0, marker_, root_, result_, true, TRUE_CONDITION); + } + + protected boolean parse_root_(IElementType root_, PsiBuilder builder_) { + return parse_root_(root_, builder_, 0); + } + + static boolean parse_root_(IElementType root_, PsiBuilder builder_, int level_) { + return simpleFile(builder_, level_ + 1); + } + + /* ********************************************************** */ + // CLEAR KEY + public static boolean cleaner(PsiBuilder builder_, int level_) { + if (!recursion_guard_(builder_, level_, "cleaner")) return false; + if (!nextTokenIs(builder_, CLEAR)) return false; + boolean result_; + Marker marker_ = enter_section_(builder_); + result_ = consumeTokens(builder_, 0, CLEAR, KEY); + exit_section_(builder_, marker_, CLEANER, result_); + return result_; + } + + /* ********************************************************** */ + // property|cleaner|COMMENT|CRLF + static boolean item_(PsiBuilder builder_, int level_) { + if (!recursion_guard_(builder_, level_, "item_")) return false; + boolean result_; + result_ = property(builder_, level_ + 1); + if (!result_) result_ = cleaner(builder_, level_ + 1); + if (!result_) result_ = consumeToken(builder_, COMMENT); + if (!result_) result_ = consumeToken(builder_, CRLF); + return result_; + } + + /* ********************************************************** */ + // SIGN? SEPARATOR + public static boolean operation(PsiBuilder builder_, int level_) { + if (!recursion_guard_(builder_, level_, "operation")) return false; + if (!nextTokenIs(builder_, "", SEPARATOR, SIGN)) return false; + boolean result_; + Marker marker_ = enter_section_(builder_, level_, _NONE_, OPERATION, ""); + result_ = operation_0(builder_, level_ + 1); + result_ = result_ && consumeToken(builder_, SEPARATOR); + exit_section_(builder_, level_, marker_, result_, false, null); + return result_; + } + + // SIGN? + private static boolean operation_0(PsiBuilder builder_, int level_) { + if (!recursion_guard_(builder_, level_, "operation_0")) return false; + consumeToken(builder_, SIGN); + return true; + } + + /* ********************************************************** */ + // KEY operation VALUE + public static boolean property(PsiBuilder builder_, int level_) { + if (!recursion_guard_(builder_, level_, "property")) return false; + if (!nextTokenIs(builder_, KEY)) return false; + boolean result_; + Marker marker_ = enter_section_(builder_); + result_ = consumeToken(builder_, KEY); + result_ = result_ && operation(builder_, level_ + 1); + result_ = result_ && consumeToken(builder_, VALUE); + exit_section_(builder_, marker_, PROPERTY, result_); + return result_; + } + + /* ********************************************************** */ + // item_* + static boolean simpleFile(PsiBuilder builder_, int level_) { + if (!recursion_guard_(builder_, level_, "simpleFile")) return false; + while (true) { + int pos_ = current_position_(builder_); + if (!item_(builder_, level_ + 1)) break; + if (!empty_element_parsed_guard_(builder_, "simpleFile", pos_)) break; + } + return true; + } + +} diff --git a/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/LombokConfigCleaner.java b/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/LombokConfigCleaner.java new file mode 100644 index 000000000000..30c8270e4481 --- /dev/null +++ b/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/LombokConfigCleaner.java @@ -0,0 +1,14 @@ +// This is a generated file. Not intended for manual editing. +package de.plushnikov.intellij.plugin.language.psi; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.psi.PsiElement; + +public interface LombokConfigCleaner extends PsiElement { + + //WARNING: getKey(...) is skipped + //matching getKey(LombokConfigCleaner, ...) + //methods are not found in LombokConfigPsiUtil + +} diff --git a/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/LombokConfigOperation.java b/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/LombokConfigOperation.java new file mode 100644 index 000000000000..5adaeab31bf1 --- /dev/null +++ b/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/LombokConfigOperation.java @@ -0,0 +1,10 @@ +// This is a generated file. Not intended for manual editing. +package de.plushnikov.intellij.plugin.language.psi; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.psi.PsiElement; + +public interface LombokConfigOperation extends PsiElement { + +} diff --git a/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/LombokConfigProperty.java b/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/LombokConfigProperty.java new file mode 100644 index 000000000000..5666aa6e3026 --- /dev/null +++ b/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/LombokConfigProperty.java @@ -0,0 +1,21 @@ +// This is a generated file. Not intended for manual editing. +package de.plushnikov.intellij.plugin.language.psi; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.psi.PsiElement; + +public interface LombokConfigProperty extends PsiElement { + + @NotNull + LombokConfigOperation getOperation(); + + //WARNING: getKey(...) is skipped + //matching getKey(LombokConfigProperty, ...) + //methods are not found in LombokConfigPsiUtil + + //WARNING: getValue(...) is skipped + //matching getValue(LombokConfigProperty, ...) + //methods are not found in LombokConfigPsiUtil + +} diff --git a/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/LombokConfigTypes.java b/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/LombokConfigTypes.java new file mode 100644 index 000000000000..cc2d0eba8a6a --- /dev/null +++ b/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/LombokConfigTypes.java @@ -0,0 +1,38 @@ +// This is a generated file. Not intended for manual editing. +package de.plushnikov.intellij.plugin.language.psi; + +import com.intellij.psi.tree.IElementType; +import com.intellij.psi.PsiElement; +import com.intellij.lang.ASTNode; +import de.plushnikov.intellij.plugin.language.psi.impl.*; + +public interface LombokConfigTypes { + + IElementType CLEANER = new LombokConfigElementType("CLEANER"); + IElementType OPERATION = new LombokConfigElementType("OPERATION"); + IElementType PROPERTY = new LombokConfigElementType("PROPERTY"); + + IElementType CLEAR = new LombokConfigTokenType("CLEAR"); + IElementType COMMENT = new LombokConfigTokenType("COMMENT"); + IElementType CRLF = new LombokConfigTokenType("CRLF"); + IElementType KEY = new LombokConfigTokenType("KEY"); + IElementType SEPARATOR = new LombokConfigTokenType("SEPARATOR"); + IElementType SIGN = new LombokConfigTokenType("SIGN"); + IElementType VALUE = new LombokConfigTokenType("VALUE"); + + class Factory { + public static PsiElement createElement(ASTNode node) { + IElementType type = node.getElementType(); + if (type == CLEANER) { + return new LombokConfigCleanerImpl(node); + } + else if (type == OPERATION) { + return new LombokConfigOperationImpl(node); + } + else if (type == PROPERTY) { + return new LombokConfigPropertyImpl(node); + } + throw new AssertionError("Unknown element type: " + type); + } + } +} diff --git a/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/LombokConfigVisitor.java b/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/LombokConfigVisitor.java new file mode 100644 index 000000000000..baf550b44771 --- /dev/null +++ b/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/LombokConfigVisitor.java @@ -0,0 +1,26 @@ +// This is a generated file. Not intended for manual editing. +package de.plushnikov.intellij.plugin.language.psi; + +import org.jetbrains.annotations.*; +import com.intellij.psi.PsiElementVisitor; +import com.intellij.psi.PsiElement; + +public class LombokConfigVisitor extends PsiElementVisitor { + + public void visitCleaner(@NotNull LombokConfigCleaner o) { + visitPsiElement(o); + } + + public void visitOperation(@NotNull LombokConfigOperation o) { + visitPsiElement(o); + } + + public void visitProperty(@NotNull LombokConfigProperty o) { + visitPsiElement(o); + } + + public void visitPsiElement(@NotNull PsiElement o) { + visitElement(o); + } + +} diff --git a/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/impl/LombokConfigCleanerImpl.java b/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/impl/LombokConfigCleanerImpl.java new file mode 100644 index 000000000000..cbc860ffe2a9 --- /dev/null +++ b/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/impl/LombokConfigCleanerImpl.java @@ -0,0 +1,29 @@ +// This is a generated file. Not intended for manual editing. +package de.plushnikov.intellij.plugin.language.psi.impl; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiElementVisitor; +import com.intellij.psi.util.PsiTreeUtil; +import static de.plushnikov.intellij.plugin.language.psi.LombokConfigTypes.*; +import com.intellij.extapi.psi.ASTWrapperPsiElement; +import de.plushnikov.intellij.plugin.language.psi.*; + +public class LombokConfigCleanerImpl extends ASTWrapperPsiElement implements LombokConfigCleaner { + + public LombokConfigCleanerImpl(@NotNull ASTNode node) { + super(node); + } + + public void accept(@NotNull LombokConfigVisitor visitor) { + visitor.visitCleaner(this); + } + + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof LombokConfigVisitor) accept((LombokConfigVisitor)visitor); + else super.accept(visitor); + } + +} diff --git a/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/impl/LombokConfigOperationImpl.java b/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/impl/LombokConfigOperationImpl.java new file mode 100644 index 000000000000..81037ac4e7af --- /dev/null +++ b/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/impl/LombokConfigOperationImpl.java @@ -0,0 +1,29 @@ +// This is a generated file. Not intended for manual editing. +package de.plushnikov.intellij.plugin.language.psi.impl; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiElementVisitor; +import com.intellij.psi.util.PsiTreeUtil; +import static de.plushnikov.intellij.plugin.language.psi.LombokConfigTypes.*; +import com.intellij.extapi.psi.ASTWrapperPsiElement; +import de.plushnikov.intellij.plugin.language.psi.*; + +public class LombokConfigOperationImpl extends ASTWrapperPsiElement implements LombokConfigOperation { + + public LombokConfigOperationImpl(@NotNull ASTNode node) { + super(node); + } + + public void accept(@NotNull LombokConfigVisitor visitor) { + visitor.visitOperation(this); + } + + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof LombokConfigVisitor) accept((LombokConfigVisitor)visitor); + else super.accept(visitor); + } + +} diff --git a/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/impl/LombokConfigPropertyImpl.java b/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/impl/LombokConfigPropertyImpl.java new file mode 100644 index 000000000000..21a03a9c3f5d --- /dev/null +++ b/plugins/lombok/generated/src/de/plushnikov/intellij/plugin/language/psi/impl/LombokConfigPropertyImpl.java @@ -0,0 +1,35 @@ +// This is a generated file. Not intended for manual editing. +package de.plushnikov.intellij.plugin.language.psi.impl; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiElementVisitor; +import com.intellij.psi.util.PsiTreeUtil; +import static de.plushnikov.intellij.plugin.language.psi.LombokConfigTypes.*; +import com.intellij.extapi.psi.ASTWrapperPsiElement; +import de.plushnikov.intellij.plugin.language.psi.*; + +public class LombokConfigPropertyImpl extends ASTWrapperPsiElement implements LombokConfigProperty { + + public LombokConfigPropertyImpl(@NotNull ASTNode node) { + super(node); + } + + public void accept(@NotNull LombokConfigVisitor visitor) { + visitor.visitProperty(this); + } + + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof LombokConfigVisitor) accept((LombokConfigVisitor)visitor); + else super.accept(visitor); + } + + @Override + @NotNull + public LombokConfigOperation getOperation() { + return findNotNullChildByClass(LombokConfigOperation.class); + } + +} diff --git a/plugins/lombok/generated/src/lombok/AccessLevel.java b/plugins/lombok/generated/src/lombok/AccessLevel.java new file mode 100644 index 000000000000..9c138e53b563 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/AccessLevel.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2009 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +/** + * Represents an AccessLevel. Used e.g. to specify the access level for generated methods and fields. + */ +public enum AccessLevel { + PUBLIC, MODULE, PROTECTED, PACKAGE, PRIVATE, + /** Represents not generating anything or the complete lack of a method. */ + NONE; +} diff --git a/plugins/lombok/generated/src/lombok/AllArgsConstructor.java b/plugins/lombok/generated/src/lombok/AllArgsConstructor.java new file mode 100644 index 000000000000..c059c65d53ce --- /dev/null +++ b/plugins/lombok/generated/src/lombok/AllArgsConstructor.java @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2010-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Generates an all-args constructor. + * An all-args constructor requires one argument for every field in the class. + *

+ * Complete documentation is found at the project lombok features page for @Constructor. + *

+ * Even though it is not listed, this annotation also has the {@code onConstructor} parameter. See the full documentation for more details. + * + * @see NoArgsConstructor + * @see RequiredArgsConstructor + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.SOURCE) +public @interface AllArgsConstructor { + /** + * If set, the generated constructor will be private, and an additional static 'constructor' + * is generated with the same argument list that wraps the real constructor. + * + * Such a static 'constructor' is primarily useful as it infers type arguments. + * + * @return Name of static 'constructor' method to generate (blank = generate a normal constructor). + */ + String staticName() default ""; + + /** + * Any annotations listed here are put on the generated constructor. + * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).
+ * up to JDK7:
+ * {@code @AllArgsConstructor(onConstructor=@__({@AnnotationsGoHere}))}
+ * from JDK8:
+ * {@code @AllArgsConstructor(onConstructor_={@AnnotationsGohere})} // note the underscore after {@code onConstructor}. + * + * @return List of annotations to apply to the generated constructor. + */ + AnyAnnotation[] onConstructor() default {}; + + /** + * Sets the access level of the constructor. By default, generated constructors are {@code public}. + * + * @return The constructor will be generated with this access modifier. + */ + AccessLevel access() default lombok.AccessLevel.PUBLIC; + + /** + * Placeholder annotation to enable the placement of annotations on the generated code. + * + * @deprecated Don't use this annotation, ever - Read the documentation. + */ + @Deprecated + @Retention(RetentionPolicy.SOURCE) + @Target({}) + @interface AnyAnnotation {} +} diff --git a/plugins/lombok/generated/src/lombok/Builder.java b/plugins/lombok/generated/src/lombok/Builder.java new file mode 100644 index 000000000000..4ca3da65fe97 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/Builder.java @@ -0,0 +1,201 @@ +/* + * Copyright (C) 2013-2018 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +/** + * The builder annotation creates a so-called 'builder' aspect to the class that is annotated or the class + * that contains a member which is annotated with {@code @Builder}. + *

+ * If a member is annotated, it must be either a constructor or a method. If a class is annotated, + * then a private constructor is generated with all fields as arguments + * (as if {@code @AllArgsConstructor(access = AccessLevel.PRIVATE)} is present + * on the class), and it is as if this constructor has been annotated with {@code @Builder} instead. + * Note that this constructor is only generated if you haven't written any constructors and also haven't + * added any explicit {@code @XArgsConstructor} annotations. In those cases, lombok will assume an all-args + * constructor is present and generate code that uses it; this means you'd get a compiler error if this + * constructor is not present. + *

+ * The effect of {@code @Builder} is that an inner class is generated named TBuilder, + * with a private constructor. Instances of TBuilder are made with the + * method named {@code builder()} which is also generated for you in the class itself (not in the builder class). + *

+ * The TBuilder class contains 1 method for each parameter of the annotated + * constructor / method (each field, when annotating a class), which returns the builder itself. + * The builder also has a build() method which returns a completed instance of the original type, + * created by passing all parameters as set via the various other methods in the builder to the constructor + * or method that was annotated with {@code @Builder}. The return type of this method will be the same + * as the relevant class, unless a method has been annotated, in which case it'll be equal to the + * return type of that method. + *

+ * Complete documentation is found at the project lombok features page for @Builder. + *
+ *

+ * Before: + * + *

+ * @Builder
+ * class Example<T> {
+ * 	private T foo;
+ * 	private final String bar;
+ * }
+ * 
+ * + * After: + * + *
+ * class Example<T> {
+ * 	private T foo;
+ * 	private final String bar;
+ * 	
+ * 	private Example(T foo, String bar) {
+ * 		this.foo = foo;
+ * 		this.bar = bar;
+ * 	}
+ * 	
+ * 	public static <T> ExampleBuilder<T> builder() {
+ * 		return new ExampleBuilder<T>();
+ * 	}
+ * 	
+ * 	public static class ExampleBuilder<T> {
+ * 		private T foo;
+ * 		private String bar;
+ * 		
+ * 		private ExampleBuilder() {}
+ * 		
+ * 		public ExampleBuilder foo(T foo) {
+ * 			this.foo = foo;
+ * 			return this;
+ * 		}
+ * 		
+ * 		public ExampleBuilder bar(String bar) {
+ * 			this.bar = bar;
+ * 			return this;
+ * 		}
+ * 		
+ * 		@java.lang.Override public String toString() {
+ * 			return "ExampleBuilder(foo = " + foo + ", bar = " + bar + ")";
+ * 		}
+ * 		
+ * 		public Example build() {
+ * 			return new Example(foo, bar);
+ * 		}
+ * 	}
+ * }
+ * 
+ * + * @see Singular + */ +@Target({TYPE, METHOD, CONSTRUCTOR}) +@Retention(SOURCE) +public @interface Builder { + /** + * The field annotated with {@code @Default} must have an initializing expression; that expression is taken as the default to be used if not explicitly set during building. + */ + @Target(FIELD) + @Retention(SOURCE) + public @interface Default {} + + /** @return Name of the method that creates a new builder instance. Default: {@code builder}. If the empty string, suppress generating the {@code builder} method. */ + String builderMethodName() default "builder"; + + /** @return Name of the method in the builder class that creates an instance of your {@code @Builder}-annotated class. */ + String buildMethodName() default "build"; + + /** + * Name of the builder class. + * + * Default for {@code @Builder} on types and constructors: see the configkey {@code lombok.builder.className}, which if not set defaults to {@code (TypeName)Builder}. + *

+ * Default for {@code @Builder} on methods: see the configkey {@code lombok.builder.className}, which if not set defaults to {@code (ReturnTypeName)Builder}. + * + * @return Name of the builder class that will be generated (or if it already exists, will be filled with builder elements). + */ + String builderClassName() default ""; + + /** + * If true, generate an instance method to obtain a builder that is initialized with the values of this instance. + * Legal only if {@code @Builder} is used on a constructor, on the type itself, or on a static method that returns + * an instance of the declaring type. + * + * @return Whether to generate a {@code toBuilder()} method. + */ + boolean toBuilder() default false; + + /** + * Sets the access level of the generated builder class. By default, generated builder classes are {@code public}. + * Note: This does nothing if you write your own builder class (we won't change its access level). + * + * @return The builder class will be generated with this access modifier. + */ + AccessLevel access() default lombok.AccessLevel.PUBLIC; + + /** + * Prefix to prepend to 'set' methods in the generated builder class. By default, generated methods do not include a prefix. + * + * For example, a method normally generated as {@code someField(String someField)} would instead be + * generated as {@code withSomeField(String someField)} if using {@code @Builder(setterPrefix = "with")}. + * + * Note that using "with" to prefix builder setter methods is strongly discouraged as as "with" normally + * suggests immutable data structures, and builders by definition are mutable objects. + * + * For {@code @Singular} fields, the generated methods are called {@code withName}, {@code withNames}, and {@code clearNames}, instead of + * the default {@code name}, {@code names}, and {@code clearNames}. + * + * @return The prefix to prepend to generated method names. + */ + String setterPrefix() default ""; + + /** + * Put on a field (in case of {@code @Builder} on a type) or a parameter (for {@code @Builder} on a constructor or static method) to + * indicate how lombok should obtain a value for this field or parameter given an instance; this is only relevant if {@code toBuilder} is {@code true}. + * + * You do not need to supply an {@code @ObtainVia} annotation unless you wish to change the default behaviour: Use a field with the same name. + *

+ * Note that one of {@code field} or {@code method} should be set, or an error is generated. + *

+ * The default behaviour is to obtain a value by referencing the name of the parameter as a field on 'this'. + */ + @Target({FIELD, PARAMETER}) + @Retention(SOURCE) + public @interface ObtainVia { + /** + * @return Tells lombok to obtain a value with the expression {@code this.value}. + */ + String field() default ""; + + /** + * @return Tells lombok to obtain a value with the expression {@code this.method()}. + */ + String method() default ""; + + /** + * @return Tells lombok to obtain a value with the expression {@code SelfType.method(this)}; requires {@code method} to be set. + */ + boolean isStatic() default false; + } +} diff --git a/plugins/lombok/generated/src/lombok/Cleanup.java b/plugins/lombok/generated/src/lombok/Cleanup.java new file mode 100644 index 000000000000..a3a1c1981f20 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/Cleanup.java @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2009-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Ensures the variable declaration that you annotate will be cleaned up by calling its close method, regardless + * of what happens. Implemented by wrapping all statements following the local variable declaration to the + * end of your scope into a try block that, as a finally action, closes the resource. + *

+ * Complete documentation is found at the project lombok features page for @Cleanup. + *

+ * Example: + *

+ * public void copyFile(String in, String out) throws IOException {
+ *     @Cleanup FileInputStream inStream = new FileInputStream(in);
+ *     @Cleanup FileOutputStream outStream = new FileOutputStream(out);
+ *     byte[] b = new byte[65536];
+ *     while (true) {
+ *         int r = inStream.read(b);
+ *         if (r == -1) break;
+ *         outStream.write(b, 0, r);
+ *     }
+ * }
+ * 
+ * + * Will generate: + *
+ * public void copyFile(String in, String out) throws IOException {
+ *     @Cleanup FileInputStream inStream = new FileInputStream(in);
+ *     try {
+ *         @Cleanup FileOutputStream outStream = new FileOutputStream(out);
+ *         try {
+ *             byte[] b = new byte[65536];
+ *             while (true) {
+ *                 int r = inStream.read(b);
+ *                 if (r == -1) break;
+ *                 outStream.write(b, 0, r);
+ *             }
+ *         } finally {
+ *             if (outStream != null) outStream.close();
+ *         }
+ *     } finally {
+ *         if (inStream != null) inStream.close();
+ *     }
+ * }
+ * 
+ */ +@Target(ElementType.LOCAL_VARIABLE) +@Retention(RetentionPolicy.SOURCE) +public @interface Cleanup { + /** @return The name of the method that cleans up the resource. By default, 'close'. The method must not have any parameters. */ + String value() default "close"; +} diff --git a/plugins/lombok/generated/src/lombok/CustomLog.java b/plugins/lombok/generated/src/lombok/CustomLog.java new file mode 100644 index 000000000000..d1f45f7c64aa --- /dev/null +++ b/plugins/lombok/generated/src/lombok/CustomLog.java @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2019 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Causes lombok to generate a logger field based on a custom logger implementation. + *

+ * Complete documentation is found at the project lombok features page for lombok log annotations. + *

+ * Example: + *

+ * @CustomLog
+ * public class LogExample {
+ * }
+ * 
+ * With configuration: + *
+ * lombok.log.custom.declaration=my.cool.Logger my.cool.LoggerFactory.getLogger(NAME)
+ * 
+ * + * will generate: + * + *
+ * public class LogExample {
+ *     private static final my.cool.Logger log = my.cool.LoggerFactory.getLogger(LogExample.class.getName());
+ * }
+ * 
+ *

+ * Configuration must be provided in lombok.config, otherwise any usage of this annotation will result in a compile-time error. + * + * This annotation is valid for classes and enumerations.
+ * @see lombok.extern.java.Log @Log + * @see lombok.extern.apachecommons.CommonsLog @CommonsLog + * @see lombok.extern.log4j.Log4j @Log4j + * @see lombok.extern.log4j.Log4j2 @Log4j2 + * @see lombok.extern.slf4j.Slf4j @Slf4j + * @see lombok.extern.slf4j.XSlf4j @XSlf4j + * @see lombok.extern.jbosslog.JBossLog @JBossLog + * @see lombok.extern.flogger.Flogger @Flogger + */ +@Retention(RetentionPolicy.SOURCE) +@Target(ElementType.TYPE) +public @interface CustomLog { + /** + * + * Sets a custom topic/category. Note that this requires you to specify a parameter configuration for your custom logger that includes {@code TOPIC}. + * + * @return The topic/category of the constructed Logger. By default (or for the empty string as topic), the parameter configuration without {@code TOPIC} is invoked. + */ + String topic() default ""; +} diff --git a/plugins/lombok/generated/src/lombok/Data.java b/plugins/lombok/generated/src/lombok/Data.java new file mode 100644 index 000000000000..ffa968c17671 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/Data.java @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2009-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Generates getters for all fields, a useful toString method, and hashCode and equals implementations that check + * all non-transient fields. Will also generate setters for all non-final fields, as well as a constructor. + *

+ * Equivalent to {@code @Getter @Setter @RequiredArgsConstructor @ToString @EqualsAndHashCode}. + *

+ * Complete documentation is found at the project lombok features page for @Data. + * + * @see Getter + * @see Setter + * @see RequiredArgsConstructor + * @see ToString + * @see EqualsAndHashCode + * @see lombok.Value + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.SOURCE) +public @interface Data { + /** + * If you specify a static constructor name, then the generated constructor will be private, and + * instead a static factory method is created that other classes can use to create instances. + * We suggest the name: "of", like so: + * + *

+	 *     public @Data(staticConstructor = "of") class Point { final int x, y; }
+	 * 
+ * + * Default: No static constructor, instead the normal constructor is public. + * + * @return Name of static 'constructor' method to generate (blank = generate a normal constructor). + */ + String staticConstructor() default ""; +} diff --git a/plugins/lombok/generated/src/lombok/Delegate.java b/plugins/lombok/generated/src/lombok/Delegate.java new file mode 100644 index 000000000000..0c5a4c2c6606 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/Delegate.java @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2010-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * @deprecated Use {@link lombok.experimental.Delegate} instead. + */ +@Target({ElementType.FIELD, ElementType.METHOD}) +@Retention(RetentionPolicy.SOURCE) +@Deprecated +public @interface Delegate { + /** + * Normally the type of the field is used as delegate type. However, to choose a different type to delegate, you can list one (or more) types here. Note that types with + * type arguments can only be done as a field type. A solution for this is to create a private inner interface/class with the appropriate types extended, and possibly + * with all methods you'd like to delegate listed, and then supply that class here. The field does not actually have to implement the type you're delegating; the + * type listed here is used only to determine which delegate methods to generate. + * + * NB: All methods in {@code Object}, as well as {@code canEqual(Object other)} will never be delegated. + * + * @return For each method (not already in {@code java.lang.Object}) in these types, generate a delegate method. + */ + Class[] types() default {}; + + /** + * Each method in any of the types listed here (include supertypes) will not be delegated. + * + * NB: All methods in {@code Object}, as well as {@code canEqual(Object other)} will never be delegated. + * + * @return For each method (not already in {@code java.lang.Object}) in these types, skip generating a delegate method (overrides {@code types()}). + */ + Class[] excludes() default {}; +} diff --git a/plugins/lombok/generated/src/lombok/EqualsAndHashCode.java b/plugins/lombok/generated/src/lombok/EqualsAndHashCode.java new file mode 100644 index 000000000000..e752165c83ec --- /dev/null +++ b/plugins/lombok/generated/src/lombok/EqualsAndHashCode.java @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2009-2018 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Generates implementations for the {@code equals} and {@code hashCode} methods inherited by all objects, based on relevant fields. + *

+ * Complete documentation is found at the project lombok features page for @EqualsAndHashCode. + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.SOURCE) +public @interface EqualsAndHashCode { + /** + * Any fields listed here will not be taken into account in the generated {@code equals} and {@code hashCode} implementations. + * Mutually exclusive with {@link #of()}. + *

+ * Will soon be marked {@code @Deprecated}; use the {@code @EqualsAndHashCode.Exclude} annotation instead. + * + * @return A list of fields to exclude. + */ + String[] exclude() default {}; + + /** + * If present, explicitly lists the fields that are to be used for identity. + * Normally, all non-static, non-transient fields are used for identity. + *

+ * Mutually exclusive with {@link #exclude()}. + *

+ * Will soon be marked {@code @Deprecated}; use the {@code @EqualsAndHashCode.Include} annotation together with {@code @EqualsAndHashCode(onlyExplicitlyIncluded = true)}. + * + * @return A list of fields to use (default: all of them). + */ + String[] of() default {}; + + /** + * Call on the superclass's implementations of {@code equals} and {@code hashCode} before calculating for the fields in this class. + * default: false + * + * @return Whether to call the superclass's {@code equals} implementation as part of the generated equals algorithm. + */ + boolean callSuper() default false; + + /** + * Normally, if getters are available, those are called. To suppress this and let the generated code use the fields directly, set this to {@code true}. + * default: false + * + * @return If {@code true}, always use direct field access instead of calling the getter method. + */ + boolean doNotUseGetters() default false; + + /** + * Any annotations listed here are put on the generated parameter of {@code equals} and {@code canEqual}. + * This is useful to add for example a {@code Nullable} annotation.
+ * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).
+ * up to JDK7:
+ * {@code @EqualsAndHashCode(onParam=@__({@AnnotationsGoHere}))}
+ * from JDK8:
+ * {@code @EqualsAndHashCode(onParam_={@AnnotationsGohere})} // note the underscore after {@code onParam}. + * + * @return List of annotations to apply to the generated parameter in the {@code equals()} method. + */ + AnyAnnotation[] onParam() default {}; + + /** + * Placeholder annotation to enable the placement of annotations on the generated code. + * @deprecated Don't use this annotation, ever - Read the documentation. + */ + @Deprecated + @Retention(RetentionPolicy.SOURCE) + @Target({}) + @interface AnyAnnotation {} + + /** + * Only include fields and methods explicitly marked with {@code @EqualsAndHashCode.Include}. + * Normally, all (non-static, non-transient) fields are included by default. + * + * @return If {@code true}, don't include non-static non-transient fields automatically (default: {@code false}). + */ + boolean onlyExplicitlyIncluded() default false; + + /** + * If present, do not include this field in the generated {@code equals} and {@code hashCode} methods. + */ + @Target(ElementType.FIELD) + @Retention(RetentionPolicy.SOURCE) + public @interface Exclude {} + + /** + * Configure the behaviour of how this member is treated in the {@code equals} and {@code hashCode} implementation; if on a method, include the method's return value as part of calculating hashCode/equality. + */ + @Target({ElementType.FIELD, ElementType.METHOD}) + @Retention(RetentionPolicy.SOURCE) + public @interface Include { + /** + * Defaults to the method name of the annotated member. + * If on a method and the name equals the name of a default-included field, this member takes its place. + * + * @return If present, this method serves as replacement for the named field. + */ + String replaces() default ""; + } +} diff --git a/plugins/lombok/generated/src/lombok/Getter.java b/plugins/lombok/generated/src/lombok/Getter.java new file mode 100644 index 000000000000..5a23fe30bd07 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/Getter.java @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2009-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Put on any field to make lombok build a standard getter. + *

+ * Complete documentation is found at the project lombok features page for @Getter and @Setter. + *

+ * Even though it is not listed, this annotation also has the {@code onMethod} parameter. See the full documentation for more details. + *

+ * Example: + *

+ *     private @Getter int foo;
+ * 
+ * + * will generate: + * + *
+ *     public int getFoo() {
+ *         return this.foo;
+ *     }
+ * 
+ *

+ * This annotation can also be applied to a class, in which case it'll be as if all non-static fields that don't already have + * a {@code @Getter} annotation have the annotation. + */ +@Target({ElementType.FIELD, ElementType.TYPE}) +@Retention(RetentionPolicy.SOURCE) +public @interface Getter { + /** + * If you want your getter to be non-public, you can specify an alternate access level here. + * + * @return The getter method will be generated with this access modifier. + */ + lombok.AccessLevel value() default lombok.AccessLevel.PUBLIC; + + /** + * Any annotations listed here are put on the generated method. + * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).
+ * up to JDK7:
+ * {@code @Getter(onMethod=@__({@AnnotationsGoHere}))}
+ * from JDK8:
+ * {@code @Getter(onMethod_={@AnnotationsGohere})} // note the underscore after {@code onMethod}. + * + * @return List of annotations to apply to the generated getter method. + */ + AnyAnnotation[] onMethod() default {}; + + boolean lazy() default false; + + /** + * Placeholder annotation to enable the placement of annotations on the generated code. + * @deprecated Don't use this annotation, ever - Read the documentation. + */ + @Deprecated + @Retention(RetentionPolicy.SOURCE) + @Target({}) + @interface AnyAnnotation {} +} diff --git a/plugins/lombok/generated/src/lombok/NoArgsConstructor.java b/plugins/lombok/generated/src/lombok/NoArgsConstructor.java new file mode 100644 index 000000000000..672cd1c24c38 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/NoArgsConstructor.java @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2010-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Generates a no-args constructor. + * Will generate an error message if such a constructor cannot be written due to the existence of final fields. + *

+ * Complete documentation is found at the project lombok features page for @Constructor. + *

+ * Even though it is not listed, this annotation also has the {@code onConstructor} parameter. See the full documentation for more details. + *

+ * NB: Fields with constraints such as {@code @NonNull} will NOT be checked in a {@code @NoArgsConstructor} constructor, of course! + * + * @see RequiredArgsConstructor + * @see AllArgsConstructor + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.SOURCE) +public @interface NoArgsConstructor { + /** + * If set, the generated constructor will be private, and an additional static 'constructor' + * is generated with the same argument list that wraps the real constructor. + * + * Such a static 'constructor' is primarily useful as it infers type arguments. + * + * @return Name of static 'constructor' method to generate (blank = generate a normal constructor). + */ + String staticName() default ""; + + /** + * Any annotations listed here are put on the generated constructor. + * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).
+ * up to JDK7:
+ * {@code @NoArgsConstructor(onConstructor=@__({@AnnotationsGoHere}))}
+ * from JDK8:
+ * {@code @NoArgsConstructor(onConstructor_={@AnnotationsGohere})} // note the underscore after {@code onConstructor}. + * + * @return List of annotations to apply to the generated constructor. + */ + AnyAnnotation[] onConstructor() default {}; + + /** + * Sets the access level of the constructor. By default, generated constructors are {@code public}. + * + * @return The constructor will be generated with this access modifier. + */ + AccessLevel access() default lombok.AccessLevel.PUBLIC; + + /** + * If {@code true}, initializes all final fields to 0 / null / false. + * Otherwise, a compile time error occurs. + * + * @return Return {@code} true to force generation of a no-args constructor, picking defaults if necessary to assign required fields. + */ + boolean force() default false; + + /** + * Placeholder annotation to enable the placement of annotations on the generated code. + * @deprecated Don't use this annotation, ever - Read the documentation. + */ + @Deprecated + @Retention(RetentionPolicy.SOURCE) + @Target({}) + @interface AnyAnnotation {} +} diff --git a/plugins/lombok/generated/src/lombok/NonNull.java b/plugins/lombok/generated/src/lombok/NonNull.java new file mode 100644 index 000000000000..ba8c24a4c5ae --- /dev/null +++ b/plugins/lombok/generated/src/lombok/NonNull.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2009-2019 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * If put on a parameter, lombok will insert a null-check at the start of the method / constructor's body, throwing a + * {@code NullPointerException} with the parameter's name as message. If put on a field, any generated method assigning + * a value to this field will also produce these null-checks. + */ +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.TYPE_USE}) +@Retention(RetentionPolicy.CLASS) +@Documented +public @interface NonNull { +} diff --git a/plugins/lombok/generated/src/lombok/RequiredArgsConstructor.java b/plugins/lombok/generated/src/lombok/RequiredArgsConstructor.java new file mode 100644 index 000000000000..f21bd6475fd7 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/RequiredArgsConstructor.java @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2010-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Generates a constructor with required arguments. + * Required arguments are final fields and fields with constraints such as {@code @NonNull}. + *

+ * Complete documentation is found at the project lombok features page for @Constructor. + *

+ * Even though it is not listed, this annotation also has the {@code onConstructor} parameter. See the full documentation for more details. + * + * @see NoArgsConstructor + * @see AllArgsConstructor + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.SOURCE) +public @interface RequiredArgsConstructor { + /** + * If set, the generated constructor will be private, and an additional static 'constructor' + * is generated with the same argument list that wraps the real constructor. + * + * Such a static 'constructor' is primarily useful as it infers type arguments. + * + * @return Name of static 'constructor' method to generate (blank = generate a normal constructor). + */ + String staticName() default ""; + + /** + * Any annotations listed here are put on the generated constructor. + * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).
+ * up to JDK7:
+ * {@code @RequiredArgsConstructor(onConstructor=@__({@AnnotationsGoHere}))}
+ * from JDK8:
+ * {@code @RequiredArgsConstructor(onConstructor_={@AnnotationsGohere})} // note the underscore after {@code onConstructor}. + * + * @return List of annotations to apply to the generated constructor. + */ + AnyAnnotation[] onConstructor() default {}; + + /** + * Sets the access level of the constructor. By default, generated constructors are {@code public}. + * + * @return The constructor will be generated with this access modifier. + */ + AccessLevel access() default lombok.AccessLevel.PUBLIC; + + /** + * Placeholder annotation to enable the placement of annotations on the generated code. + * @deprecated Don't use this annotation, ever - Read the documentation. + */ + @Deprecated + @Retention(RetentionPolicy.SOURCE) + @Target({}) + @interface AnyAnnotation {} +} diff --git a/plugins/lombok/generated/src/lombok/Setter.java b/plugins/lombok/generated/src/lombok/Setter.java new file mode 100644 index 000000000000..1b70bac97172 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/Setter.java @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2009-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Put on any field to make lombok build a standard setter. + *

+ * Complete documentation is found at the project lombok features page for @Getter and @Setter. + *

+ * Even though it is not listed, this annotation also has the {@code onParam} and {@code onMethod} parameter. See the full documentation for more details. + *

+ * Example: + *

+ *     private @Setter int foo;
+ * 
+ * + * will generate: + * + *
+ *     public void setFoo(int foo) {
+ *         this.foo = foo;
+ *     }
+ * 
+ * + *

+ * This annotation can also be applied to a class, in which case it'll be as if all non-static fields that don't already have + * a {@code Setter} annotation have the annotation. + */ +@Target({ElementType.FIELD, ElementType.TYPE}) +@Retention(RetentionPolicy.SOURCE) +public @interface Setter { + /** + * If you want your setter to be non-public, you can specify an alternate access level here. + * + * @return The setter method will be generated with this access modifier. + */ + lombok.AccessLevel value() default lombok.AccessLevel.PUBLIC; + + /** + * Any annotations listed here are put on the generated method. + * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).
+ * up to JDK7:
+ * {@code @Setter(onMethod=@__({@AnnotationsGoHere}))}
+ * from JDK8:
+ * {@code @Setter(onMethod_={@AnnotationsGohere})} // note the underscore after {@code onMethod}. + * + * @return List of annotations to apply to the generated setter method. + */ + AnyAnnotation[] onMethod() default {}; + + /** + * Any annotations listed here are put on the generated method's parameter. + * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).
+ * up to JDK7:
+ * {@code @Setter(onParam=@__({@AnnotationsGoHere}))}
+ * from JDK8:
+ * {@code @Setter(onParam_={@AnnotationsGohere})} // note the underscore after {@code onParam}. + * + * @return List of annotations to apply to the generated parameter in the setter method. + */ + AnyAnnotation[] onParam() default {}; + + /** + * Placeholder annotation to enable the placement of annotations on the generated code. + * @deprecated Don't use this annotation, ever - Read the documentation. + */ + @Deprecated + @Retention(RetentionPolicy.SOURCE) + @Target({}) + @interface AnyAnnotation {} +} \ No newline at end of file diff --git a/plugins/lombok/generated/src/lombok/Singular.java b/plugins/lombok/generated/src/lombok/Singular.java new file mode 100644 index 000000000000..2ceaad58e65b --- /dev/null +++ b/plugins/lombok/generated/src/lombok/Singular.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2015-2020 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +/** + * The singular annotation is used together with {@code @Builder} to create single element 'add' methods in the builder for collections. + */ +@Target({FIELD, PARAMETER}) +@Retention(SOURCE) +public @interface Singular { + /** @return The singular name of this field. If it's a normal english plural, lombok will figure it out automatically. Otherwise, this parameter is mandatory. */ + String value() default ""; + + /** @return If true, the plural variant (which takes a collection and adds each element inside) will treat {@code null} as an empty collection, i.e. do nothing. If {@code false) (the default), it is null checked as if annotated with {@code @lombok.NonNull}. */ + boolean ignoreNullCollections() default false; +} diff --git a/plugins/lombok/generated/src/lombok/SneakyThrows.java b/plugins/lombok/generated/src/lombok/SneakyThrows.java new file mode 100644 index 000000000000..0506d6152b24 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/SneakyThrows.java @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2009-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * @SneakyThrow will avoid javac's insistence that you either catch or throw onward any checked exceptions that + * statements in your method body declare they generate. + *

+ * @SneakyThrow does not silently swallow, wrap into RuntimeException, or otherwise modify any exceptions of the listed + * checked exception types. The JVM does not check for the consistency of the checked exception system; javac does, + * and this annotation lets you opt out of its mechanism. + *

+ * Complete documentation is found at the project lombok features page for @SneakyThrows. + *

+ * Example: + *

+ * @SneakyThrows(UnsupportedEncodingException.class)
+ * public void utf8ToString(byte[] bytes) {
+ *     return new String(bytes, "UTF-8");
+ * }
+ * 
+ * + * Becomes: + *
+ * public void utf8ToString(byte[] bytes) {
+ *     try {
+ *         return new String(bytes, "UTF-8");
+ *     } catch (UnsupportedEncodingException $uniqueName) {
+ *         throw useMagicTrickeryToHideThisFromTheCompiler($uniqueName);
+ *         // This trickery involves a bytecode transformer run automatically during the final stages of compilation;
+ *         // there is no runtime dependency on lombok.
+ *     }
+ * 
+ */ +@Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) +@Retention(RetentionPolicy.SOURCE) +public @interface SneakyThrows { + /** @return The exception type(s) you want to sneakily throw onward. */ + Class[] value() default java.lang.Throwable.class; + + //The fully qualified name is used for java.lang.Throwable in the parameter only. This works around a bug in javac: + // presence of an annotation processor throws off the type resolver for some reason. +} diff --git a/plugins/lombok/generated/src/lombok/Synchronized.java b/plugins/lombok/generated/src/lombok/Synchronized.java new file mode 100644 index 000000000000..5dff0fb2e295 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/Synchronized.java @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2009-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Almost exactly like putting the 'synchronized' keyword on a method, except will synchronize on a private internal + * Object, so that other code not under your control doesn't meddle with your thread management by locking on + * your own instance. + *

+ * For non-static methods, a field named {@code $lock} is used, and for static methods, + * {@code $LOCK} is used. These will be generated if needed and if they aren't already present. The contents + * of the fields will be serializable. + *

+ * Complete documentation is found at the project lombok features page for @Synchronized. + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.SOURCE) +public @interface Synchronized { + /** + * Optional: specify the name of a different field to lock on. It is a compile time error if this field + * doesn't already exist (the fields are automatically generated only if you don't specify a specific name. + * + * @return Name of the field to lock on (blank = generate one). + */ + String value() default ""; +} diff --git a/plugins/lombok/generated/src/lombok/ToString.java b/plugins/lombok/generated/src/lombok/ToString.java new file mode 100644 index 000000000000..34418a2fe6ff --- /dev/null +++ b/plugins/lombok/generated/src/lombok/ToString.java @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2009-2018 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Generates an implementation for the {@code toString} method inherited by all objects, consisting of printing the values of relevant fields. + *

+ * Complete documentation is found at the project lombok features page for @ToString. + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.SOURCE) +public @interface ToString { + /** + * Include the name of each field when printing it. + * default: true + * + * @return Whether or not to include the names of fields in the string produced by the generated {@code toString()}. + */ + boolean includeFieldNames() default true; + + /** + * Any fields listed here will not be printed in the generated {@code toString} implementation. + * Mutually exclusive with {@link #of()}. + *

+ * Will soon be marked {@code @Deprecated}; use the {@code @ToString.Exclude} annotation instead. + * + * @return A list of fields to exclude. + */ + String[] exclude() default {}; + + /** + * If present, explicitly lists the fields that are to be printed. + * Normally, all non-static fields are printed. + *

+ * Mutually exclusive with {@link #exclude()}. + *

+ * Will soon be marked {@code @Deprecated}; use the {@code @ToString.Include} annotation together with {@code @ToString(onlyExplicitlyIncluded = true)}. + * + * @return A list of fields to use (default: all of them). + */ + String[] of() default {}; + + /** + * Include the result of the superclass's implementation of {@code toString} in the output. + * default: false + * + * @return Whether to call the superclass's {@code toString} implementation as part of the generated toString algorithm. + */ + boolean callSuper() default false; + + /** + * Normally, if getters are available, those are called. To suppress this and let the generated code use the fields directly, set this to {@code true}. + * default: false + * + * @return If {@code true}, always use direct field access instead of calling the getter method. + */ + boolean doNotUseGetters() default false; + + /** + * Only include fields and methods explicitly marked with {@code @ToString.Include}. + * Normally, all (non-static) fields are included by default. + * + * @return If {@code true}, don't include non-static fields automatically (default: {@code false}). + */ + boolean onlyExplicitlyIncluded() default false; + + /** + * If present, do not include this field in the generated {@code toString}. + */ + @Target(ElementType.FIELD) + @Retention(RetentionPolicy.SOURCE) + public @interface Exclude {} + + /** + * Configure the behaviour of how this member is rendered in the {@code toString}; if on a method, include the method's return value in the output. + */ + @Target({ElementType.FIELD, ElementType.METHOD}) + @Retention(RetentionPolicy.SOURCE) + public @interface Include { +// /** If true and the return value is {@code null}, omit this member entirely from the {@code toString} output. */ +// boolean skipNull() default false; // -- We'll add it later, it requires a complete rework on the toString code we generate. + + /** + * Higher ranks are printed first. Members of the same rank are printed in the order they appear in the source file. + * + * @return ordering within the generating {@code toString()}; higher numbers are printed first. + */ + int rank() default 0; + + /** + * Defaults to the field / method name of the annotated member. + * If the name equals the name of a default-included field, this member takes its place. + * + * @return The name to show in the generated {@code toString()}. Also, if this annotation is on a method and the name matches an existing field, it replaces that field. + */ + String name() default ""; + } +} diff --git a/plugins/lombok/generated/src/lombok/Value.java b/plugins/lombok/generated/src/lombok/Value.java new file mode 100644 index 000000000000..562ba0cca092 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/Value.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2012-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Generates a lot of code which fits with a class that is a representation of an immutable entity. + *

+ * Equivalent to {@code @Getter @FieldDefaults(makeFinal=true, level=AccessLevel.PRIVATE) @AllArgsConstructor @ToString @EqualsAndHashCode}. + *

+ * Complete documentation is found at the project lombok features page for @Value. + * + * @see lombok.Getter + * @see lombok.experimental.FieldDefaults + * @see lombok.AllArgsConstructor + * @see lombok.ToString + * @see lombok.EqualsAndHashCode + * @see lombok.Data + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.SOURCE) +public @interface Value { + /** + * If you specify a static constructor name, then the generated constructor will be private, and + * instead a static factory method is created that other classes can use to create instances. + * We suggest the name: "of", like so: + * + *

+	 *     public @Value(staticConstructor = "of") class Point { final int x, y; }
+	 * 
+ * + * Default: No static constructor, instead the normal constructor is public. + * + * @return Name of static 'constructor' method to generate (blank = generate a normal constructor). + */ + String staticConstructor() default ""; +} diff --git a/plugins/lombok/generated/src/lombok/With.java b/plugins/lombok/generated/src/lombok/With.java new file mode 100644 index 000000000000..141d1fa68c81 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/With.java @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2012-2019 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import lombok.AccessLevel; + +/** + * Put on any field to make lombok build a 'with' - a withX method which produces a clone of this object (except for 1 field which gets a new value). + *

+ * Complete documentation is found at the project lombok features page for @With. + *

+ * Example: + *

+ *     private @With final int foo;
+ * 
+ * + * will generate: + * + *
+ *     public SELF_TYPE withFoo(int foo) {
+ *         return this.foo == foo ? this : new SELF_TYPE(otherField1, otherField2, foo);
+ *     }
+ * 
+ *

+ * This annotation can also be applied to a class, in which case it'll be as if all non-static fields that don't already have + * a {@code With} annotation have the annotation. + */ +@Target({ElementType.FIELD, ElementType.TYPE}) +@Retention(RetentionPolicy.SOURCE) +public @interface With { + /** + * If you want your with method to be non-public, you can specify an alternate access level here. + * + * @return The method will be generated with this access modifier. + */ + AccessLevel value() default AccessLevel.PUBLIC; + + /** + * Any annotations listed here are put on the generated method. + * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).
+ * up to JDK7:
+ * {@code @With(onMethod=@__({@AnnotationsGoHere}))}
+ * from JDK8:
+ * {@code @With(onMethod_={@AnnotationsGohere})} // note the underscore after {@code onMethod}. + * + * @return List of annotations to apply to the generated method. + */ + AnyAnnotation[] onMethod() default {}; + + /** + * Any annotations listed here are put on the generated method's parameter. + * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).
+ * up to JDK7:
+ * {@code @With(onParam=@__({@AnnotationsGoHere}))}
+ * from JDK8:
+ * {@code @With(onParam_={@AnnotationsGohere})} // note the underscore after {@code onParam}. + * + * @return List of annotations to apply to the generated parameter in the method. + */ + AnyAnnotation[] onParam() default {}; + + /** + * Placeholder annotation to enable the placement of annotations on the generated code. + * @deprecated Don't use this annotation, ever - Read the documentation. + */ + @Deprecated + @Retention(RetentionPolicy.SOURCE) + @Target({}) + @interface AnyAnnotation {} +} diff --git a/plugins/lombok/generated/src/lombok/core/handlers/Singulars.java b/plugins/lombok/generated/src/lombok/core/handlers/Singulars.java new file mode 100644 index 000000000000..87895790b5af --- /dev/null +++ b/plugins/lombok/generated/src/lombok/core/handlers/Singulars.java @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2015 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.core.handlers; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.List; + +public class Singulars { + private static final List SINGULAR_STORE; // intended to be immutable. + + static { + SINGULAR_STORE = new ArrayList(); + + try { + InputStream in = Singulars.class.getResourceAsStream("singulars.txt"); + try { + BufferedReader br = new BufferedReader(new InputStreamReader(in, "UTF-8")); + for (String line = br.readLine(); line != null; line = br.readLine()) { + line = line.trim(); + if (line.startsWith("#") || line.isEmpty()) continue; + if (line.endsWith(" =")) { + SINGULAR_STORE.add(line.substring(0, line.length() - 2)); + SINGULAR_STORE.add(""); + continue; + } + + int idx = line.indexOf(" = "); + SINGULAR_STORE.add(line.substring(0, idx)); + SINGULAR_STORE.add(line.substring(idx + 3)); + } + } finally { + try { + in.close(); + } catch (Throwable ignore) {} + } + } catch (IOException e) { + SINGULAR_STORE.clear(); + } + } + + public static String autoSingularize(String in) { + final int inLen = in.length(); + for (int i = 0; i < SINGULAR_STORE.size(); i+= 2) { + final String lastPart = SINGULAR_STORE.get(i); + final boolean wholeWord = Character.isUpperCase(lastPart.charAt(0)); + final int endingOnly = lastPart.charAt(0) == '-' ? 1 : 0; + final int len = lastPart.length(); + if (inLen < len) continue; + if (!in.regionMatches(true, inLen - len + endingOnly, lastPart, endingOnly, len - endingOnly)) continue; + if (wholeWord && inLen != len && !Character.isUpperCase(in.charAt(inLen - len))) continue; + + String replacement = SINGULAR_STORE.get(i + 1); + if (replacement.equals("!")) return null; + + boolean capitalizeFirst = !replacement.isEmpty() && Character.isUpperCase(in.charAt(inLen - len + endingOnly)); + String pre = in.substring(0, inLen - len + endingOnly); + String post = capitalizeFirst ? Character.toUpperCase(replacement.charAt(0)) + replacement.substring(1) : replacement; + return pre + post; + } + + return null; + } +} diff --git a/plugins/lombok/generated/src/lombok/experimental/Accessors.java b/plugins/lombok/generated/src/lombok/experimental/Accessors.java new file mode 100644 index 000000000000..dc9ae4b09db5 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/experimental/Accessors.java @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2012-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.experimental; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * A container for settings for the generation of getters and setters. + *

+ * Complete documentation is found at the project lombok features page for @Accessors. + *

+ * Using this annotation does nothing by itself; an annotation that makes lombok generate getters and setters, + * such as {@link lombok.Setter} or {@link lombok.Data} is also required. + */ +@Target({ElementType.TYPE, ElementType.FIELD}) +@Retention(RetentionPolicy.SOURCE) +public @interface Accessors { + /** + * If true, accessors will be named after the field and not include a {@code get} or {@code set} + * prefix. If true and {@code chain} is omitted, {@code chain} defaults to {@code true}. + * default: false + * + * @return Whether or not to make fluent methods (named {@code fieldName()}, not for example {@code setFieldName}). + */ + boolean fluent() default false; + + /** + * If true, setters return {@code this} instead of {@code void}. + * default: false, unless {@code fluent=true}, then default: true + * + * @return Whether or not setters should return themselves (chaining) or {@code void} (no chaining). + */ + boolean chain() default false; + + /** + * If present, only fields with any of the stated prefixes are given the getter/setter treatment. + * Note that a prefix only counts if the next character is NOT a lowercase character or the last + * letter of the prefix is not a letter (for instance an underscore). If multiple fields + * all turn into the same name when the prefix is stripped, an error will be generated. + * + * @return If you are in the habit of prefixing your fields (for example, you name them {@code fFieldName}, specify such prefixes here). + */ + String[] prefix() default {}; +} diff --git a/plugins/lombok/generated/src/lombok/experimental/Delegate.java b/plugins/lombok/generated/src/lombok/experimental/Delegate.java new file mode 100644 index 000000000000..cc84452642f0 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/experimental/Delegate.java @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2010-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.experimental; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Put on any field to make lombok generate delegate methods that forward the call to this field. + * + * Example: + *

+ *     private @Delegate List<String> foo;
+ * 
+ * + * will generate for example an {@code boolean add(String)} method, which contains: {@code return foo.add(arg);}, as well as all other methods in {@code List}. + * + * All public instance methods of the field's type, as well as all public instance methods of all the field's type's superfields are delegated, except for all methods + * that exist in {@link Object}, the {@code canEqual(Object)} method, and any methods that appear in types + * that are listed in the {@code excludes} property. + *

+ * Complete documentation is found at the project lombok features page for @Delegate. + */ +@Target({ElementType.FIELD, ElementType.METHOD}) +@Retention(RetentionPolicy.SOURCE) +public @interface Delegate { + /** + * Normally the type of the field is used as delegate type. However, to choose a different type to delegate, you can list one (or more) types here. Note that types with + * type arguments can only be done as a field type. A solution for this is to create a private inner interface/class with the appropriate types extended, and possibly + * with all methods you'd like to delegate listed, and then supply that class here. The field does not actually have to implement the type you're delegating; the + * type listed here is used only to determine which delegate methods to generate. + * + * NB: All methods in {@code Object}, as well as {@code canEqual(Object other)} will never be delegated. + * + * @return For each method (not already in {@code java.lang.Object}) in these types, generate a delegate method. + */ + Class[] types() default {}; + + /** + * Each method in any of the types listed here (include supertypes) will not be delegated. + * + * NB: All methods in {@code Object}, as well as {@code canEqual(Object other)} will never be delegated. + * + * @return For each method (not already in {@code java.lang.Object}) in these types, skip generating a delegate method (overrides {@code types()}). + */ + Class[] excludes() default {}; +} diff --git a/plugins/lombok/generated/src/lombok/experimental/ExtensionMethod.java b/plugins/lombok/generated/src/lombok/experimental/ExtensionMethod.java new file mode 100644 index 000000000000..af38f6ed4706 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/experimental/ExtensionMethod.java @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2012-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.experimental; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +import java.lang.annotation.*; + +/** + * Extension methods enable you to "add" methods to existing types without creating a new derived type, recompiling, or + * otherwise modifying the original type. Extension methods are a special kind of static method, but they are called as + * if they were instance methods on the extended type. + *

+ * Complete documentation is found at the project lombok features page for @ExtensionMethod. + *
+ *

+ * Before: + * + *

+ * @ExtensionMethod(java.util.Arrays.class)
+ * class Example {
+ * 	private void example() {
+ * 		long[] values = new long[] { 2, 5, 7, 9 };
+ * 		values.copyOf(3).sort();
+ * 	}
+ * }
+ * 
+ * + * After: + * + *
+ * class Example {
+ * 	private void example() {
+ * 		long[] values = new long[] { 2, 5, 7, 9 };
+ * 		java.util.Arrays.sort(java.util.Arrays.copyOf(values, 3));
+ * 	}
+ * }
+ * 
+ */ +@Target(TYPE) +@Retention(SOURCE) +public @interface ExtensionMethod { + /** @return All types whose static methods will be exposed as extension methods. */ + Class[] value(); + + /** + * If {@code true}, an applicable extension method is used (if found) even if the method call already was compilable (this is the default). + * If {@code false}, an extension method is only used if the method call is not also defined by the type itself. + * + * @return Whether or not to override already existing methods with the extension. + */ + boolean suppressBaseMethods() default true; +} diff --git a/plugins/lombok/generated/src/lombok/experimental/FieldDefaults.java b/plugins/lombok/generated/src/lombok/experimental/FieldDefaults.java new file mode 100644 index 000000000000..5c387bb66a34 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/experimental/FieldDefaults.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2012-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.experimental; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import lombok.AccessLevel; + +/** + * Adds modifiers to each field in the type with this annotation. + *

+ * Complete documentation is found at the project lombok features page for @FieldDefaults. + *

+ * If {@code makeFinal} is {@code true}, then each (instance) field that is not annotated with {@code @NonFinal} will have the {@code final} modifier added. + *

+ * If {@code level} is set, then each (instance) field that is package private (i.e. no access modifier) and does not have the {@code @PackagePrivate} annotation will + * have the appropriate access level modifier added. + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.SOURCE) +public @interface FieldDefaults { + AccessLevel level() default AccessLevel.NONE; + boolean makeFinal() default false; +} diff --git a/plugins/lombok/generated/src/lombok/experimental/FieldNameConstants.java b/plugins/lombok/generated/src/lombok/experimental/FieldNameConstants.java new file mode 100644 index 000000000000..da97a7218ef9 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/experimental/FieldNameConstants.java @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2014-2018 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.experimental; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import lombok.AccessLevel; + +/** + * Generates an inner type, containing String constants containing the field name for each field. Alternatively, generates an inner enum with enum values matching each field name. + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.SOURCE) +public @interface FieldNameConstants { + lombok.AccessLevel level() default AccessLevel.PUBLIC; + boolean asEnum() default false; + String innerTypeName() default ""; + + /** + * Only include fields and methods explicitly marked with {@code @FieldNameConstants.Include}. + * Normally, all (non-static) fields are included by default. + * + * @return If {@code true}, don't include non-static fields automatically (default: {@code false}). + */ + boolean onlyExplicitlyIncluded() default false; + + /** + * If present, do not include this field in the generated fieldnames inner type. + */ + @Target(ElementType.FIELD) + @Retention(RetentionPolicy.SOURCE) + public @interface Exclude {} + + /** + * If present, include this field in the generated fieldnames inner type (default). + */ + @Target(ElementType.FIELD) + @Retention(RetentionPolicy.SOURCE) + public @interface Include {} +} diff --git a/plugins/lombok/generated/src/lombok/experimental/Helper.java b/plugins/lombok/generated/src/lombok/experimental/Helper.java new file mode 100644 index 000000000000..34745cbefdad --- /dev/null +++ b/plugins/lombok/generated/src/lombok/experimental/Helper.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2015 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.experimental; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Use on a method local class to indicate that all methods inside should be exposed to the rest of + * the method as if they were helper methods. + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.SOURCE) +public @interface Helper {} diff --git a/plugins/lombok/generated/src/lombok/experimental/NonFinal.java b/plugins/lombok/generated/src/lombok/experimental/NonFinal.java new file mode 100644 index 000000000000..12a45d229312 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/experimental/NonFinal.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2012 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.experimental; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Used to indicate the explicit intention for the annotated entity to not be {@code final}. + * Currently used by {@code FieldDefaults} and {@code Value} to avoid having it make a field final. + */ +@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.METHOD}) +@Retention(RetentionPolicy.SOURCE) +public @interface NonFinal {} diff --git a/plugins/lombok/generated/src/lombok/experimental/PackagePrivate.java b/plugins/lombok/generated/src/lombok/experimental/PackagePrivate.java new file mode 100644 index 000000000000..4200281868c2 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/experimental/PackagePrivate.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2012 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.experimental; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Used to indicate the explicit intention for the annotated entity to have the package private access level. + * Currently used by {@code FieldDefaults} and {@code Value} to avoid having it make a field one of {@code public}, {@code protected}, or {@code private}. + */ +@Target({ElementType.TYPE, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.ANNOTATION_TYPE}) +@Retention(RetentionPolicy.SOURCE) +public @interface PackagePrivate {} diff --git a/plugins/lombok/generated/src/lombok/experimental/SuperBuilder.java b/plugins/lombok/generated/src/lombok/experimental/SuperBuilder.java new file mode 100644 index 000000000000..aef76a46893a --- /dev/null +++ b/plugins/lombok/generated/src/lombok/experimental/SuperBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2018 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.experimental; + +import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.RetentionPolicy.*; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import lombok.Singular; + +/** + * The SuperBuilder annotation creates a so-called 'builder' aspect to the class that is annotated with {@code @SuperBuilder}, but which works well when extending. + * It is similar to {@code @Builder}, except it is only legal on types, is less configurable, but allows you to {@code extends} other builder-able classes. + *

+ * All classes in the hierarchy must be annotated with {@code @SuperBuilder}. + *

+ * Lombok generates 2 inner 'builder' classes, which extend the parent class' builder class (unless your class doesn't have an extends clause). + * Lombok also generates a static method named {@code builder()}, and a protected constructor that takes 1 argument of the builderclass type. + *

+ * The TBuilder class contains 1 method for each parameter of the annotated + * constructor / method (each field, when annotating a class), which returns the builder itself. + * The builder also has a build() method which returns a completed instance of the original type. + *

+ * Complete documentation is found at the project lombok features page for @SuperBuilder. + * + * @see Singular + */ +@Target(TYPE) +@Retention(SOURCE) +public @interface SuperBuilder { + /** @return Name of the method that creates a new builder instance. Default: {@code builder}. If the empty string, suppress generating the {@code builder} method. */ + String builderMethodName() default "builder"; + + /** @return Name of the method in the builder class that creates an instance of your {@code @Builder}-annotated class. */ + String buildMethodName() default "build"; + + /** + * If true, generate an instance method to obtain a builder that is initialized with the values of this instance. + * In this case, all superclasses must also have toBuilder=true. + * + * @return Whether to generate a {@code toBuilder()} method. + */ + boolean toBuilder() default false; +} diff --git a/plugins/lombok/generated/src/lombok/experimental/Tolerate.java b/plugins/lombok/generated/src/lombok/experimental/Tolerate.java new file mode 100644 index 000000000000..4bc04b8b055f --- /dev/null +++ b/plugins/lombok/generated/src/lombok/experimental/Tolerate.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2014 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.experimental; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Put on any method or constructor to make lombok pretend it doesn't exist, + * i.e., to generate a method which would otherwise be skipped due to possible conflicts. + */ +@Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) +@Retention(RetentionPolicy.SOURCE) +public @interface Tolerate { +} diff --git a/plugins/lombok/generated/src/lombok/experimental/UtilityClass.java b/plugins/lombok/generated/src/lombok/experimental/UtilityClass.java new file mode 100644 index 000000000000..f8281660561a --- /dev/null +++ b/plugins/lombok/generated/src/lombok/experimental/UtilityClass.java @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2015-2019 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.experimental; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * An annotation to create utility classes. + * + * If a class is annotated with {@code @UtilityClass}, the following things happen to it:

    + *
  • It is marked final.
  • + *
  • If any constructors are declared in it, an error is generated. Otherwise, a private no-args constructor is generated; it throws a {@code UnsupportedOperationException}.
  • + *
  • All methods, inner classes, and fields in the class are marked static.
  • + *
  • WARNING: Do not use non-star static imports to import these members; javac won't be able to figure it out. Use either: + * import static ThisType.*; or don't static-import.
  • + *
+ */ +@Target({ElementType.TYPE}) +@Retention(RetentionPolicy.SOURCE) +public @interface UtilityClass { +} diff --git a/plugins/lombok/generated/src/lombok/experimental/Wither.java b/plugins/lombok/generated/src/lombok/experimental/Wither.java new file mode 100644 index 000000000000..cf20c1ebbf5e --- /dev/null +++ b/plugins/lombok/generated/src/lombok/experimental/Wither.java @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2012-2019 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.experimental; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import lombok.AccessLevel; + +/** + * Put on any field to make lombok build a 'wither' - a withX method which produces a clone of this object (except for 1 field which gets a new value). + *

+ * Complete documentation is found at the project lombok features page for @Wither. + *

+ * Even though it is not listed, this annotation also has the {@code onParam} and {@code onMethod} parameter. See the full documentation for more details. + *

+ * Example: + *

+ *     private @Wither final int foo;
+ * 
+ * + * will generate: + * + *
+ *     public SELF_TYPE withFoo(int foo) {
+ *         return this.foo == foo ? this : new SELF_TYPE(otherField1, otherField2, foo);
+ *     }
+ * 
+ *

+ * This annotation can also be applied to a class, in which case it'll be as if all non-static fields that don't already have + * a {@code Wither} annotation have the annotation. + * + * @deprecated {@link lombok.With} has been promoted to the main package, so use that one instead. + */ +@Target({ElementType.FIELD, ElementType.TYPE}) +@Retention(RetentionPolicy.SOURCE) +public @interface Wither { + /** + * If you want your wither to be non-public, you can specify an alternate access level here. + * + * @return The method will be generated with this access modifier. + */ + AccessLevel value() default AccessLevel.PUBLIC; + + /** + * Any annotations listed here are put on the generated method. + * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).
+ * up to JDK7:
+ * {@code @Wither(onMethod=@__({@AnnotationsGoHere}))}
+ * from JDK8:
+ * {@code @Wither(onMethod_={@AnnotationsGohere})} // note the underscore after {@code onMethod}. + * + * @return List of annotations to apply to the generated method. + */ + AnyAnnotation[] onMethod() default {}; + + /** + * Any annotations listed here are put on the generated method's parameter. + * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).
+ * up to JDK7:
+ * {@code @Wither(onParam=@__({@AnnotationsGoHere}))}
+ * from JDK8:
+ * {@code @Wither(onParam_={@AnnotationsGohere})} // note the underscore after {@code onParam}. + * + * @return List of annotations to apply to the generated parameter in the method. + */ + AnyAnnotation[] onParam() default {}; + + /** + * Placeholder annotation to enable the placement of annotations on the generated code. + * @deprecated Don't use this annotation, ever - Read the documentation. + */ + @Deprecated + @Retention(RetentionPolicy.SOURCE) + @Target({}) + @interface AnyAnnotation {} +} diff --git a/plugins/lombok/generated/src/lombok/experimental/package-info.java b/plugins/lombok/generated/src/lombok/experimental/package-info.java new file mode 100644 index 000000000000..22b23a527a03 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/experimental/package-info.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2009-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +/** + * This package contains the annotations and support classes you need as a user of lombok, for + * all features which aren't (yet) supported as a first class feature. Features that involve the + * annotations and support classes in this package may change or may be removed entirely in future versions, + * and bugs may not be solved as expediently. For the status and likely future of any feature, refer + * to the official feature documentation. + * + * @see lombok + * @see Lombok features (experimental) + */ +package lombok.experimental; diff --git a/plugins/lombok/generated/src/lombok/experimental/var.java b/plugins/lombok/generated/src/lombok/experimental/var.java new file mode 100644 index 000000000000..71cc141add46 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/experimental/var.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2010-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.experimental; + +/** + * like val but not final + * + * @deprecated {@code var} has been promoted to the main package; use {@link lombok.var} instead. + */ +@Deprecated +public @interface var { +} diff --git a/plugins/lombok/generated/src/lombok/extern/apachecommons/CommonsLog.java b/plugins/lombok/generated/src/lombok/extern/apachecommons/CommonsLog.java new file mode 100644 index 000000000000..ca808329dd70 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/extern/apachecommons/CommonsLog.java @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2010-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.extern.apachecommons; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Causes lombok to generate a logger field. + *

+ * Complete documentation is found at the project lombok features page for lombok log annotations. + *

+ * Example: + *

+ * @CommonsLog
+ * public class LogExample {
+ * }
+ * 
+ * + * will generate: + * + *
+ * public class LogExample {
+ *     private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(LogExample.class);
+ * }
+ * 
+ * + * This annotation is valid for classes and enumerations.
+ * + * @see org.apache.commons.logging.Log + * @see org.apache.commons.logging.LogFactory#getLog(java.lang.Class) + * @see lombok.extern.java.Log @Log + * @see lombok.extern.log4j.Log4j @Log4j + * @see lombok.extern.log4j.Log4j2 @Log4j2 + * @see lombok.extern.slf4j.Slf4j @Slf4j + * @see lombok.extern.slf4j.XSlf4j @XSlf4j + * @see lombok.extern.jbosslog.JBossLog @JBossLog + * @see lombok.extern.flogger.Flogger @Flogger + * @see lombok.CustomLog @CustomLog + */ +@Retention(RetentionPolicy.SOURCE) +@Target(ElementType.TYPE) +public @interface CommonsLog { + /** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */ + String topic() default ""; +} diff --git a/plugins/lombok/generated/src/lombok/extern/flogger/Flogger.java b/plugins/lombok/generated/src/lombok/extern/flogger/Flogger.java new file mode 100644 index 000000000000..3446e949c322 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/extern/flogger/Flogger.java @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2018 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.extern.flogger; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Causes lombok to generate a logger field. + *

+ * Complete documentation is found at the project lombok features page for lombok log annotations. + *

+ * Example: + *

+ * @Flogger
+ * public class LogExample {
+ * }
+ * 
+ * + * will generate: + * + *
+ * public class LogExample {
+ *     private static final com.google.common.flogger.FluentLogger log = com.google.common.flogger.FluentLogger.forEnclosingClass();
+ * }
+ * 
+ * + * This annotation is valid for classes and enumerations.
+ * @see com.google.common.flogger + * @see lombok.extern.apachecommons.CommonsLog @CommonsLog + * @see lombok.extern.java.Log @Log + * @see lombok.extern.log4j.Log4j @Log4j + * @see lombok.extern.log4j.Log4j2 @Log4j2 + * @see lombok.extern.slf4j.Slf4j @Slf4j + * @see lombok.extern.slf4j.XSlf4j @XSlf4j + * @see lombok.extern.jbosslog.JBossLog @JBossLog + * @see lombok.CustomLog @CustomLog + */ +@Retention(RetentionPolicy.SOURCE) +@Target(ElementType.TYPE) +public @interface Flogger { +} diff --git a/plugins/lombok/generated/src/lombok/extern/java/Log.java b/plugins/lombok/generated/src/lombok/extern/java/Log.java new file mode 100644 index 000000000000..f2b5024f6228 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/extern/java/Log.java @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2010-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.extern.java; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Causes lombok to generate a logger field. + *

+ * Complete documentation is found at the project lombok features page for lombok log annotations. + *

+ * Example: + *

+ * @Log
+ * public class LogExample {
+ * }
+ * 
+ * + * will generate: + * + *
+ * public class LogExample {
+ *     private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(LogExample.class.getName());
+ * }
+ * 
+ * + * This annotation is valid for classes and enumerations.
+ * @see java.util.logging.Logger + * @see java.util.logging.Logger#getLogger(java.lang.String) + * @see lombok.extern.apachecommons.CommonsLog @CommonsLog + * @see lombok.extern.log4j.Log4j @Log4j + * @see lombok.extern.log4j.Log4j2 @Log4j2 + * @see lombok.extern.slf4j.Slf4j @Slf4j + * @see lombok.extern.slf4j.XSlf4j @XSlf4j + * @see lombok.extern.jbosslog.JBossLog @JBossLog + * @see lombok.extern.flogger.Flogger @Flogger + * @see lombok.CustomLog @CustomLog + */ +@Retention(RetentionPolicy.SOURCE) +@Target(ElementType.TYPE) +public @interface Log { + /** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */ + String topic() default ""; +} diff --git a/plugins/lombok/generated/src/lombok/extern/jbosslog/JBossLog.java b/plugins/lombok/generated/src/lombok/extern/jbosslog/JBossLog.java new file mode 100644 index 000000000000..960a111bc7f8 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/extern/jbosslog/JBossLog.java @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2016-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.extern.jbosslog; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Causes lombok to generate a logger field. + *

+ * Complete documentation is found at the project lombok features page for lombok log annotations. + *

+ * Example: + *

+ * @JBossLog
+ * public class LogExample {
+ * }
+ * 
+ * + * will generate: + * + *
+ * public class LogExample {
+ *     private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LogExample.class);
+ * }
+ * 
+ * + * This annotation is valid for classes and enumerations.
+ * @see org.jboss.logging.Logger + * @see org.jboss.logging.Logger#getLogger(java.lang.Class) + * @see lombok.extern.apachecommons.CommonsLog @CommonsLog + * @see lombok.extern.java.Log @Log + * @see lombok.extern.log4j.Log4j @Log4j + * @see lombok.extern.log4j.Log4j2 @Log4j2 + * @see lombok.extern.slf4j.Slf4j @Slf4j + * @see lombok.extern.slf4j.XSlf4j @XSlf4j + * @see lombok.extern.flogger.Flogger @Flogger + * @see lombok.CustomLog @CustomLog + */ +@Retention(RetentionPolicy.SOURCE) +@Target(ElementType.TYPE) +public @interface JBossLog { + /** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */ + String topic() default ""; +} diff --git a/plugins/lombok/generated/src/lombok/extern/log4j/Log4j.java b/plugins/lombok/generated/src/lombok/extern/log4j/Log4j.java new file mode 100644 index 000000000000..1b4a973b2738 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/extern/log4j/Log4j.java @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2010-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.extern.log4j; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Causes lombok to generate a logger field. + *

+ * Complete documentation is found at the project lombok features page for lombok log annotations. + *

+ * Example: + *

+ * @Log4j
+ * public class LogExample {
+ * }
+ * 
+ * + * will generate: + * + *
+ * public class LogExample {
+ *     private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(LogExample.class);
+ * }
+ * 
+ * + * This annotation is valid for classes and enumerations.
+ * + * @see org.apache.log4j.Logger + * @see org.apache.log4j.Logger#getLogger(java.lang.Class) + * @see lombok.extern.log4j.Log4j2 @Log4j2 + * @see lombok.extern.apachecommons.CommonsLog @CommonsLog + * @see lombok.extern.java.Log @Log + * @see lombok.extern.slf4j.Slf4j @Slf4j + * @see lombok.extern.slf4j.XSlf4j @XSlf4j + * @see lombok.extern.jbosslog.JBossLog @JBossLog + * @see lombok.extern.flogger.Flogger @Flogger + * @see lombok.CustomLog @CustomLog + */ +@Retention(RetentionPolicy.SOURCE) +@Target(ElementType.TYPE) +public @interface Log4j { + /** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */ + String topic() default ""; +} diff --git a/plugins/lombok/generated/src/lombok/extern/log4j/Log4j2.java b/plugins/lombok/generated/src/lombok/extern/log4j/Log4j2.java new file mode 100644 index 000000000000..571b056316ef --- /dev/null +++ b/plugins/lombok/generated/src/lombok/extern/log4j/Log4j2.java @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2013-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.extern.log4j; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Causes lombok to generate a logger field. + *

+ * Complete documentation is found at the project lombok features page for lombok log annotations. + *

+ * Example: + *

+ * @Log4j2
+ * public class LogExample {
+ * }
+ * 
+ * + * will generate: + * + *
+ * public class LogExample {
+ *     private static final org.apache.logging.log4j.Logger log = org.apache.logging.log4j.LogManager.getLogger(LogExample.class);
+ * }
+ * 
+ * + * This annotation is valid for classes and enumerations.
+ * + * @see org.apache.logging.log4j.Logger + * @see org.apache.logging.log4j.LogManager#getLogger(java.lang.Class) + * @see lombok.extern.log4j.Log4j @Log4j + * @see lombok.extern.apachecommons.CommonsLog @CommonsLog + * @see lombok.extern.java.Log @Log + * @see lombok.extern.slf4j.Slf4j @Slf4j + * @see lombok.extern.slf4j.XSlf4j @XSlf4j + * @see lombok.extern.jbosslog.JBossLog @JBossLog + * @see lombok.extern.flogger.Flogger @Flogger + * @see lombok.CustomLog @CustomLog + */ +@Retention(RetentionPolicy.SOURCE) +@Target(ElementType.TYPE) +public @interface Log4j2 { + /** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */ + String topic() default ""; +} diff --git a/plugins/lombok/generated/src/lombok/extern/slf4j/Slf4j.java b/plugins/lombok/generated/src/lombok/extern/slf4j/Slf4j.java new file mode 100644 index 000000000000..c4aded24e2a2 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/extern/slf4j/Slf4j.java @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2010-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.extern.slf4j; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Causes lombok to generate a logger field. + *

+ * Complete documentation is found at the project lombok features page for lombok log annotations. + *

+ * Example: + *

+ * @Slf4j
+ * public class LogExample {
+ * }
+ * 
+ * + * will generate: + * + *
+ * public class LogExample {
+ *     private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LogExample.class);
+ * }
+ * 
+ * + * This annotation is valid for classes and enumerations.
+ * @see org.slf4j.Logger + * @see org.slf4j.LoggerFactory#getLogger(java.lang.Class) + * @see lombok.extern.apachecommons.CommonsLog @CommonsLog + * @see lombok.extern.java.Log @Log + * @see lombok.extern.log4j.Log4j @Log4j + * @see lombok.extern.log4j.Log4j2 @Log4j2 + * @see lombok.extern.slf4j.XSlf4j @XSlf4j + * @see lombok.extern.jbosslog.JBossLog @JBossLog + * @see lombok.extern.flogger.Flogger @Flogger + * @see lombok.CustomLog @CustomLog + */ +@Retention(RetentionPolicy.SOURCE) +@Target(ElementType.TYPE) +public @interface Slf4j { + /** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */ + String topic() default ""; +} + diff --git a/plugins/lombok/generated/src/lombok/extern/slf4j/XSlf4j.java b/plugins/lombok/generated/src/lombok/extern/slf4j/XSlf4j.java new file mode 100644 index 000000000000..b99554a562a3 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/extern/slf4j/XSlf4j.java @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2012-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok.extern.slf4j; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Causes lombok to generate a logger field. + *

+ * Complete documentation is found at the project lombok features page for lombok log annotations. + *

+ * Example: + *

+ * @XSlf4j
+ * public class LogExample {
+ * }
+ * 
+ * + * will generate: + * + *
+ * public class LogExample {
+ *     private static final org.slf4j.ext.XLogger log = org.slf4j.ext.XLoggerFactory.getXLogger(LogExample.class);
+ * }
+ * 
+ * + * This annotation is valid for classes and enumerations.
+ * @see org.slf4j.ext.XLogger + * @see org.slf4j.ext.XLoggerFactory#getLogger(java.lang.Class) + * @see lombok.extern.apachecommons.CommonsLog @CommonsLog + * @see lombok.extern.java.Log @Log + * @see lombok.extern.log4j.Log4j @Log4j + * @see lombok.extern.log4j.Log4j2 @Log4j2 + * @see lombok.extern.slf4j.Slf4j @Slf4j + * @see lombok.extern.jbosslog.JBossLog @JBossLog + * @see lombok.extern.flogger.Flogger @Flogger + * @see lombok.CustomLog @CustomLog + */ +@Retention(RetentionPolicy.SOURCE) +@Target(ElementType.TYPE) +public @interface XSlf4j { + /** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */ + String topic() default ""; +} diff --git a/plugins/lombok/generated/src/lombok/val.java b/plugins/lombok/generated/src/lombok/val.java new file mode 100644 index 000000000000..a69d514c4641 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/val.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2010-2017 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +/** + * Use {@code val} as the type of any local variable declaration (even in a for-each statement), and the type will be inferred from the initializing expression. + * For example: {@code val x = 10.0;} will infer {@code double}, and {@code val y = new ArrayList();} will infer {@code ArrayList}. The local variable + * will also be made final. + *

+ * Note that this is an annotation type because {@code val x = 10;} will be desugared to {@code @val final int x = 10;} + *

+ * Complete documentation is found at the project lombok features page for @val. + */ +public @interface val { +} diff --git a/plugins/lombok/generated/src/lombok/var.java b/plugins/lombok/generated/src/lombok/var.java new file mode 100644 index 000000000000..63a70213d155 --- /dev/null +++ b/plugins/lombok/generated/src/lombok/var.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2010-2018 The Project Lombok Authors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package lombok; + +/** + * Use {@code var} as the type of any local variable declaration (even in a {@code for} statement), and the type will be inferred from the initializing expression + * (any further assignments to the variable are not involved in this type inference). + *

+ * For example: {@code var x = 10.0;} will infer {@code double}, and {@code var y = new ArrayList();} will infer {@code ArrayList}. + *

+ * Note that this is an annotation type because {@code var x = 10;} will be desugared to {@code @var int x = 10;} + *

+ * Complete documentation is found at the project lombok features page for @var. + */ +public @interface var { +}