/** * @param dateTime The dateTime to set. */ public final void setDateTime(final DateTime dateTime) { super.setDateTime(dateTime); duration = null; getParameters().replace(Value.DATE_TIME); }
/** * @param dateTime The dateTime to set. */ public final void setDateTime(final DateTime dateTime) { super.setDateTime(dateTime); duration = null; getParameters().replace(Value.DATE_TIME); }
/** * @param dateTime The dateTime to set. */ public final void setDateTime(final DateTime dateTime) { super.setDateTime(dateTime); duration = null; getParameters().replace(Value.DATE_TIME); }
/** * @param dateTime The dateTime to set. */ public final void setDateTime(final DateTime dateTime) { super.setDateTime(dateTime); duration = null; getParameters().replace(Value.DATE_TIME); }
/** * @param dateTime The dateTime to set. */ public final void setDateTime(final DateTime dateTime) { super.setDateTime(dateTime); duration = null; getParameters().replace(Value.DATE_TIME); }
/** * @param duration The duration to set. */ public final void setDuration(final Dur duration) { this.duration = duration; super.setDateTime(null); // duration is the default value type for Trigger.. if (getParameter(Parameter.VALUE) != null) { getParameters().replace(Value.DURATION); } } }
/** * @param duration The duration to set. */ public final void setDuration(final Dur duration) { this.duration = duration; super.setDateTime(null); // duration is the default value type for Trigger.. if (getParameter(Parameter.VALUE) != null) { getParameters().replace(Value.DURATION); } }
/** * @param duration The duration to set. */ public final void setDuration(final Dur duration) { this.duration = duration; super.setDateTime(null); // duration is the default value type for Trigger.. if (getParameter(Parameter.VALUE) != null) { getParameters().replace(Value.DURATION); } }
/** * @param duration The duration to set. */ public final void setDuration(final TemporalAmount duration) { this.duration = new TemporalAmountAdapter(duration); super.setDateTime(null); // duration is the default value type for Trigger.. if (getParameter(Parameter.VALUE) != null) { getParameters().replace(Value.DURATION); } }
/** * @param duration The duration to set. */ public final void setDuration(final TemporalAmount duration) { this.duration = new TemporalAmountAdapter(duration); super.setDateTime(null); // duration is the default value type for Trigger.. if (getParameter(Parameter.VALUE) != null) { getParameters().replace(Value.DURATION); } }
/** * @param name the property name * @param parameters property parameters * @param dates a list of initial dates for the property */ public DateListProperty(final String name, final ParameterList parameters, final DateList dates, PropertyFactory factory) { super(name, parameters, factory); this.dates = dates; if (dates != null && !Value.DATE_TIME.equals(dates.getType())) { getParameters().replace(dates.getType()); } }
/** * @param name the property name * @param parameters property parameters * @param dates a list of initial dates for the property */ public DateListProperty(final String name, final ParameterList parameters, final DateList dates, PropertyFactoryImpl factory) { super(name, parameters, factory); this.dates = dates; if (dates != null && !Value.DATE_TIME.equals(dates.getType())) { getParameters().replace(dates.getType()); } }
/** * @param name the property name * @param parameters property parameters * @param dates a list of initial dates for the property */ public DateListProperty(final String name, final ParameterList parameters, final DateList dates, PropertyFactory factory) { super(name, parameters, factory); this.dates = dates; if (dates != null && !Value.DATE_TIME.equals(dates.getType())) { getParameters().replace(dates.getType()); } }
/** * @param name the property name * @param parameters property parameters * @param dates a list of initial dates for the property */ public DateListProperty(final String name, final ParameterList parameters, final DateList dates, PropertyFactoryImpl factory) { super(name, parameters, factory); this.dates = dates; if (dates != null && !Value.DATE_TIME.equals(dates.getType())) { getParameters().replace(dates.getType()); } }
/** * Sets the date value of this property. The timezone and value of this * instance will also be updated accordingly. * * @param date The date to set. */ public final void setDate(final Date date) { this.date = date; if (date instanceof DateTime) { if (Value.DATE.equals(getParameter(Parameter.VALUE))) { getParameters().replace(Value.DATE_TIME); } updateTimeZone(((DateTime) date).getTimeZone()); } else { if (date != null) { getParameters().replace(Value.DATE); } /* else { getParameters().removeAll(Parameter.VALUE); } */ // ensure timezone is null for VALUE=DATE or null properties.. updateTimeZone(null); } }
/** * Unit testing of serialization. */ public void testSerialization() throws IOException, ClassNotFoundException, URISyntaxException { ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(bout); out.writeObject(attach); ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream(bout.toByteArray())); Attach clone = (Attach) in.readObject(); assertNotNull(clone); assertEquals(attach, clone); // set a bogus value to trigger logging.. clone.getParameters().replace(new Encoding("BOGUS")); clone.setValue(""); } }
/** * Sets the timezone associated with this property. * * @param timezone a timezone to associate with this property */ public void setTimeZone(final TimeZone timezone) { if (dates == null) { throw new UnsupportedOperationException( "TimeZone is not applicable to current value"); } this.timeZone = timezone; if (timezone != null) { if (!Value.DATE_TIME.equals(getDates().getType())) { throw new UnsupportedOperationException( "TimeZone is not applicable to current value"); } dates.setTimeZone(timezone); getParameters().remove(getParameter(Parameter.TZID)); final TzId tzId = new TzId(timezone.getID()); getParameters().replace(tzId); } else { // use setUtc() to reset timezone.. setUtc(false); } }
/** * Updates the timezone associated with the property's value. If the specified timezone is equivalent to UTC any * existing TZID parameters will be removed. Note that this method is only applicable where the current date is an * instance of <code>DateTime</code>. For all other cases an <code>UnsupportedOperationException</code> will be * thrown. * * @param timezone */ private void updateTimeZone(final TimeZone timezone) { this.timeZone = timezone; if (timezone != null) { if (getDate() != null && !(getDate() instanceof DateTime)) { throw new UnsupportedOperationException( "TimeZone is not applicable to current value"); } if (getDate() != null) { ((DateTime) getDate()).setTimeZone(timezone); } getParameters().replace(new TzId(timezone.getID())); } else { // use setUtc() to reset timezone.. setUtc(isUtc()); } }
/** * Updates the timezone associated with the property's value. If the specified timezone is equivalent to UTC any * existing TZID parameters will be removed. Note that this method is only applicable where the current date is an * instance of <code>DateTime</code>. For all other cases an <code>UnsupportedOperationException</code> will be * thrown. * * @param timezone */ private void updateTimeZone(final TimeZone timezone) { this.timeZone = timezone; if (timezone != null) { if (getDate() != null && !(getDate() instanceof DateTime)) { throw new UnsupportedOperationException( "TimeZone is not applicable to current value"); } if (getDate() != null) { ((DateTime) getDate()).setTimeZone(timezone); } getParameters().replace(new TzId(timezone.getID())); } else { // use setUtc() to reset timezone.. setUtc(isUtc()); } }
/** * Updates the timezone associated with the property's value. If the specified timezone is equivalent to UTC any * existing TZID parameters will be removed. Note that this method is only applicable where the current date is an * instance of <code>DateTime</code>. For all other cases an <code>UnsupportedOperationException</code> will be * thrown. * * @param timezone */ private void updateTimeZone(final TimeZone timezone) { this.timeZone = timezone; if (timezone != null) { if (getDate() != null && !(getDate() instanceof DateTime)) { throw new UnsupportedOperationException( "TimeZone is not applicable to current value"); } if (getDate() != null) { ((DateTime) getDate()).setTimeZone(timezone); } getParameters().replace(new TzId(timezone.getID())); } else { // use setUtc() to reset timezone.. setUtc(isUtc()); } }