public class NbtConfigurationSerializer extends Object
Note that data types may be internally preserved by modifying the serialized name. This may be visible to the end-user.
| Modifier and Type | Field and Description |
|---|---|
static NbtConfigurationSerializer |
DEFAULT
A standard YAML serializer.
|
static String |
TYPE_DELIMITER
The default delimiter that is used to store the data type in YAML.
|
| Constructor and Description |
|---|
NbtConfigurationSerializer()
Construct a serializer using
TYPE_DELIMITER as the default delimiter. |
NbtConfigurationSerializer(String dataTypeDelimiter)
Construct a serializer using the given value as a delimiter.
|
| Modifier and Type | Method and Description |
|---|---|
<TType> NbtWrapper<TType> |
deserialize(org.bukkit.configuration.ConfigurationSection root,
String nodeName)
Read a NBT tag from a root configuration.
|
NbtCompound |
deserializeCompound(org.bukkit.configuration.file.YamlConfiguration root,
String nodeName)
Read a NBT compound from a root configuration.
|
<T> NbtList<T> |
deserializeList(org.bukkit.configuration.file.YamlConfiguration root,
String nodeName)
Read a NBT compound from a root configuration.
|
String |
getDataTypeDelimiter()
Retrieve the current data type delimiter.
|
<TType> void |
serialize(NbtBase<TType> value,
org.bukkit.configuration.ConfigurationSection destination)
Write the content of a NBT tag to a configuration section.
|
Object |
toNodeValue(Object value,
NbtType type) |
public static final String TYPE_DELIMITER
public static final NbtConfigurationSerializer DEFAULT
public NbtConfigurationSerializer()
TYPE_DELIMITER as the default delimiter.public NbtConfigurationSerializer(String dataTypeDelimiter)
dataTypeDelimiter - - the local data type delimiter.public String getDataTypeDelimiter()
public <TType> void serialize(NbtBase<TType> value, org.bukkit.configuration.ConfigurationSection destination)
TType - Typevalue - - the NBT tag to write.destination - - the destination section.public <TType> NbtWrapper<TType> deserialize(org.bukkit.configuration.ConfigurationSection root, String nodeName)
TType - Typeroot - - configuration that contains the NBT tag.nodeName - - name of the NBT tag.public NbtCompound deserializeCompound(org.bukkit.configuration.file.YamlConfiguration root, String nodeName)
root - - configuration that contains the NBT compound.nodeName - - name of the NBT compound.public <T> NbtList<T> deserializeList(org.bukkit.configuration.file.YamlConfiguration root, String nodeName)
T - Typeroot - - configuration that contains the NBT compound.nodeName - - name of the NBT compound.Copyright © 2012–2017 Comphenix and dmulloy2. Licensed under the GNU GPL v2.