use of org.bedework.calfacade.BwProperty in project bw-calendar-engine by Bedework.
the class EntityBuilder method restoreProperties.
private void restoreProperties(final BwCalendar col) throws CalFacadeException {
final Collection<Object> vals = getFieldValues(PropertyInfoIndex.COL_PROPERTIES);
if (Util.isEmpty(vals)) {
return;
}
final Set<BwProperty> props = new TreeSet<>();
for (final Object o : vals) {
try {
pushFields(o);
final String name = getString(PropertyInfoIndex.NAME);
final String val = getString(PropertyInfoIndex.VALUE);
props.add(new BwProperty(name, val));
} catch (final IndexException ie) {
throw new CalFacadeException(ie);
} finally {
popFields();
}
}
col.setProperties(props);
}
use of org.bedework.calfacade.BwProperty in project bw-calendar-engine by Bedework.
the class PropertiesRule method end.
@Override
@SuppressWarnings("unchecked")
public void end(final String ns, final String name) throws Exception {
if (name.equals("properties")) {
/* Top should be the collection
*/
Set<BwProperty> ps = (Set<BwProperty>) pop();
PropertiesEntity pe = (PropertiesEntity) top();
pe.setProperties(ps);
return;
}
/* Top should be a BwProperty to add to the collection */
BwProperty p = (BwProperty) pop();
Collection<BwProperty> ps = (Collection<BwProperty>) top();
ps.add(p);
}
use of org.bedework.calfacade.BwProperty 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;
}
Aggregations