Package backend.logic

Klasse LocalDateAdapter

java.lang.Object
jakarta.xml.bind.annotation.adapters.XmlAdapter<String,LocalDate>
backend.logic.LocalDateAdapter

public class LocalDateAdapter extends jakarta.xml.bind.annotation.adapters.XmlAdapter<String,LocalDate>
Adapter class for converting between LocalDate and String during XML marshalling and unmarshalling. This adapter ensures that LocalDate values are correctly formatted using the ISO-8601 date format (yyyy-MM-dd) when serialized to XML, and properly parsed back when deserialized. Used by JAXB for mapping XML string values to Java LocalDate objects.
  • Konstruktordetails

    • LocalDateAdapter

      public LocalDateAdapter()
  • Methodendetails

    • unmarshal

      public LocalDate unmarshal(String v) throws Exception
      Converts a date string from XML into a LocalDate object.
      Angegeben von:
      unmarshal in Klasse jakarta.xml.bind.annotation.adapters.XmlAdapter<String,LocalDate>
      Parameter:
      v - The date string in ISO-8601 format.
      Gibt zurück:
      A LocalDate parsed from the input string.
      Löst aus:
      Exception - If the input cannot be parsed.
    • marshal

      public String marshal(LocalDate v) throws Exception
      Converts a LocalDate object into a string suitable for XML output.
      Angegeben von:
      marshal in Klasse jakarta.xml.bind.annotation.adapters.XmlAdapter<String,LocalDate>
      Parameter:
      v - The LocalDate to format.
      Gibt zurück:
      The formatted date string, or null if the input is null.
      Löst aus:
      Exception - If the date cannot be formatted.