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

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

There is a newer version: 6.1.0
Show newest version
package org.daisy.common.transform;
import javax.xml.transform.Source;
import javax.xml.transform.sax.SAXSource;
import org.daisy.common.base.Provider;

public class LazySaxSourceProvider implements Provider{

	private String systemId;


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


	@Override
	public Source provide() {
		SAXSource src=new ProxiedSAXSource();
		src.setSystemId(this.systemId);
		return src;
	}
	private class ProxiedSAXSource extends SAXSource{

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

	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy