--- /dev/null
+package jalview.ws2.params;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import jalview.ws.params.ArgumentI;
+
+/**
+ * A minimal bean implementing {@link ArgumentI} which stores argument
+ * name, label and value. It's mainly used to marshal and unmarshal
+ * parameter values of a preset.
+ *
+ * @author mmwarowny
+ *
+ */
+@XmlRootElement(name = "parameter")
+class ArgumentBean implements ArgumentI
+{
+ String name;
+
+ String label;
+
+ String value;
+
+ ArgumentBean()
+ {
+ this.name = null;
+ this.label = null;
+ this.value = null;
+ }
+
+ ArgumentBean(ArgumentI copyof)
+ {
+ this.name = copyof.getName();
+ this.label = copyof.getLabel();
+ this.value = copyof.getValue();
+ }
+
+ @XmlAttribute
+ @Override
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @XmlElement
+ @Override
+ public String getLabel()
+ {
+ return label;
+ }
+
+ public void setLabel(String label)
+ {
+ this.label = label;
+ }
+
+ @XmlElement
+ @Override
+ public String getValue()
+ {
+ return value;
+ }
+
+ @Override
+ public void setValue(String selectedItem)
+ {
+ this.value = selectedItem;
+ }
+
+ @Override
+ public String toString()
+ {
+ return String.format("Parameter(name=%s, value=%s)", name, value);
+ }
+}
\ No newline at end of file
--- /dev/null
+package jalview.ws2.params;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import jalview.ws.params.ArgumentI;
+
+/**
+ * A wrapper of {@link ArgumentBean} list that can be marshaled or unmarshalled.
+ * Used by {@link SimpleParamDatastore} to read and store parameters in a file.
+ *
+ * @see ArgumentBean
+ * @see SimpleParamDatastore
+ * @author mmwarowny
+ */
+@XmlRootElement(name = "arguments")
+class ArgumentBeanList
+{
+ @XmlElement(name = "argument")
+ public List<ArgumentBean> arguments = Collections.emptyList();
+
+ ArgumentBeanList()
+ {
+ }
+
+ ArgumentBeanList(List<ArgumentBean> arguments)
+ {
+ this.arguments = arguments;
+ }
+
+ static ArgumentBeanList fromList(List<? extends ArgumentI> list)
+ {
+ var args = new ArrayList<ArgumentBean>();
+ for (var item : list)
+ args.add(item instanceof ArgumentBean ? (ArgumentBean) item : new ArgumentBean(item));
+ return new ArgumentBeanList(args);
+ }
+
+ @Override
+ public String toString()
+ {
+ var elements = new String[arguments.size()];
+ for (int i = 0; i < arguments.size(); i++)
+ elements[i] = arguments.toString();
+ return "[" + String.join(", ", elements) + "]";
+ }
+}
\ No newline at end of file