Class TextureAtlas.CustomBooleanAdapter

java.lang.Object
jakarta.xml.bind.annotation.adapters.XmlAdapter<String,Boolean>
de.gurkenlabs.litiengine.resources.TextureAtlas.CustomBooleanAdapter
Enclosing class:
TextureAtlas

public static class TextureAtlas.CustomBooleanAdapter extends jakarta.xml.bind.annotation.adapters.XmlAdapter<String,Boolean>
Custom adapter to convert between String and Boolean values for XML serialization. This adapter interprets "y", "yes", "1", and "true" (case-insensitive) as true, and any other value as false.
  • Constructor Details

    • CustomBooleanAdapter

      public CustomBooleanAdapter()
  • Method Details

    • unmarshal

      public Boolean unmarshal(String v) throws Exception
      Converts a String value to a Boolean.
      Specified by:
      unmarshal in class jakarta.xml.bind.annotation.adapters.XmlAdapter<String,Boolean>
      Parameters:
      v - The String value to convert.
      Returns:
      The Boolean representation of the String value.
      Throws:
      Exception - If an error occurs during conversion.
    • marshal

      public String marshal(Boolean v) throws Exception
      Converts a Boolean value to a String.
      Specified by:
      marshal in class jakarta.xml.bind.annotation.adapters.XmlAdapter<String,Boolean>
      Parameters:
      v - The Boolean value to convert.
      Returns:
      The String representation of the Boolean value.
      Throws:
      Exception - If an error occurs during conversion.