Package sonia.scm.xml

Class XmlArrayStringAdapter

java.lang.Object
jakarta.xml.bind.annotation.adapters.XmlAdapter<String,String[]>
sonia.scm.xml.XmlArrayStringAdapter

public class XmlArrayStringAdapter extends jakarta.xml.bind.annotation.adapters.XmlAdapter<String,String[]>
Converts a string to a string array and vice versa. The string is divided by a comma.
Since:
2.0.0
  • Constructor Details

    • XmlArrayStringAdapter

      public XmlArrayStringAdapter()
  • Method Details

    • marshal

      public String marshal(String[] array)
      Converts the array to a single string divided by commas.
      Specified by:
      marshal in class jakarta.xml.bind.annotation.adapters.XmlAdapter<String,String[]>
      Parameters:
      array - string array
      Returns:
      joined string
    • unmarshal

      public String[] unmarshal(String rawString)
      Splits the string to a array of strings.
      Specified by:
      unmarshal in class jakarta.xml.bind.annotation.adapters.XmlAdapter<String,String[]>
      Parameters:
      rawString - raw string
      Returns:
      string array