Search in sources :

Example 1 with FromXmlCallback

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;
}
Also used : Element(org.w3c.dom.Element) FromXmlCallback(org.bedework.util.xml.FromXmlCallback) NoDump(org.bedework.calfacade.annotations.NoDump)

Example 2 with FromXmlCallback

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;
}
Also used : FromXmlCallback(org.bedework.util.xml.FromXmlCallback) NoDump(org.bedework.calfacade.annotations.NoDump)

Example 3 with FromXmlCallback

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;
}
Also used : FromXmlCallback(org.bedework.util.xml.FromXmlCallback) NoDump(org.bedework.calfacade.annotations.NoDump)

Example 4 with FromXmlCallback

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;
}
Also used : ToString(org.bedework.util.misc.ToString) FromXmlCallback(org.bedework.util.xml.FromXmlCallback) Timestamp(java.sql.Timestamp) NoDump(org.bedework.calfacade.annotations.NoDump)

Example 5 with FromXmlCallback

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;
}
Also used : FromXmlCallback(org.bedework.util.xml.FromXmlCallback) NoDump(org.bedework.calfacade.annotations.NoDump)

Aggregations

NoDump (org.bedework.calfacade.annotations.NoDump)7 FromXmlCallback (org.bedework.util.xml.FromXmlCallback)7 Timestamp (java.sql.Timestamp)1 ToString (org.bedework.util.misc.ToString)1 Element (org.w3c.dom.Element)1