provide keypath replacement
This commit is contained in:
parent
6764720664
commit
8c5efc3573
@ -13,6 +13,7 @@ import java.util.regex.Pattern;
|
|||||||
* The respective layer (io, presentation) is responsible for using the correct mapping mechanism.
|
* The respective layer (io, presentation) is responsible for using the correct mapping mechanism.
|
||||||
* @author marhali
|
* @author marhali
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public class KeyPath extends ArrayList<String> {
|
public class KeyPath extends ArrayList<String> {
|
||||||
|
|
||||||
public static final String DELIMITER = ".";
|
public static final String DELIMITER = ".";
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
package de.marhali.easyi18n.model.translation;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents the absolute key path for a desired translation.
|
||||||
|
* The key could be based one or many sections.
|
||||||
|
* Classes implementing this structure need to take care on how to layer translations paths.
|
||||||
|
* @author marhali
|
||||||
|
*/
|
||||||
|
public class KeyPath extends ArrayList<String> {
|
||||||
|
|
||||||
|
public KeyPath() {}
|
||||||
|
|
||||||
|
public KeyPath(@Nullable String... path) {
|
||||||
|
super.addAll(List.of(path));
|
||||||
|
}
|
||||||
|
|
||||||
|
public KeyPath(@NotNull List<String> path) {
|
||||||
|
super(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
public KeyPath(@NotNull KeyPath path, @Nullable String... pathToAppend) {
|
||||||
|
this(path);
|
||||||
|
super.addAll(List.of(pathToAppend));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
// Just a simple array view (e.g. [first, second]) - use KeyPathConverter to properly convert a key path
|
||||||
|
return super.toString();
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user