@Override public VTimeZone createComponent(PropertyList properties, ComponentList subComponents) { return new VTimeZone(properties, subComponents); } }
@Override public VTimeZone createComponent(PropertyList properties, ComponentList subComponents) { return new VTimeZone(properties, subComponents); } }
@Override public VTimeZone createComponent() { return new VTimeZone(); }
@Override public VTimeZone createComponent(PropertyList properties, ComponentList subComponents) { return new VTimeZone(properties, subComponents); } }
@Override public VTimeZone createComponent(PropertyList properties, ComponentList subComponents) { return new VTimeZone(properties, subComponents); } }
@Override public VTimeZone createComponent(PropertyList properties) { return new VTimeZone(properties); }
@Override public VTimeZone createComponent(PropertyList properties) { return new VTimeZone(properties); }
@Override public VTimeZone createComponent(PropertyList properties) { return new VTimeZone(properties); }
@Override public VTimeZone createComponent() { return new VTimeZone(); }
@Override public VTimeZone createComponent() { return new VTimeZone(); }
@Override public VTimeZone createComponent() { return new VTimeZone(); }
@Override public VTimeZone createComponent(PropertyList properties) { return new VTimeZone(properties); }
/** * Creates a component which contains sub-components. * * @param name name of the component * @param properties a list of component properties * @param components a list of sub-components (namely standard/daylight timezones) * @return a component */ public Component createComponent(final String name, final PropertyList properties, final ComponentList components) { if (components != null) { Component component = null; if (Component.VTIMEZONE.equals(name)) { component = new VTimeZone(properties, components); } else if (Component.VEVENT.equals(name)) { component = new VEvent(properties, components); } else if (Component.VVOTER.equals(name)) { component = new VVoter(properties, components); } else { throw new IllegalArgumentException("Illegal component [" + name + "]"); } return component; } return createComponent(name, properties); }
private static VTimeZone generateTimezoneForId(String timezoneId) throws ParseException { if (!TIMEZONE_DEFINITIONS.contains(timezoneId)) { return null; } TimeZone javaTz = TimeZone.getTimeZone(timezoneId); ZoneId zoneId = ZoneId.of(javaTz.getID(), ZoneId.SHORT_IDS); int rawTimeZoneOffsetInSeconds = javaTz.getRawOffset() / 1000; VTimeZone timezone = new VTimeZone(); timezone.getProperties().add(new TzId(timezoneId)); addTransitions(zoneId, timezone, rawTimeZoneOffsetInSeconds); addTransitionRules(zoneId, rawTimeZoneOffsetInSeconds, timezone); if (timezone.getObservances() == null || timezone.getObservances().isEmpty()) { timezone.getObservances().add(NO_TRANSITIONS); } return timezone; }
private static VTimeZone generateTimezoneForId(String timezoneId) throws ParseException { if (!TIMEZONE_DEFINITIONS.contains(timezoneId)) { return null; } TimeZone javaTz = TimeZone.getTimeZone(timezoneId); ZoneId zoneId = ZoneId.of(javaTz.getID(), ZoneId.SHORT_IDS); int rawTimeZoneOffsetInSeconds = javaTz.getRawOffset() / 1000; VTimeZone timezone = new VTimeZone(); timezone.getProperties().add(new TzId(timezoneId)); addTransitions(zoneId, timezone, rawTimeZoneOffsetInSeconds); addTransitionRules(zoneId, rawTimeZoneOffsetInSeconds, timezone); if (timezone.getObservances() == null || timezone.getObservances().isEmpty()) { timezone.getObservances().add(NO_TRANSITIONS); } return timezone; }
private static VTimeZone generateTimezoneForId(String timezoneId) throws ParseException { if(!TIMEZONE_DEFINITIONS.contains(timezoneId)){ return null; } java.util.TimeZone javaTz = java.util.TimeZone.getTimeZone(timezoneId); ZoneId zoneId = ZoneId.of(javaTz.getID(), ZoneId.SHORT_IDS); int rawTimeZoneOffsetInSeconds = javaTz.getRawOffset() / 1000; VTimeZone timezone = new VTimeZone(); timezone.getProperties().add(new TzId(timezoneId)); addTransitions(zoneId, timezone, rawTimeZoneOffsetInSeconds); addTransitionRules(zoneId, rawTimeZoneOffsetInSeconds, timezone); if(timezone.getObservances() == null || timezone.getObservances().isEmpty()){ timezone.getObservances().add(NO_TRANSITIONS); } return timezone; }
component = new VTimeZone(properties);
/** * @return */ public static TestSuite suite() { TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry(); TestSuite suite = new TestSuite(); suite.addTest(new VTimeZoneTest("testCreateDefinition", registry.getTimeZone("Australia/Melbourne").getVTimeZone())); VTimeZone tz = new VTimeZone(); suite.addTest(new VTimeZoneTest("testIsCalendarComponent", tz)); suite.addTest(new VTimeZoneTest("testValidationException", tz)); return suite; } }