/** Get enclosed components for the supplied component. * * @param c * @return list of components or null for none or unrecognized class. */ public static List<JAXBElement<? extends BaseComponentType>> getComponents(final BaseComponentType c) { if (c.getComponents() == null) { return null; } return new ArrayList<JAXBElement<? extends BaseComponentType>>( c.getComponents().getBaseComponent()); }
/** * @param ical * @return null or first contained entity */ public static BaseComponentType findEntity(final IcalendarType ical) { if (ical == null) { return null; } for (VcalendarType v: ical.getVcalendar()) { ArrayOfComponents cs = v.getComponents(); if (cs == null) { continue; } for (JAXBElement<? extends BaseComponentType> bcel: cs.getBaseComponent()) { return bcel.getValue(); } } return null; }
private BaseComponentType matches(final VcalendarType vc, final int entityType) throws CalFacadeException { if ((vc == null) || (vc.getComponents() == null)) { return null; } String nm; if (entityType == IcalDefs.entityTypeEvent) { nm = VeventType.class.getName(); } else if (entityType == IcalDefs.entityTypeTodo) { nm = VtodoType.class.getName(); } else if (entityType == IcalDefs.entityTypeJournal) { nm = VjournalType.class.getName(); } else if (entityType == IcalDefs.entityTypeFreeAndBusy) { nm = VfreebusyType.class.getName(); } else { throw new CalFacadeException("org.bedework.invalid.entity.type", String.valueOf(entityType)); } for (JAXBElement<? extends BaseComponentType> jbc: vc.getComponents().getBaseComponent()) { BaseComponentType bc = jbc.getValue(); if (nm.equals(bc.getClass().getName())) { return bc; } } return null; }
/** * @param comp * @return Calendar object or null for no data * @throws Throwable */ public Calendar fromXcomp(final JAXBElement<? extends BaseComponentType> comp) throws Throwable { IcalendarType ical = new IcalendarType(); List<VcalendarType> vcts = ical.getVcalendar(); VcalendarType vcal = new VcalendarType(); vcts.add(vcal); ArrayOfComponents aop = new ArrayOfComponents(); vcal.setComponents(aop); aop.getBaseComponent().add(comp); return fromXcal(ical); }
aoc.getBaseComponent().add(of.createValarm(va));
aoc.getBaseComponent().add(toComponent((CalendarComponent)o, pattern, wrapXprops));
aoc.getBaseComponent().add(el); aoc.getBaseComponent().add(el); aoc.getBaseComponent().add(el);
toComponent((Component)o, pattern, wrapXprops); aoc.getBaseComponent().add(subel);