Class MutableTomlTable
java.lang.Object
org.tomlj.MutableTomlTable
- All Implemented Interfaces:
TomlTable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate TomlPositionprivate final Map<String, MutableTomlTable.Element> private final TomlVersion -
Constructor Summary
ConstructorsConstructorDescriptionMutableTomlTable(TomlVersion version) MutableTomlTable(TomlVersion version, TomlPosition definedAt) -
Method Summary
Modifier and TypeMethodDescription(package private) MutableTomlTablecreateTable(List<String> path, TomlPosition position) (package private) MutableTomlTablecreateTableArray(List<String> path, TomlPosition position) (package private) voiddefine(TomlPosition position) ensureTable(List<String> path, TomlPosition position, boolean followTableArrays, boolean followDefinedTables) Ensure a table exists at a given path.entryPathSet(boolean includeTables) Get all the entries in this table.entrySet()Get the entries of this table.@Nullable ObjectGet a value from the TOML document.private MutableTomlTable.ElementgetElement(List<String> path) @Nullable TomlPositioninputPositionOf(List<String> path) Get the position where a key is defined in the TOML document.(package private) booleanbooleanisEmpty()trueif there are no entries in this table.keyPathSet(boolean includeTables) Get all the paths in this table.keySet()Get the keys of this table.(package private) List<AbstractMap.SimpleEntry<MutableTomlTable, TomlPosition>> set(String keyPath, Object value, TomlPosition position) (package private) List<AbstractMap.SimpleEntry<MutableTomlTable, TomlPosition>> set(List<String> path, Object value, TomlPosition position) intsize()Return the number of entries in tis table.toMap()Get the elements of this array as aMap.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface TomlTable
contains, contains, dottedEntrySet, dottedEntrySet, dottedKeySet, dottedKeySet, entryPathSet, get, getArray, getArray, getArrayOrEmpty, getArrayOrEmpty, getBoolean, getBoolean, getBoolean, getBoolean, getDouble, getDouble, getDouble, getDouble, getLocalDate, getLocalDate, getLocalDate, getLocalDate, getLocalDateTime, getLocalDateTime, getLocalDateTime, getLocalDateTime, getLocalTime, getLocalTime, getLocalTime, getLocalTime, getLong, getLong, getLong, getLong, getOffsetDateTime, getOffsetDateTime, getOffsetDateTime, getOffsetDateTime, getString, getString, getString, getString, getTable, getTable, getTableOrEmpty, getTableOrEmpty, inputPositionOf, isArray, isArray, isBoolean, isBoolean, isDouble, isDouble, isLocalDate, isLocalDate, isLocalDateTime, isLocalDateTime, isLocalTime, isLocalTime, isLong, isLong, isOffsetDateTime, isOffsetDateTime, isString, isString, isTable, isTable, keyPathSet, toJson, toJson, toJson, toJson, toToml, toToml
-
Field Details
-
properties
-
version
-
definedAt
-
-
Constructor Details
-
MutableTomlTable
MutableTomlTable(TomlVersion version, TomlPosition definedAt) -
MutableTomlTable
MutableTomlTable(TomlVersion version)
-
-
Method Details
-
isDefined
boolean isDefined() -
define
-
size
-
isEmpty
-
keySet
Description copied from interface:TomlTableGet the keys of this table.The returned set contains only immediate keys to this table, and not dotted keys or key paths. For a complete view of keys available in the TOML document, use
TomlTable.dottedKeySet()orTomlTable.keyPathSet(). -
keyPathSet
Description copied from interface:TomlTableGet all the paths in this table.- Specified by:
keyPathSetin interfaceTomlTable- Parameters:
includeTables- Iftrue, also include paths to intermediary and empty tables.- Returns:
- A set containing all the key paths of this table.
-
entrySet
Description copied from interface:TomlTableGet the entries of this table.The returned set contains only immediate entries of this table, and not entries with dotted keys or key paths. For a complete view of all entries available in the TOML document, use
TomlTable.dottedEntrySet()orTomlTable.entryPathSet(). -
entryPathSet
Description copied from interface:TomlTableGet all the entries in this table.- Specified by:
entryPathSetin interfaceTomlTable- Parameters:
includeTables- Iftrue, also include entries in intermediary and empty tables.- Returns:
- A set containing all the entries of this table.
-
get
-
inputPositionOf
Description copied from interface:TomlTableGet the position where a key is defined in the TOML document.- Specified by:
inputPositionOfin interfaceTomlTable- Parameters:
path- The key path.- Returns:
- The input position, or
nullif the key was not set in the TOML document.
-
getElement
-
toMap
-
createTable
-
createTableArray
-
set
List<AbstractMap.SimpleEntry<MutableTomlTable, TomlPosition>> set(String keyPath, Object value, TomlPosition position) -
set
List<AbstractMap.SimpleEntry<MutableTomlTable, TomlPosition>> set(List<String> path, Object value, TomlPosition position) -
ensureTable
private MutableTomlTable.EnsureTableResult ensureTable(List<String> path, TomlPosition position, boolean followTableArrays, boolean followDefinedTables) Ensure a table exists at a given path.- Parameters:
path- The path to ensure exists (as a table)position- The input position.followTableArrays- If `true`, path walking is permitted via the last element of array tables.followDefinedTables- Allow path walking through defined tables.- Returns:
- The
- Throws:
TomlParseError- If the table cannot be created.
-