Package me.deecaad.core.file
Interface InlineSerializer<T>
- All Superinterfaces:
net.kyori.adventure.key.Keyed,org.bukkit.Keyed,Serializer<T>
- All Known Implementing Classes:
ActionBarMechanic,ActivateBlockMechanic,BiomeCondition,BossBarMechanic,CommandMechanic,Condition,CustomSoundMechanic,DamageMechanic,DropItemMechanic,EntityTypeCondition,FireworkMechanic,FireworkMechanic.FireworkData,GlidingCondition,HasPermissionCondition,IgniteMechanic,InConeCondition,LeapMechanic,LightLevelCondition,LightningMechanic,MaterialCategoryCondition,Mechanic,MessageMechanic,OnGroundCondition,PlayerEffectMechanic,PlayerEffectMechanicList,PotionMechanic,PushMechanic,RangeCondition,RelativeTargeter,RidingCondition,ScatterTargeter,SculkBloomMechanic,SculkShriekMechanic,ServerPlayersTargeter,ShapeTargeter,SneakingCondition,SoundMechanic,SourceTargeter,SprintingCondition,Targeter,TargetTargeter,TitleMechanic,WorldPlayersTargeter,WorldTargeter
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classThis exception is used whenever the user inputs an improperly formatted string. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault StringReformats the Upper_Snake_Case YAML config key to UpperCamelCase inline key.@NotNull org.bukkit.NamespacedKeygetKey()default @Nullable StringReturns the unique identifier to this serializer.static Map<String, MapConfigLike.Holder> inlineFormat(String line) static List<MapConfigLike.Holder> static Map<String, MapConfigLike.Holder> default booleanshouldSerialize(@NotNull me.deecaad.core.file.SerializeData data) After theSerializer.getKeyword()check andSerializer.getParentKeywords()check, this final check can be customized by the serializer in order to "fine tune" when a serializer should be automatically serialized.Methods inherited from interface org.bukkit.Keyed
keyMethods inherited from interface me.deecaad.core.file.Serializer
canUsePathTo, getName, getParentKeywords, getWikiLink, letPassThrough, serialize, tryPathTo, useLater
-
Field Details
-
NAME_FINDER
-
UNIQUE_IDENTIFIER
- See Also:
-
-
Method Details
-
shouldSerialize
default boolean shouldSerialize(@NotNull @NotNull me.deecaad.core.file.SerializeData data) Description copied from interface:SerializerAfter theSerializer.getKeyword()check andSerializer.getParentKeywords()check, this final check can be customized by the serializer in order to "fine tune" when a serializer should be automatically serialized.- Specified by:
shouldSerializein interfaceSerializer<T>- Parameters:
data- The config information.- Returns:
- true if the serializer should serialize.
-
getKeyword
Description copied from interface:SerializerReturns the unique identifier to this serializer. This identifier is used to determine when to apply the serializer to a config section. The identifier is case-sensitive, and it is ignored whennull.Generally speaking, you should always override this method. When you do not need automatic serializer handling, you may return null.
- Specified by:
getKeywordin interfaceSerializer<T>- Returns:
- The nullable unique identifier.
-
getKey
@NotNull @NotNull org.bukkit.NamespacedKey getKey()- Specified by:
getKeyin interfaceorg.bukkit.Keyed
-
getInlineKeyword
Reformats the Upper_Snake_Case YAML config key to UpperCamelCase inline key. This helps make inline serialization less sensitive to errors.- Returns:
- The non-null lowerCamelCase keyword.
-
inlineFormat
static Map<String,MapConfigLike.Holder> inlineFormat(String line) throws InlineSerializer.FormatException - Throws:
InlineSerializer.FormatException
-
mapify
static Map<String,MapConfigLike.Holder> mapify(String line, int offset) throws InlineSerializer.FormatException - Throws:
InlineSerializer.FormatException
-
listify
static List<MapConfigLike.Holder> listify(String line, int offset) throws InlineSerializer.FormatException - Throws:
InlineSerializer.FormatException
-