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

de.retest.persistence.StringInternerAdapter Maven / Gradle / Ivy

There is a newer version: 6.0.0
Show newest version
package de.retest.persistence;

import javax.xml.bind.DatatypeConverter;
import javax.xml.bind.annotation.adapters.XmlAdapter;

// Using code from https://jaxb.java.net/tutorial/section_5_5-Interning-Strings.html
public class StringInternerAdapter extends XmlAdapter {

	@Override
	public String marshal( final String value ) throws Exception {
		return value;
	}

	@Override
	public String unmarshal( final String value ) throws Exception {
		return DatatypeConverter.parseString( value ).intern();
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy