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

com.fincatto.documentofiscal.nfe310.converters.NFStringNullToEmptyConverter Maven / Gradle / Ivy

There is a newer version: 4.0.75
Show newest version
package com.fincatto.documentofiscal.nfe310.converters;

import org.apache.commons.lang3.StringUtils;
import org.simpleframework.xml.convert.Converter;
import org.simpleframework.xml.stream.InputNode;
import org.simpleframework.xml.stream.OutputNode;

public class NFStringNullToEmptyConverter implements Converter {

	@Override
	public String read(final InputNode node) throws Exception {
		return StringUtils.defaultIfBlank(node.getValue(), StringUtils.EMPTY);
	}

	@Override
    public void write(final OutputNode node, final String value) {
		node.setValue(value);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy