public class NbtConfigurationSerializer
extends java.lang.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 java.lang.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(java.lang.String dataTypeDelimiter)
Construct a serializer using the given value as a delimiter.
|
Modifier and Type | Method and Description |
---|---|
<TType> NbtWrapper<TType> |
deserialize(ConfigurationSection root,
java.lang.String nodeName)
Read a NBT tag from a root configuration.
|
NbtCompound |
deserializeCompound(YamlConfiguration root,
java.lang.String nodeName)
Read a NBT compound from a root configuration.
|
<T> NbtList<T> |
deserializeList(YamlConfiguration root,
java.lang.String nodeName)
Read a NBT compound from a root configuration.
|
java.lang.String |
getDataTypeDelimiter()
Retrieve the current data type delimiter.
|
<TType> void |
serialize(NbtBase<TType> value,
ConfigurationSection destination)
Write the content of a NBT tag to a configuration section.
|
java.lang.Object |
toNodeValue(java.lang.Object value,
NbtType type) |
public static final java.lang.String TYPE_DELIMITER
public static final NbtConfigurationSerializer DEFAULT
public NbtConfigurationSerializer()
TYPE_DELIMITER
as the default delimiter.public NbtConfigurationSerializer(java.lang.String dataTypeDelimiter)
dataTypeDelimiter
- - the local data type delimiter.public java.lang.String getDataTypeDelimiter()
public <TType> void serialize(NbtBase<TType> value, ConfigurationSection destination)
value
- - the NBT tag to write.destination
- - the destination section.public <TType> NbtWrapper<TType> deserialize(ConfigurationSection root, java.lang.String nodeName)
root
- - configuration that contains the NBT tag.nodeName
- - name of the NBT tag.public NbtCompound deserializeCompound(YamlConfiguration root, java.lang.String nodeName)
root
- - configuration that contains the NBT compound.nodeName
- - name of the NBT compound.public <T> NbtList<T> deserializeList(YamlConfiguration root, java.lang.String nodeName)
root
- - configuration that contains the NBT compound.nodeName
- - name of the NBT compound.public java.lang.Object toNodeValue(java.lang.Object value, NbtType type)