All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ionoscloud.s3.messages.PrefixConverter Maven / Gradle / Ivy

The newest version!
package com.ionoscloud.s3.messages;

import org.simpleframework.xml.convert.Converter;
import org.simpleframework.xml.stream.InputNode;
import org.simpleframework.xml.stream.OutputNode;

/**
 * XML converter class for prefix due to SimpleXML limitation in converting empty tag
 *  to empty string.
 */
public class PrefixConverter implements Converter {
  @Override
  public String read(InputNode node) throws Exception {
    String value = node.getValue();
    return value != null ? value : "";
  }

  @Override
  public void write(OutputNode node, String prefix) throws Exception {
    node.setValue(prefix);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy