com.iodesystems.xml.tools.loaded.FileLoaded Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xmltools Show documentation
Show all versions of xmltools Show documentation
Xmltools contains a flexible jaxb xml loader
package com.iodesystems.xml.tools.loaded;
import com.iodesystems.xml.tools.Locator;
import com.iodesystems.xml.tools.XmlLoader;
import javax.xml.stream.Location;
public class FileLoaded implements Loaded {
private final String fileSource;
private final T value;
private final Locator locator;
private final XmlLoader xmlLoader;
public FileLoaded(String fileSource, T value, Locator locator, XmlLoader xmlLoader) {
this.fileSource = fileSource;
this.value = value;
this.locator = locator;
this.xmlLoader = xmlLoader;
}
@Override
public T getValue() {
return value;
}
@Override
public Location getLocation(Object o) {
return locator.getLocation(o);
}
@SuppressWarnings("unchecked")
public Loaded reload() throws FileLoadErrored, NodeLoadErrored {
return xmlLoader.load((Class) value.getClass(), fileSource);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy