use of org.bedework.util.xml.FromXmlCallback in project bw-calendar-engine by Bedework.
the class BwCalendar method getRestoreCallback.
@NoDump
public static FromXmlCallback getRestoreCallback() {
if (fromXmlCb == null) {
fromXmlCb = new FromXmlCallback() {
@Override
public boolean save(final Element el, final Object theObject, final Object theValue) throws Throwable {
if ("col-lastmod".equals(el.getTagName())) {
((BwCalendar) theObject).setLastmod((BwCollectionLastmod) theValue);
return true;
}
return false;
}
};
fromXmlCb.addClassForName("col-lastmod", BwCollectionLastmod.class);
fromXmlCb.addClassForName("property", BwProperty.class);
fromXmlCb.addSkips("byteSize", "id", "seq");
fromXmlCb.addMapField("col-lastmod", "lastmod");
fromXmlCb.addMapField("public", "publick");
}
return fromXmlCb;
}
use of org.bedework.util.xml.FromXmlCallback in project bw-calendar-engine by Bedework.
the class BwCategory method getRestoreCallback.
@NoDump
public static FromXmlCallback getRestoreCallback() {
if (fromXmlCb == null) {
fromXmlCb = new FromXmlCallback();
fromXmlCb.addSkips("byteSize", "id", "seq");
fromXmlCb.addMapField("public", "publick");
}
return fromXmlCb;
}
use of org.bedework.util.xml.FromXmlCallback in project bw-calendar-engine by Bedework.
the class BwContact method getRestoreCallback.
@NoDump
public static FromXmlCallback getRestoreCallback() {
if (fromXmlCb == null) {
fromXmlCb = new FromXmlCallback();
fromXmlCb.addSkips("byteSize", "id", "seq");
fromXmlCb.addMapField("public", "publick");
}
return fromXmlCb;
}
use of org.bedework.util.xml.FromXmlCallback in project bw-calendar-engine by Bedework.
the class BwPrincipal method getRestoreCallback.
@NoDump
public static FromXmlCallback getRestoreCallback() {
if (fromXmlCb == null) {
fromXmlCb = new FromXmlCallback() {
protected Timestamp lastAccess;
/**
* Last time principal modified something in our
* system.
*/
protected Timestamp lastModify;
@Override
public Object simpleValue(final Class cl, final String val) throws Throwable {
if (cl.getCanonicalName().equals(Timestamp.class.getCanonicalName())) {
return Timestamp.valueOf(val);
}
return null;
}
};
fromXmlCb.addSkips("id", "seq");
}
return fromXmlCb;
}
use of org.bedework.util.xml.FromXmlCallback in project bw-calendar-engine by Bedework.
the class BwPreferences method getRestoreCallback.
@NoDump
public static FromXmlCallback getRestoreCallback() {
if (fromXmlCb == null) {
fromXmlCb = new FromXmlCallback();
fromXmlCb.addClassForName("view", BwView.class);
fromXmlCb.addClassForName("property", BwProperty.class);
fromXmlCb.addSkips("byteSize", "id", "seq");
}
return fromXmlCb;
}
Aggregations