use of org.bedework.calfacade.annotations.NoDump in project bw-calendar-engine by Bedework.
the class BwCalendar method getVpollSupportedComponents.
/**
* @return the supported vpoll components
*/
@NoDump
public List<String> getVpollSupportedComponents() {
if (vpollSupportedComponents == null) {
vpollSupportedComponents = new ArrayList<String>();
if ((getCalType() != calTypePoll) && (getCalType() != calTypeInbox) && (getCalType() != calTypeOutbox)) {
return vpollSupportedComponents;
}
String slist = getQproperty(CaldavTags.vpollSupportedComponentSet);
if (slist == null) {
vpollSupportedComponents.add("VEVENT");
// vpollSupportedComponents.add("VTODO");
// vpollSupportedComponents.add("VAVAILABILITY");
} else {
String[] ss = slist.split(",");
for (String s : ss) {
vpollSupportedComponents.add(s);
}
}
}
return vpollSupportedComponents;
}
use of org.bedework.calfacade.annotations.NoDump in project bw-calendar-engine by Bedework.
the class BwLocation 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.calfacade.annotations.NoDump in project bw-calendar-engine by Bedework.
the class BwPreferences method getProps.
/**
* @return String values.
*/
@NoDump
private Set<String> getProps(final String name) {
final Set<BwProperty> props = getProperties(name);
final Set<String> vals = new TreeSet<>();
if (props == null) {
return vals;
}
for (final BwProperty p : props) {
vals.add(p.getValue());
}
return vals;
}
use of org.bedework.calfacade.annotations.NoDump in project bw-calendar-engine by Bedework.
the class DumpEntity method dump.
/* ====================================================================
* Private Vcard methods
* ==================================================================== */
/**
* Dump this entity as a vcard.
*
* @param vc
* @param dtype
* @throws CalFacadeException
*/
@NoWrap
private void dump(final VCard vc, final DumpType dtype) throws CalFacadeException {
if (!hasDumpValue()) {
return;
}
NoDump ndCl = getClass().getAnnotation(NoDump.class);
Dump dCl = getClass().getAnnotation(Dump.class);
/* If dumpKeyFields is true we are dumping a field which is referred to by
* a key field - for example, a principal is addressed by the principal
* href.
*/
boolean dumpKeyFields = dtype == DumpType.reference;
ArrayList<String> noDumpMethods = null;
ArrayList<String> firstMethods = null;
try {
if (ndCl != null) {
if (ndCl.value().length == 0) {
return;
}
noDumpMethods = new ArrayList<String>();
for (String m : ndCl.value()) {
noDumpMethods.add(m);
}
}
if (!dumpKeyFields && (dCl != null) && (dCl.firstFields().length != 0)) {
firstMethods = new ArrayList<String>();
for (String f : dCl.firstFields()) {
firstMethods.add(methodName(f));
}
}
QName qn = null;
/*
if (dtype != DumpType.compound) {
qn = startElement(xml, getClass(), dCl);
}
Collection<ComparableMethod> ms = findGetters(dCl, dtype);
if (firstMethods != null) {
doFirstMethods:
for (String methodName: firstMethods) {
for (ComparableMethod cm: ms) {
Method m = cm.m;
if (methodName.equals(m.getName())) {
Dump d = m.getAnnotation(Dump.class);
dumpValue(xml, m, d, m.invoke(this, (Object[])null), fromCollection);
continue doFirstMethods;
}
}
error("Listed first field has no corresponding getter: " + methodName);
}
}
for (ComparableMethod cm: ms) {
Method m = cm.m;
if ((noDumpMethods != null) &&
noDumpMethods.contains(fieldName(m.getName()))) {
continue;
}
if ((firstMethods != null) &&
firstMethods.contains(m.getName())) {
continue;
}
Dump d = m.getAnnotation(Dump.class);
dumpValue(xml, m, d, m.invoke(this, (Object[])null), fromCollection);
}
if (qn != null) {
closeElement(xml, qn);
}
*/
// } catch (CalFacadeException cfe) {
// throw cfe;
} catch (Throwable t) {
throw new CalFacadeException(t);
}
}
use of org.bedework.calfacade.annotations.NoDump in project bw-calendar-engine by Bedework.
the class DumpEntity method dump.
/* ====================================================================
* Private XML methods
* ==================================================================== */
/**
* Dump this entity as xml.
*
* @param xml
* @param dtype
* @param fromCollection true if the value is a member of a collection
* @throws CalFacadeException
*/
@NoWrap
private void dump(final XmlEmit xml, final DumpType dtype, final boolean fromCollection) throws CalFacadeException {
if (!hasDumpValue()) {
return;
}
NoDump ndCl = getClass().getAnnotation(NoDump.class);
Dump dCl = getClass().getAnnotation(Dump.class);
boolean dumpKeyFields = dtype == DumpType.reference;
ArrayList<String> noDumpMethods = null;
ArrayList<String> firstMethods = null;
try {
if (ndCl != null) {
if (ndCl.value().length == 0) {
return;
}
noDumpMethods = new ArrayList<String>();
for (String m : ndCl.value()) {
noDumpMethods.add(m);
}
}
if (!dumpKeyFields && (dCl != null) && (dCl.firstFields().length != 0)) {
firstMethods = new ArrayList<String>();
for (String f : dCl.firstFields()) {
firstMethods.add(methodName(f));
}
}
QName qn = null;
if (fromCollection || (dtype != DumpType.compound)) {
qn = startElement(xml, getClass(), dCl);
}
Collection<ComparableMethod> ms = findGetters(dCl, dtype);
if (firstMethods != null) {
doFirstMethods: for (String methodName : firstMethods) {
for (ComparableMethod cm : ms) {
Method m = cm.m;
if (methodName.equals(m.getName())) {
Dump d = m.getAnnotation(Dump.class);
dumpValue(xml, m, d, m.invoke(this, (Object[]) null), fromCollection);
continue doFirstMethods;
}
}
error("Listed first field has no corresponding getter: " + methodName);
}
}
for (ComparableMethod cm : ms) {
Method m = cm.m;
if ((noDumpMethods != null) && noDumpMethods.contains(fieldName(m.getName()))) {
continue;
}
if ((firstMethods != null) && firstMethods.contains(m.getName())) {
continue;
}
Dump d = m.getAnnotation(Dump.class);
dumpValue(xml, m, d, m.invoke(this, (Object[]) null), fromCollection);
}
if (qn != null) {
closeElement(xml, qn);
}
} catch (CalFacadeException cfe) {
throw cfe;
} catch (Throwable t) {
throw new CalFacadeException(t);
}
}
Aggregations