-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Generate enum with no keys for large properties files
Use EnumType#NO_KEYS in @L10nProperties to generate an enum with no keys. This can be used to work with large properties files that generate the following compilation error: "error: code too large" when the enum becomes too large with {@link #KEYS_ONLY} due the number of keys. Obviously strong typing does not apply anymore but other enum attribute can be used for example to create an instance of L10nMessages with {@link L10nMessages#builder(Class)}
- Loading branch information
Showing
7 changed files
with
109 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...sources/com/pinterest/l10nmessages/L10nPropertiesProcessorTest_IO/validNoKey/TestApp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.pinterest.l10nmessages.L10nPropertiesProcessorTest_IO.valid; | ||
|
||
import com.pinterest.l10nmessages.EnumType; | ||
import com.pinterest.l10nmessages.L10nProperties; | ||
|
||
@L10nProperties(baseName = "com.pinterest.l10nmessages.L10nPropertiesProcessorTest_IO.validNoKey.TestMessages", | ||
enumType = EnumType.NO_KEYS) | ||
public class TestApp { | ||
} |
12 changes: 12 additions & 0 deletions
12
...es/com/pinterest/l10nmessages/L10nPropertiesProcessorTest_IO/validNoKey/TestMessages.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.pinterest.l10nmessages.L10nPropertiesProcessorTest_IO.validNoKey; | ||
|
||
import javax.annotation.Generated; | ||
|
||
@Generated("com.pinterest.l10nmessages.L10nPropertiesProcessor") | ||
public enum TestMessages { | ||
; | ||
|
||
public static final String BASENAME = "com.pinterest.l10nmessages.L10nPropertiesProcessorTest_IO.validNoKey.TestMessages"; | ||
public static final String MESSAGE_FORMAT_ADAPTER_PROVIDERS = "AUTO"; | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
.../pinterest/l10nmessages/L10nPropertiesProcessorTest_IO/validNoKey/TestMessages.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hello_user=Hello {username} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters