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

org.daisy.common.transform.LazySaxResultProvider Maven / Gradle / Ivy

There is a newer version: 6.1.0
Show newest version
package org.daisy.common.transform;
import javax.xml.transform.Result;
import javax.xml.transform.sax.SAXResult;

import com.google.common.base.Supplier;

public class LazySaxResultProvider implements Supplier{

	private String systemId;


	/**
	 * Constructs a new instance.
	 *
	 * @param systemId The systemId for this instance.
	 */
	public LazySaxResultProvider(String systemId) {
		this.systemId=systemId;
	}


	@Override
	public Result get() {
		SAXResult src=new ProxiedSAXResult();
		src.setSystemId(this.systemId);
		return src;
	}
	private class ProxiedSAXResult extends SAXResult{

		@Override
		public void setSystemId(String systemId) {
			super.setSystemId(systemId);
			LazySaxResultProvider.this.systemId=systemId;
		}

	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy