getSupportedVersions() {
50 | return EnumSet.of(ICalVersion.V2_0_DEPRECATED, ICalVersion.V2_0);
51 | }
52 | }
--------------------------------------------------------------------------------
/src/test/java/biweekly/io/scribe/property/ScribeTest.java:
--------------------------------------------------------------------------------
1 | package biweekly.io.scribe.property;
2 |
3 | import org.junit.ClassRule;
4 |
5 | import biweekly.property.ICalProperty;
6 | import biweekly.util.DefaultTimezoneRule;
7 |
8 | /*
9 | Copyright (c) 2013-2024, Michael Angstadt
10 | All rights reserved.
11 |
12 | Redistribution and use in source and binary forms, with or without
13 | modification, are permitted provided that the following conditions are met:
14 |
15 | 1. Redistributions of source code must retain the above copyright notice, this
16 | list of conditions and the following disclaimer.
17 | 2. Redistributions in binary form must reproduce the above copyright notice,
18 | this list of conditions and the following disclaimer in the documentation
19 | and/or other materials provided with the distribution.
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
25 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 | */
32 |
33 | /**
34 | * Parent class for all scribe unit tests.
35 | * @author Michael Angstadt
36 | * @param the property class
37 | */
38 | public class ScribeTest
{
39 | @ClassRule
40 | public static final DefaultTimezoneRule tzRule = new DefaultTimezoneRule(1, 0);
41 |
42 | protected final ICalPropertyScribe
scribe;
43 | protected final Sensei
sensei;
44 |
45 | protected ScribeTest(ICalPropertyScribe
scribe) {
46 | this.scribe = scribe;
47 | sensei = new Sensei
(scribe);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/test/java/biweekly/property/ExceptionRuleTest.java:
--------------------------------------------------------------------------------
1 | package biweekly.property;
2 |
3 | import static biweekly.util.TestUtils.assertValidate;
4 |
5 | import org.junit.Test;
6 |
7 | import static biweekly.ICalVersion.*;
8 |
9 | import biweekly.util.Frequency;
10 | import biweekly.util.Recurrence;
11 |
12 | /*
13 | Copyright (c) 2013-2024, Michael Angstadt
14 | All rights reserved.
15 |
16 | Redistribution and use in source and binary forms, with or without
17 | modification, are permitted provided that the following conditions are met:
18 |
19 | 1. Redistributions of source code must retain the above copyright notice, this
20 | list of conditions and the following disclaimer.
21 | 2. Redistributions in binary form must reproduce the above copyright notice,
22 | this list of conditions and the following disclaimer in the documentation
23 | and/or other materials provided with the distribution.
24 |
25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
26 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
29 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
32 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 | */
36 |
37 | /**
38 | * @author Michael Angstadt
39 | */
40 | public class ExceptionRuleTest {
41 | @Test
42 | public void validate() {
43 | ExceptionRule property = new ExceptionRule(new Recurrence.Builder(Frequency.DAILY).build());
44 | assertValidate(property).versions(V1_0, V2_0_DEPRECATED).run();
45 |
46 | property = new ExceptionRule(new Recurrence.Builder(Frequency.DAILY).build());
47 | assertValidate(property).versions(V2_0).run(37);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/biweekly/io/scribe/property/CommentScribe.java:
--------------------------------------------------------------------------------
1 | package biweekly.io.scribe.property;
2 |
3 | import java.util.EnumSet;
4 | import java.util.Set;
5 |
6 | import biweekly.ICalVersion;
7 | import biweekly.property.Comment;
8 |
9 | /*
10 | Copyright (c) 2013-2024, Michael Angstadt
11 | All rights reserved.
12 |
13 | Redistribution and use in source and binary forms, with or without
14 | modification, are permitted provided that the following conditions are met:
15 |
16 | 1. Redistributions of source code must retain the above copyright notice, this
17 | list of conditions and the following disclaimer.
18 | 2. Redistributions in binary form must reproduce the above copyright notice,
19 | this list of conditions and the following disclaimer in the documentation
20 | and/or other materials provided with the distribution.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
26 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | /**
35 | * Marshals {@link Comment} properties.
36 | * @author Michael Angstadt
37 | */
38 | public class CommentScribe extends TextPropertyScribe {
39 | public CommentScribe() {
40 | super(Comment.class, "COMMENT");
41 | }
42 |
43 | @Override
44 | protected Comment newInstance(String value, ICalVersion version) {
45 | return new Comment(value);
46 | }
47 |
48 | @Override
49 | public Set getSupportedVersions() {
50 | return EnumSet.of(ICalVersion.V2_0_DEPRECATED, ICalVersion.V2_0);
51 | }
52 | }
--------------------------------------------------------------------------------
/src/main/java/biweekly/io/scribe/property/ContactScribe.java:
--------------------------------------------------------------------------------
1 | package biweekly.io.scribe.property;
2 |
3 | import java.util.EnumSet;
4 | import java.util.Set;
5 |
6 | import biweekly.ICalVersion;
7 | import biweekly.property.Contact;
8 |
9 | /*
10 | Copyright (c) 2013-2024, Michael Angstadt
11 | All rights reserved.
12 |
13 | Redistribution and use in source and binary forms, with or without
14 | modification, are permitted provided that the following conditions are met:
15 |
16 | 1. Redistributions of source code must retain the above copyright notice, this
17 | list of conditions and the following disclaimer.
18 | 2. Redistributions in binary form must reproduce the above copyright notice,
19 | this list of conditions and the following disclaimer in the documentation
20 | and/or other materials provided with the distribution.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
26 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | /**
35 | * Marshals {@link Contact} properties.
36 | * @author Michael Angstadt
37 | */
38 | public class ContactScribe extends TextPropertyScribe {
39 | public ContactScribe() {
40 | super(Contact.class, "CONTACT");
41 | }
42 |
43 | @Override
44 | protected Contact newInstance(String value, ICalVersion version) {
45 | return new Contact(value);
46 | }
47 |
48 | @Override
49 | public Set getSupportedVersions() {
50 | return EnumSet.of(ICalVersion.V2_0_DEPRECATED, ICalVersion.V2_0);
51 | }
52 | }
--------------------------------------------------------------------------------
/src/main/java/biweekly/property/DateTimeProperty.java:
--------------------------------------------------------------------------------
1 | package biweekly.property;
2 |
3 | import java.util.Date;
4 |
5 | /*
6 | Copyright (c) 2013-2024, Michael Angstadt
7 | All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice, this
13 | list of conditions and the following disclaimer.
14 | 2. Redistributions in binary form must reproduce the above copyright notice,
15 | this list of conditions and the following disclaimer in the documentation
16 | and/or other materials provided with the distribution.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | /**
31 | * Represents a property whose value is a date-time value. These properties are
32 | * always written in UTC time.
33 | * @author Michael Angstadt
34 | */
35 | public class DateTimeProperty extends ValuedProperty {
36 | /**
37 | * Creates a new property.
38 | * @param value the date-time value
39 | */
40 | public DateTimeProperty(Date value) {
41 | super(value);
42 | }
43 |
44 | /**
45 | * Copy constructor.
46 | * @param original the property to make a copy of
47 | */
48 | public DateTimeProperty(DateTimeProperty original) {
49 | super(original);
50 | value = new Date(original.value.getTime());
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/main/java/biweekly/io/scribe/property/TimezoneScribe.java:
--------------------------------------------------------------------------------
1 | package biweekly.io.scribe.property;
2 |
3 | import java.util.EnumSet;
4 | import java.util.Set;
5 |
6 | import biweekly.ICalVersion;
7 | import biweekly.property.Timezone;
8 | import biweekly.util.UtcOffset;
9 |
10 | /*
11 | Copyright (c) 2013-2024, Michael Angstadt
12 | All rights reserved.
13 |
14 | Redistribution and use in source and binary forms, with or without
15 | modification, are permitted provided that the following conditions are met:
16 |
17 | 1. Redistributions of source code must retain the above copyright notice, this
18 | list of conditions and the following disclaimer.
19 | 2. Redistributions in binary form must reproduce the above copyright notice,
20 | this list of conditions and the following disclaimer in the documentation
21 | and/or other materials provided with the distribution.
22 |
23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
27 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 | */
34 |
35 | /**
36 | * Marshals {@link Timezone} properties.
37 | * @author Michael Angstadt
38 | */
39 | public class TimezoneScribe extends UtcOffsetPropertyScribe {
40 | public TimezoneScribe() {
41 | super(Timezone.class, "TZ");
42 | }
43 |
44 | @Override
45 | protected Timezone newInstance(UtcOffset offset) {
46 | return new Timezone(offset);
47 | }
48 |
49 | @Override
50 | public Set getSupportedVersions() {
51 | return EnumSet.of(ICalVersion.V1_0);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/test/java/biweekly/io/DefaultGlobalTimezoneIdResolverTest.java:
--------------------------------------------------------------------------------
1 | package biweekly.io;
2 |
3 | import static org.junit.Assert.assertEquals;
4 | import static org.junit.Assert.assertNull;
5 | import org.junit.Test;
6 |
7 | /*
8 | Copyright (c) 2013-2024, Michael Angstadt
9 | All rights reserved.
10 |
11 | Redistribution and use in source and binary forms, with or without
12 | modification, are permitted provided that the following conditions are met:
13 |
14 | 1. Redistributions of source code must retain the above copyright notice, this
15 | list of conditions and the following disclaimer.
16 | 2. Redistributions in binary form must reproduce the above copyright notice,
17 | this list of conditions and the following disclaimer in the documentation
18 | and/or other materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
24 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | /**
33 | * @author Michael Angstadt
34 | */
35 | public class DefaultGlobalTimezoneIdResolverTest {
36 | @Test
37 | public void resolve() {
38 | DefaultGlobalTimezoneIdResolver resolver = new DefaultGlobalTimezoneIdResolver();
39 |
40 | assertEquals("America/New_York", resolver.resolve("America/New_York").getID());
41 | assertEquals("America/New_York", resolver.resolve("mozilla.org/20050126_1/America/New_York").getID());
42 |
43 | assertNull(resolver.resolve("Foo/Bar"));
44 | assertNull(resolver.resolve("mozilla.org/20050126_1/Foo/Bar"));
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/test/java/biweekly/property/ExceptionDatesTest.java:
--------------------------------------------------------------------------------
1 | package biweekly.property;
2 |
3 | import static biweekly.util.TestUtils.assertValidate;
4 |
5 | import org.junit.Test;
6 |
7 | import biweekly.util.ICalDate;
8 |
9 | /*
10 | Copyright (c) 2013-2024, Michael Angstadt
11 | All rights reserved.
12 |
13 | Redistribution and use in source and binary forms, with or without
14 | modification, are permitted provided that the following conditions are met:
15 |
16 | 1. Redistributions of source code must retain the above copyright notice, this
17 | list of conditions and the following disclaimer.
18 | 2. Redistributions in binary form must reproduce the above copyright notice,
19 | this list of conditions and the following disclaimer in the documentation
20 | and/or other materials provided with the distribution.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
26 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | /**
35 | * @author Michael Angstadt
36 | */
37 | public class ExceptionDatesTest {
38 | @Test
39 | public void validate() {
40 | ExceptionDates property = new ExceptionDates();
41 | assertValidate(property).run(26);
42 |
43 | property = new ExceptionDates();
44 | property.getValues().add(new ICalDate(true));
45 | property.getValues().add(new ICalDate(false));
46 | assertValidate(property).run(50);
47 |
48 | property = new ExceptionDates();
49 | property.getValues().add(new ICalDate());
50 | assertValidate(property).run();
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/main/java/biweekly/io/scribe/property/TimezoneIdScribe.java:
--------------------------------------------------------------------------------
1 | package biweekly.io.scribe.property;
2 |
3 | import java.util.EnumSet;
4 | import java.util.Set;
5 |
6 | import biweekly.ICalVersion;
7 | import biweekly.property.TimezoneId;
8 |
9 | /*
10 | Copyright (c) 2013-2024, Michael Angstadt
11 | All rights reserved.
12 |
13 | Redistribution and use in source and binary forms, with or without
14 | modification, are permitted provided that the following conditions are met:
15 |
16 | 1. Redistributions of source code must retain the above copyright notice, this
17 | list of conditions and the following disclaimer.
18 | 2. Redistributions in binary form must reproduce the above copyright notice,
19 | this list of conditions and the following disclaimer in the documentation
20 | and/or other materials provided with the distribution.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
26 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | /**
35 | * Marshals {@link TimezoneId} properties.
36 | * @author Michael Angstadt
37 | */
38 | public class TimezoneIdScribe extends TextPropertyScribe {
39 | public TimezoneIdScribe() {
40 | super(TimezoneId.class, "TZID");
41 | }
42 |
43 | @Override
44 | protected TimezoneId newInstance(String value, ICalVersion version) {
45 | return new TimezoneId(value);
46 | }
47 |
48 | @Override
49 | public Set getSupportedVersions() {
50 | return EnumSet.of(ICalVersion.V2_0_DEPRECATED, ICalVersion.V2_0);
51 | }
52 | }
--------------------------------------------------------------------------------
/src/main/java/biweekly/io/scribe/property/TimezoneNameScribe.java:
--------------------------------------------------------------------------------
1 | package biweekly.io.scribe.property;
2 |
3 | import java.util.EnumSet;
4 | import java.util.Set;
5 |
6 | import biweekly.ICalVersion;
7 | import biweekly.property.TimezoneName;
8 |
9 | /*
10 | Copyright (c) 2013-2024, Michael Angstadt
11 | All rights reserved.
12 |
13 | Redistribution and use in source and binary forms, with or without
14 | modification, are permitted provided that the following conditions are met:
15 |
16 | 1. Redistributions of source code must retain the above copyright notice, this
17 | list of conditions and the following disclaimer.
18 | 2. Redistributions in binary form must reproduce the above copyright notice,
19 | this list of conditions and the following disclaimer in the documentation
20 | and/or other materials provided with the distribution.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
26 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | /**
35 | * Marshals {@link TimezoneName} properties.
36 | * @author Michael Angstadt
37 | */
38 | public class TimezoneNameScribe extends TextPropertyScribe {
39 | public TimezoneNameScribe() {
40 | super(TimezoneName.class, "TZNAME");
41 | }
42 |
43 | @Override
44 | protected TimezoneName newInstance(String value, ICalVersion version) {
45 | return new TimezoneName(value);
46 | }
47 |
48 | @Override
49 | public Set getSupportedVersions() {
50 | return EnumSet.of(ICalVersion.V2_0_DEPRECATED, ICalVersion.V2_0);
51 | }
52 | }
--------------------------------------------------------------------------------
/src/test/java/biweekly/util/IOUtilsTest.java:
--------------------------------------------------------------------------------
1 | package biweekly.util;
2 |
3 | import static org.mockito.Mockito.doThrow;
4 | import static org.mockito.Mockito.mock;
5 | import static org.mockito.Mockito.verify;
6 |
7 | import java.io.Closeable;
8 | import java.io.IOException;
9 |
10 | import org.junit.Test;
11 |
12 | /*
13 | Copyright (c) 2013-2024, Michael Angstadt
14 | All rights reserved.
15 |
16 | Redistribution and use in source and binary forms, with or without
17 | modification, are permitted provided that the following conditions are met:
18 |
19 | 1. Redistributions of source code must retain the above copyright notice, this
20 | list of conditions and the following disclaimer.
21 | 2. Redistributions in binary form must reproduce the above copyright notice,
22 | this list of conditions and the following disclaimer in the documentation
23 | and/or other materials provided with the distribution.
24 |
25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
26 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
29 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
32 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 | */
36 |
37 | /**
38 | * @author Michael Angstadt
39 | */
40 | public class IOUtilsTest {
41 | @Test
42 | public void closeQuietly() throws Exception {
43 | IOUtils.closeQuietly(null);
44 |
45 | Closeable closeable = mock(Closeable.class);
46 | IOUtils.closeQuietly(closeable);
47 | verify(closeable).close();
48 |
49 | closeable = mock(Closeable.class);
50 | doThrow(new IOException()).when(closeable).close();
51 | IOUtils.closeQuietly(closeable);
52 | verify(closeable).close();
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/main/java/biweekly/io/scribe/property/CalendarScaleScribe.java:
--------------------------------------------------------------------------------
1 | package biweekly.io.scribe.property;
2 |
3 | import java.util.EnumSet;
4 | import java.util.Set;
5 |
6 | import biweekly.ICalVersion;
7 | import biweekly.property.CalendarScale;
8 |
9 | /*
10 | Copyright (c) 2013-2024, Michael Angstadt
11 | All rights reserved.
12 |
13 | Redistribution and use in source and binary forms, with or without
14 | modification, are permitted provided that the following conditions are met:
15 |
16 | 1. Redistributions of source code must retain the above copyright notice, this
17 | list of conditions and the following disclaimer.
18 | 2. Redistributions in binary form must reproduce the above copyright notice,
19 | this list of conditions and the following disclaimer in the documentation
20 | and/or other materials provided with the distribution.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
26 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | /**
35 | * Marshals {@link CalendarScale} properties.
36 | * @author Michael Angstadt
37 | */
38 | public class CalendarScaleScribe extends TextPropertyScribe {
39 | public CalendarScaleScribe() {
40 | super(CalendarScale.class, "CALSCALE");
41 | }
42 |
43 | @Override
44 | protected CalendarScale newInstance(String value, ICalVersion version) {
45 | return new CalendarScale(value);
46 | }
47 |
48 | @Override
49 | public Set getSupportedVersions() {
50 | return EnumSet.of(ICalVersion.V2_0_DEPRECATED, ICalVersion.V2_0);
51 | }
52 | }
--------------------------------------------------------------------------------
/src/main/java/biweekly/io/scribe/property/PercentCompleteScribe.java:
--------------------------------------------------------------------------------
1 | package biweekly.io.scribe.property;
2 |
3 | import java.util.EnumSet;
4 | import java.util.Set;
5 |
6 | import biweekly.ICalVersion;
7 | import biweekly.property.PercentComplete;
8 |
9 | /*
10 | Copyright (c) 2013-2024, Michael Angstadt
11 | All rights reserved.
12 |
13 | Redistribution and use in source and binary forms, with or without
14 | modification, are permitted provided that the following conditions are met:
15 |
16 | 1. Redistributions of source code must retain the above copyright notice, this
17 | list of conditions and the following disclaimer.
18 | 2. Redistributions in binary form must reproduce the above copyright notice,
19 | this list of conditions and the following disclaimer in the documentation
20 | and/or other materials provided with the distribution.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
26 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | /**
35 | * Marshals {@link PercentComplete} properties.
36 | * @author Michael Angstadt
37 | */
38 | public class PercentCompleteScribe extends IntegerPropertyScribe {
39 | public PercentCompleteScribe() {
40 | super(PercentComplete.class, "PERCENT-COMPLETE");
41 | }
42 |
43 | @Override
44 | protected PercentComplete newInstance(Integer value) {
45 | return new PercentComplete(value);
46 | }
47 |
48 | @Override
49 | public Set getSupportedVersions() {
50 | return EnumSet.of(ICalVersion.V2_0_DEPRECATED, ICalVersion.V2_0);
51 | }
52 | }
--------------------------------------------------------------------------------
/src/main/java/biweekly/parameter/EnumParameterValue.java:
--------------------------------------------------------------------------------
1 | package biweekly.parameter;
2 |
3 | /*
4 | Copyright (c) 2013-2024, Michael Angstadt
5 | All rights reserved.
6 |
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions are met:
9 |
10 | 1. Redistributions of source code must retain the above copyright notice, this
11 | list of conditions and the following disclaimer.
12 | 2. Redistributions in binary form must reproduce the above copyright notice,
13 | this list of conditions and the following disclaimer in the documentation
14 | and/or other materials provided with the distribution.
15 |
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | /**
29 | * Represents a value from a parameter that has a list of pre-defined values
30 | * (for example, the VALUE or ACTION parameters).
31 | * @author Michael Angstadt
32 | */
33 | public class EnumParameterValue {
34 | /**
35 | * The value (for example, "text").
36 | */
37 | protected final String value;
38 |
39 | /**
40 | * @param value the value (e.g. "text")
41 | */
42 | protected EnumParameterValue(String value) {
43 | this.value = value;
44 | }
45 |
46 | /**
47 | * Gets the value of the parameter.
48 | * @return the value of the parameter (e.g. "text")
49 | */
50 | public String getValue() {
51 | return value;
52 | }
53 |
54 | @Override
55 | public String toString() {
56 | return value;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/main/java/biweekly/io/scribe/property/RecurrenceIdScribe.java:
--------------------------------------------------------------------------------
1 | package biweekly.io.scribe.property;
2 |
3 | import java.util.EnumSet;
4 | import java.util.Set;
5 |
6 | import biweekly.ICalVersion;
7 | import biweekly.property.RecurrenceId;
8 | import biweekly.util.ICalDate;
9 |
10 | /*
11 | Copyright (c) 2013-2024, Michael Angstadt
12 | All rights reserved.
13 |
14 | Redistribution and use in source and binary forms, with or without
15 | modification, are permitted provided that the following conditions are met:
16 |
17 | 1. Redistributions of source code must retain the above copyright notice, this
18 | list of conditions and the following disclaimer.
19 | 2. Redistributions in binary form must reproduce the above copyright notice,
20 | this list of conditions and the following disclaimer in the documentation
21 | and/or other materials provided with the distribution.
22 |
23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
27 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 | */
34 |
35 | /**
36 | * Marshals {@link RecurrenceId} properties.
37 | * @author Michael Angstadt
38 | */
39 | public class RecurrenceIdScribe extends DateOrDateTimePropertyScribe {
40 | public RecurrenceIdScribe() {
41 | super(RecurrenceId.class, "RECURRENCE-ID");
42 | }
43 |
44 | @Override
45 | protected RecurrenceId newInstance(ICalDate date) {
46 | return new RecurrenceId(date);
47 | }
48 |
49 | @Override
50 | public Set getSupportedVersions() {
51 | return EnumSet.of(ICalVersion.V2_0_DEPRECATED, ICalVersion.V2_0);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/main/java/biweekly/io/scribe/property/TimezoneUrlScribe.java:
--------------------------------------------------------------------------------
1 | package biweekly.io.scribe.property;
2 |
3 | import java.util.EnumSet;
4 | import java.util.Set;
5 |
6 | import biweekly.ICalDataType;
7 | import biweekly.ICalVersion;
8 | import biweekly.property.TimezoneUrl;
9 |
10 | /*
11 | Copyright (c) 2013-2024, Michael Angstadt
12 | All rights reserved.
13 |
14 | Redistribution and use in source and binary forms, with or without
15 | modification, are permitted provided that the following conditions are met:
16 |
17 | 1. Redistributions of source code must retain the above copyright notice, this
18 | list of conditions and the following disclaimer.
19 | 2. Redistributions in binary form must reproduce the above copyright notice,
20 | this list of conditions and the following disclaimer in the documentation
21 | and/or other materials provided with the distribution.
22 |
23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
27 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 | */
34 |
35 | /**
36 | * Marshals {@link TimezoneUrl} properties.
37 | * @author Michael Angstadt
38 | */
39 | public class TimezoneUrlScribe extends TextPropertyScribe {
40 | public TimezoneUrlScribe() {
41 | super(TimezoneUrl.class, "TZURL", ICalDataType.URI);
42 | }
43 |
44 | @Override
45 | protected TimezoneUrl newInstance(String value, ICalVersion version) {
46 | return new TimezoneUrl(value);
47 | }
48 |
49 | @Override
50 | public Set getSupportedVersions() {
51 | return EnumSet.of(ICalVersion.V2_0_DEPRECATED, ICalVersion.V2_0);
52 | }
53 | }
--------------------------------------------------------------------------------
/src/main/java/biweekly/io/scribe/property/TimezoneOffsetToScribe.java:
--------------------------------------------------------------------------------
1 | package biweekly.io.scribe.property;
2 |
3 | import java.util.EnumSet;
4 | import java.util.Set;
5 |
6 | import biweekly.ICalVersion;
7 | import biweekly.property.TimezoneOffsetTo;
8 | import biweekly.util.UtcOffset;
9 |
10 | /*
11 | Copyright (c) 2013-2024, Michael Angstadt
12 | All rights reserved.
13 |
14 | Redistribution and use in source and binary forms, with or without
15 | modification, are permitted provided that the following conditions are met:
16 |
17 | 1. Redistributions of source code must retain the above copyright notice, this
18 | list of conditions and the following disclaimer.
19 | 2. Redistributions in binary form must reproduce the above copyright notice,
20 | this list of conditions and the following disclaimer in the documentation
21 | and/or other materials provided with the distribution.
22 |
23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
27 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 | */
34 |
35 | /**
36 | * Marshals {@link TimezoneOffsetTo} properties.
37 | * @author Michael Angstadt
38 | */
39 | public class TimezoneOffsetToScribe extends UtcOffsetPropertyScribe {
40 | public TimezoneOffsetToScribe() {
41 | super(TimezoneOffsetTo.class, "TZOFFSETTO");
42 | }
43 |
44 | @Override
45 | protected TimezoneOffsetTo newInstance(UtcOffset offset) {
46 | return new TimezoneOffsetTo(offset);
47 | }
48 |
49 | @Override
50 | public Set getSupportedVersions() {
51 | return EnumSet.of(ICalVersion.V2_0_DEPRECATED, ICalVersion.V2_0);
52 | }
53 | }
--------------------------------------------------------------------------------
/src/main/java/biweekly/io/scribe/property/TimezoneOffsetFromScribe.java:
--------------------------------------------------------------------------------
1 | package biweekly.io.scribe.property;
2 |
3 | import java.util.EnumSet;
4 | import java.util.Set;
5 |
6 | import biweekly.ICalVersion;
7 | import biweekly.property.TimezoneOffsetFrom;
8 | import biweekly.util.UtcOffset;
9 |
10 | /*
11 | Copyright (c) 2013-2024, Michael Angstadt
12 | All rights reserved.
13 |
14 | Redistribution and use in source and binary forms, with or without
15 | modification, are permitted provided that the following conditions are met:
16 |
17 | 1. Redistributions of source code must retain the above copyright notice, this
18 | list of conditions and the following disclaimer.
19 | 2. Redistributions in binary form must reproduce the above copyright notice,
20 | this list of conditions and the following disclaimer in the documentation
21 | and/or other materials provided with the distribution.
22 |
23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
27 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 | */
34 |
35 | /**
36 | * Marshals {@link TimezoneOffsetFrom} properties.
37 | * @author Michael Angstadt
38 | */
39 | public class TimezoneOffsetFromScribe extends UtcOffsetPropertyScribe {
40 | public TimezoneOffsetFromScribe() {
41 | super(TimezoneOffsetFrom.class, "TZOFFSETFROM");
42 | }
43 |
44 | @Override
45 | protected TimezoneOffsetFrom newInstance(UtcOffset offset) {
46 | return new TimezoneOffsetFrom(offset);
47 | }
48 |
49 | @Override
50 | public Set getSupportedVersions() {
51 | return EnumSet.of(ICalVersion.V2_0_DEPRECATED, ICalVersion.V2_0);
52 | }
53 | }
--------------------------------------------------------------------------------
/src/main/javadoc/biweekly/doc-files/shBrushJava.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/SyntaxHighlighter
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 | *
8 | * @version
9 | * 3.0.83 (July 02 2010)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2010 Alex Gorbatchev.
13 | *
14 | * @license
15 | * Dual licensed under the MIT and GPL licenses.
16 | */
17 | ;(function()
18 | {
19 | // CommonJS
20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21 |
22 | function Brush()
23 | {
24 | var keywords = 'abstract assert boolean break byte case catch char class const ' +
25 | 'continue default do double else enum extends ' +
26 | 'false final finally float for goto if implements import ' +
27 | 'instanceof int interface long native new null ' +
28 | 'package private protected public return ' +
29 | 'short static strictfp super switch synchronized this throw throws true ' +
30 | 'transient try void volatile while';
31 |
32 | this.regexList = [
33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
34 | { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
35 | { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
38 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
39 | { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
40 | { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
42 | ];
43 |
44 | this.forHtmlScript({
45 | left : /(<|<)%[@!=]?/g,
46 | right : /%(>|>)/g
47 | });
48 | };
49 |
50 | Brush.prototype = new SyntaxHighlighter.Highlighter();
51 | Brush.aliases = ['java'];
52 |
53 | SyntaxHighlighter.brushes.Java = Brush;
54 |
55 | // CommonJS
56 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
57 | })();
58 |
--------------------------------------------------------------------------------
/src/main/javadoc/biweekly/io/doc-files/shBrushJava.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/SyntaxHighlighter
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 | *
8 | * @version
9 | * 3.0.83 (July 02 2010)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2010 Alex Gorbatchev.
13 | *
14 | * @license
15 | * Dual licensed under the MIT and GPL licenses.
16 | */
17 | ;(function()
18 | {
19 | // CommonJS
20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21 |
22 | function Brush()
23 | {
24 | var keywords = 'abstract assert boolean break byte case catch char class const ' +
25 | 'continue default do double else enum extends ' +
26 | 'false final finally float for goto if implements import ' +
27 | 'instanceof int interface long native new null ' +
28 | 'package private protected public return ' +
29 | 'short static strictfp super switch synchronized this throw throws true ' +
30 | 'transient try void volatile while';
31 |
32 | this.regexList = [
33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
34 | { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
35 | { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
38 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
39 | { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
40 | { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
42 | ];
43 |
44 | this.forHtmlScript({
45 | left : /(<|<)%[@!=]?/g,
46 | right : /%(>|>)/g
47 | });
48 | };
49 |
50 | Brush.prototype = new SyntaxHighlighter.Highlighter();
51 | Brush.aliases = ['java'];
52 |
53 | SyntaxHighlighter.brushes.Java = Brush;
54 |
55 | // CommonJS
56 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
57 | })();
58 |
--------------------------------------------------------------------------------
/src/main/javadoc/biweekly/util/doc-files/shBrushJava.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/SyntaxHighlighter
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 | *
8 | * @version
9 | * 3.0.83 (July 02 2010)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2010 Alex Gorbatchev.
13 | *
14 | * @license
15 | * Dual licensed under the MIT and GPL licenses.
16 | */
17 | ;(function()
18 | {
19 | // CommonJS
20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21 |
22 | function Brush()
23 | {
24 | var keywords = 'abstract assert boolean break byte case catch char class const ' +
25 | 'continue default do double else enum extends ' +
26 | 'false final finally float for goto if implements import ' +
27 | 'instanceof int interface long native new null ' +
28 | 'package private protected public return ' +
29 | 'short static strictfp super switch synchronized this throw throws true ' +
30 | 'transient try void volatile while';
31 |
32 | this.regexList = [
33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
34 | { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
35 | { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
38 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
39 | { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
40 | { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
42 | ];
43 |
44 | this.forHtmlScript({
45 | left : /(<|<)%[@!=]?/g,
46 | right : /%(>|>)/g
47 | });
48 | };
49 |
50 | Brush.prototype = new SyntaxHighlighter.Highlighter();
51 | Brush.aliases = ['java'];
52 |
53 | SyntaxHighlighter.brushes.Java = Brush;
54 |
55 | // CommonJS
56 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
57 | })();
58 |
--------------------------------------------------------------------------------
/src/main/javadoc/biweekly/component/doc-files/shBrushJava.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/SyntaxHighlighter
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 | *
8 | * @version
9 | * 3.0.83 (July 02 2010)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2010 Alex Gorbatchev.
13 | *
14 | * @license
15 | * Dual licensed under the MIT and GPL licenses.
16 | */
17 | ;(function()
18 | {
19 | // CommonJS
20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21 |
22 | function Brush()
23 | {
24 | var keywords = 'abstract assert boolean break byte case catch char class const ' +
25 | 'continue default do double else enum extends ' +
26 | 'false final finally float for goto if implements import ' +
27 | 'instanceof int interface long native new null ' +
28 | 'package private protected public return ' +
29 | 'short static strictfp super switch synchronized this throw throws true ' +
30 | 'transient try void volatile while';
31 |
32 | this.regexList = [
33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
34 | { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
35 | { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
38 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
39 | { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
40 | { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
42 | ];
43 |
44 | this.forHtmlScript({
45 | left : /(<|<)%[@!=]?/g,
46 | right : /%(>|>)/g
47 | });
48 | };
49 |
50 | Brush.prototype = new SyntaxHighlighter.Highlighter();
51 | Brush.aliases = ['java'];
52 |
53 | SyntaxHighlighter.brushes.Java = Brush;
54 |
55 | // CommonJS
56 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
57 | })();
58 |
--------------------------------------------------------------------------------
/src/main/javadoc/biweekly/io/chain/doc-files/shBrushJava.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/SyntaxHighlighter
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 | *
8 | * @version
9 | * 3.0.83 (July 02 2010)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2010 Alex Gorbatchev.
13 | *
14 | * @license
15 | * Dual licensed under the MIT and GPL licenses.
16 | */
17 | ;(function()
18 | {
19 | // CommonJS
20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21 |
22 | function Brush()
23 | {
24 | var keywords = 'abstract assert boolean break byte case catch char class const ' +
25 | 'continue default do double else enum extends ' +
26 | 'false final finally float for goto if implements import ' +
27 | 'instanceof int interface long native new null ' +
28 | 'package private protected public return ' +
29 | 'short static strictfp super switch synchronized this throw throws true ' +
30 | 'transient try void volatile while';
31 |
32 | this.regexList = [
33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
34 | { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
35 | { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
38 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
39 | { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
40 | { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
42 | ];
43 |
44 | this.forHtmlScript({
45 | left : /(<|<)%[@!=]?/g,
46 | right : /%(>|>)/g
47 | });
48 | };
49 |
50 | Brush.prototype = new SyntaxHighlighter.Highlighter();
51 | Brush.aliases = ['java'];
52 |
53 | SyntaxHighlighter.brushes.Java = Brush;
54 |
55 | // CommonJS
56 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
57 | })();
58 |
--------------------------------------------------------------------------------
/src/main/javadoc/biweekly/io/json/doc-files/shBrushJava.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/SyntaxHighlighter
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 | *
8 | * @version
9 | * 3.0.83 (July 02 2010)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2010 Alex Gorbatchev.
13 | *
14 | * @license
15 | * Dual licensed under the MIT and GPL licenses.
16 | */
17 | ;(function()
18 | {
19 | // CommonJS
20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21 |
22 | function Brush()
23 | {
24 | var keywords = 'abstract assert boolean break byte case catch char class const ' +
25 | 'continue default do double else enum extends ' +
26 | 'false final finally float for goto if implements import ' +
27 | 'instanceof int interface long native new null ' +
28 | 'package private protected public return ' +
29 | 'short static strictfp super switch synchronized this throw throws true ' +
30 | 'transient try void volatile while';
31 |
32 | this.regexList = [
33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
34 | { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
35 | { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
38 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
39 | { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
40 | { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
42 | ];
43 |
44 | this.forHtmlScript({
45 | left : /(<|<)%[@!=]?/g,
46 | right : /%(>|>)/g
47 | });
48 | };
49 |
50 | Brush.prototype = new SyntaxHighlighter.Highlighter();
51 | Brush.aliases = ['java'];
52 |
53 | SyntaxHighlighter.brushes.Java = Brush;
54 |
55 | // CommonJS
56 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
57 | })();
58 |
--------------------------------------------------------------------------------
/src/main/javadoc/biweekly/io/scribe/doc-files/shBrushJava.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/SyntaxHighlighter
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 | *
8 | * @version
9 | * 3.0.83 (July 02 2010)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2010 Alex Gorbatchev.
13 | *
14 | * @license
15 | * Dual licensed under the MIT and GPL licenses.
16 | */
17 | ;(function()
18 | {
19 | // CommonJS
20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21 |
22 | function Brush()
23 | {
24 | var keywords = 'abstract assert boolean break byte case catch char class const ' +
25 | 'continue default do double else enum extends ' +
26 | 'false final finally float for goto if implements import ' +
27 | 'instanceof int interface long native new null ' +
28 | 'package private protected public return ' +
29 | 'short static strictfp super switch synchronized this throw throws true ' +
30 | 'transient try void volatile while';
31 |
32 | this.regexList = [
33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
34 | { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
35 | { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
38 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
39 | { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
40 | { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
42 | ];
43 |
44 | this.forHtmlScript({
45 | left : /(<|<)%[@!=]?/g,
46 | right : /%(>|>)/g
47 | });
48 | };
49 |
50 | Brush.prototype = new SyntaxHighlighter.Highlighter();
51 | Brush.aliases = ['java'];
52 |
53 | SyntaxHighlighter.brushes.Java = Brush;
54 |
55 | // CommonJS
56 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
57 | })();
58 |
--------------------------------------------------------------------------------
/src/main/javadoc/biweekly/io/text/doc-files/shBrushJava.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/SyntaxHighlighter
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 | *
8 | * @version
9 | * 3.0.83 (July 02 2010)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2010 Alex Gorbatchev.
13 | *
14 | * @license
15 | * Dual licensed under the MIT and GPL licenses.
16 | */
17 | ;(function()
18 | {
19 | // CommonJS
20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21 |
22 | function Brush()
23 | {
24 | var keywords = 'abstract assert boolean break byte case catch char class const ' +
25 | 'continue default do double else enum extends ' +
26 | 'false final finally float for goto if implements import ' +
27 | 'instanceof int interface long native new null ' +
28 | 'package private protected public return ' +
29 | 'short static strictfp super switch synchronized this throw throws true ' +
30 | 'transient try void volatile while';
31 |
32 | this.regexList = [
33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
34 | { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
35 | { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
38 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
39 | { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
40 | { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
42 | ];
43 |
44 | this.forHtmlScript({
45 | left : /(<|<)%[@!=]?/g,
46 | right : /%(>|>)/g
47 | });
48 | };
49 |
50 | Brush.prototype = new SyntaxHighlighter.Highlighter();
51 | Brush.aliases = ['java'];
52 |
53 | SyntaxHighlighter.brushes.Java = Brush;
54 |
55 | // CommonJS
56 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
57 | })();
58 |
--------------------------------------------------------------------------------
/src/main/javadoc/biweekly/io/xml/doc-files/shBrushJava.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/SyntaxHighlighter
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 | *
8 | * @version
9 | * 3.0.83 (July 02 2010)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2010 Alex Gorbatchev.
13 | *
14 | * @license
15 | * Dual licensed under the MIT and GPL licenses.
16 | */
17 | ;(function()
18 | {
19 | // CommonJS
20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21 |
22 | function Brush()
23 | {
24 | var keywords = 'abstract assert boolean break byte case catch char class const ' +
25 | 'continue default do double else enum extends ' +
26 | 'false final finally float for goto if implements import ' +
27 | 'instanceof int interface long native new null ' +
28 | 'package private protected public return ' +
29 | 'short static strictfp super switch synchronized this throw throws true ' +
30 | 'transient try void volatile while';
31 |
32 | this.regexList = [
33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
34 | { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
35 | { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
38 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
39 | { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
40 | { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
42 | ];
43 |
44 | this.forHtmlScript({
45 | left : /(<|<)%[@!=]?/g,
46 | right : /%(>|>)/g
47 | });
48 | };
49 |
50 | Brush.prototype = new SyntaxHighlighter.Highlighter();
51 | Brush.aliases = ['java'];
52 |
53 | SyntaxHighlighter.brushes.Java = Brush;
54 |
55 | // CommonJS
56 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
57 | })();
58 |
--------------------------------------------------------------------------------
/src/main/javadoc/biweekly/parameter/doc-files/shBrushJava.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/SyntaxHighlighter
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 | *
8 | * @version
9 | * 3.0.83 (July 02 2010)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2010 Alex Gorbatchev.
13 | *
14 | * @license
15 | * Dual licensed under the MIT and GPL licenses.
16 | */
17 | ;(function()
18 | {
19 | // CommonJS
20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21 |
22 | function Brush()
23 | {
24 | var keywords = 'abstract assert boolean break byte case catch char class const ' +
25 | 'continue default do double else enum extends ' +
26 | 'false final finally float for goto if implements import ' +
27 | 'instanceof int interface long native new null ' +
28 | 'package private protected public return ' +
29 | 'short static strictfp super switch synchronized this throw throws true ' +
30 | 'transient try void volatile while';
31 |
32 | this.regexList = [
33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
34 | { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
35 | { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
38 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
39 | { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
40 | { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
42 | ];
43 |
44 | this.forHtmlScript({
45 | left : /(<|<)%[@!=]?/g,
46 | right : /%(>|>)/g
47 | });
48 | };
49 |
50 | Brush.prototype = new SyntaxHighlighter.Highlighter();
51 | Brush.aliases = ['java'];
52 |
53 | SyntaxHighlighter.brushes.Java = Brush;
54 |
55 | // CommonJS
56 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
57 | })();
58 |
--------------------------------------------------------------------------------
/src/main/javadoc/biweekly/property/doc-files/shBrushJava.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/SyntaxHighlighter
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 | *
8 | * @version
9 | * 3.0.83 (July 02 2010)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2010 Alex Gorbatchev.
13 | *
14 | * @license
15 | * Dual licensed under the MIT and GPL licenses.
16 | */
17 | ;(function()
18 | {
19 | // CommonJS
20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21 |
22 | function Brush()
23 | {
24 | var keywords = 'abstract assert boolean break byte case catch char class const ' +
25 | 'continue default do double else enum extends ' +
26 | 'false final finally float for goto if implements import ' +
27 | 'instanceof int interface long native new null ' +
28 | 'package private protected public return ' +
29 | 'short static strictfp super switch synchronized this throw throws true ' +
30 | 'transient try void volatile while';
31 |
32 | this.regexList = [
33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
34 | { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
35 | { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
38 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
39 | { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
40 | { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
42 | ];
43 |
44 | this.forHtmlScript({
45 | left : /(<|<)%[@!=]?/g,
46 | right : /%(>|>)/g
47 | });
48 | };
49 |
50 | Brush.prototype = new SyntaxHighlighter.Highlighter();
51 | Brush.aliases = ['java'];
52 |
53 | SyntaxHighlighter.brushes.Java = Brush;
54 |
55 | // CommonJS
56 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
57 | })();
58 |
--------------------------------------------------------------------------------
/src/main/java/biweekly/io/scribe/property/ImageScribe.java:
--------------------------------------------------------------------------------
1 | package biweekly.io.scribe.property;
2 |
3 | import biweekly.ICalDataType;
4 | import biweekly.property.Image;
5 |
6 | /*
7 | Copyright (c) 2013-2024, Michael Angstadt
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without
11 | modification, are permitted provided that the following conditions are met:
12 |
13 | 1. Redistributions of source code must retain the above copyright notice, this
14 | list of conditions and the following disclaimer.
15 | 2. Redistributions in binary form must reproduce the above copyright notice,
16 | this list of conditions and the following disclaimer in the documentation
17 | and/or other materials provided with the distribution.
18 |
19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
23 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 | */
30 |
31 | /**
32 | * Marshals {@link Image} properties.
33 | * @author Michael Angstadt
34 | */
35 | public class ImageScribe extends BinaryPropertyScribe {
36 | public ImageScribe() {
37 | super(Image.class, "IMAGE");
38 | }
39 |
40 | @Override
41 | protected Image newInstance(byte[] data) {
42 | /*
43 | * Note: "formatType" will be set when the parameters are assigned to
44 | * the property object.
45 | */
46 | return new Image(null, data);
47 | }
48 |
49 | @Override
50 | protected Image newInstance(String value, ICalDataType dataType) {
51 | /*
52 | * Note: "formatType" will be set when the parameters are assigned to
53 | * the property object.
54 | */
55 | return new Image(null, value);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/main/javadoc/biweekly/io/scribe/component/doc-files/shBrushJava.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/SyntaxHighlighter
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 | *
8 | * @version
9 | * 3.0.83 (July 02 2010)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2010 Alex Gorbatchev.
13 | *
14 | * @license
15 | * Dual licensed under the MIT and GPL licenses.
16 | */
17 | ;(function()
18 | {
19 | // CommonJS
20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21 |
22 | function Brush()
23 | {
24 | var keywords = 'abstract assert boolean break byte case catch char class const ' +
25 | 'continue default do double else enum extends ' +
26 | 'false final finally float for goto if implements import ' +
27 | 'instanceof int interface long native new null ' +
28 | 'package private protected public return ' +
29 | 'short static strictfp super switch synchronized this throw throws true ' +
30 | 'transient try void volatile while';
31 |
32 | this.regexList = [
33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
34 | { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
35 | { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
38 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
39 | { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
40 | { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
42 | ];
43 |
44 | this.forHtmlScript({
45 | left : /(<|<)%[@!=]?/g,
46 | right : /%(>|>)/g
47 | });
48 | };
49 |
50 | Brush.prototype = new SyntaxHighlighter.Highlighter();
51 | Brush.aliases = ['java'];
52 |
53 | SyntaxHighlighter.brushes.Java = Brush;
54 |
55 | // CommonJS
56 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
57 | })();
58 |
--------------------------------------------------------------------------------
/src/main/javadoc/biweekly/io/scribe/property/doc-files/shBrushJava.js:
--------------------------------------------------------------------------------
1 | /**
2 | * SyntaxHighlighter
3 | * http://alexgorbatchev.com/SyntaxHighlighter
4 | *
5 | * SyntaxHighlighter is donationware. If you are using it, please donate.
6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
7 | *
8 | * @version
9 | * 3.0.83 (July 02 2010)
10 | *
11 | * @copyright
12 | * Copyright (C) 2004-2010 Alex Gorbatchev.
13 | *
14 | * @license
15 | * Dual licensed under the MIT and GPL licenses.
16 | */
17 | ;(function()
18 | {
19 | // CommonJS
20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
21 |
22 | function Brush()
23 | {
24 | var keywords = 'abstract assert boolean break byte case catch char class const ' +
25 | 'continue default do double else enum extends ' +
26 | 'false final finally float for goto if implements import ' +
27 | 'instanceof int interface long native new null ' +
28 | 'package private protected public return ' +
29 | 'short static strictfp super switch synchronized this throw throws true ' +
30 | 'transient try void volatile while';
31 |
32 | this.regexList = [
33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
34 | { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
35 | { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
38 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
39 | { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
40 | { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
42 | ];
43 |
44 | this.forHtmlScript({
45 | left : /(<|<)%[@!=]?/g,
46 | right : /%(>|>)/g
47 | });
48 | };
49 |
50 | Brush.prototype = new SyntaxHighlighter.Highlighter();
51 | Brush.aliases = ['java'];
52 |
53 | SyntaxHighlighter.brushes.Java = Brush;
54 |
55 | // CommonJS
56 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
57 | })();
58 |
--------------------------------------------------------------------------------
/src/main/java/biweekly/io/SkipMeException.java:
--------------------------------------------------------------------------------
1 | package biweekly.io;
2 |
3 | import biweekly.ICalendar;
4 |
5 | /*
6 | Copyright (c) 2013-2024, Michael Angstadt
7 | All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice, this
13 | list of conditions and the following disclaimer.
14 | 2. Redistributions in binary form must reproduce the above copyright notice,
15 | this list of conditions and the following disclaimer in the documentation
16 | and/or other materials provided with the distribution.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | /**
31 | * Thrown during the reading or writing of an iCalendar property to show that
32 | * the property should not be written to the iCalendar data stream or not be
33 | * included in the parsed {@link ICalendar} object.
34 | * @author Michael Angstadt
35 | */
36 | public class SkipMeException extends RuntimeException {
37 | private static final long serialVersionUID = 3384029056232963767L;
38 | private final String reason;
39 |
40 | /**
41 | * Creates a new "skip me" exception.
42 | * @param reason the reason why the property was skipped
43 | */
44 | public SkipMeException(String reason) {
45 | super(reason);
46 | this.reason = reason;
47 | }
48 |
49 | /**
50 | * Gets the reason why the property was skipped.
51 | * @return the reason
52 | */
53 | public String getReason() {
54 | return reason;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/main/java/biweekly/util/Utf8Reader.java:
--------------------------------------------------------------------------------
1 | package biweekly.util;
2 |
3 | import java.io.File;
4 | import java.io.FileInputStream;
5 | import java.io.FileNotFoundException;
6 | import java.io.InputStream;
7 | import java.io.InputStreamReader;
8 | import java.nio.charset.Charset;
9 |
10 | /*
11 | Copyright (c) 2013-2024, Michael Angstadt
12 | All rights reserved.
13 |
14 | Redistribution and use in source and binary forms, with or without
15 | modification, are permitted provided that the following conditions are met:
16 |
17 | 1. Redistributions of source code must retain the above copyright notice, this
18 | list of conditions and the following disclaimer.
19 | 2. Redistributions in binary form must reproduce the above copyright notice,
20 | this list of conditions and the following disclaimer in the documentation
21 | and/or other materials provided with the distribution.
22 |
23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
27 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 | */
34 |
35 | /**
36 | * Reads characters that are encoded in UTF-8.
37 | * @author Michael Angstadt
38 | */
39 | public class Utf8Reader extends InputStreamReader {
40 | /**
41 | * Creates a new UTF-8 reader.
42 | * @param in the input stream to read from
43 | */
44 | public Utf8Reader(InputStream in) {
45 | super(in, Charset.forName("UTF-8"));
46 | }
47 |
48 | /**
49 | * Creates a new UTF-8 reader.
50 | * @param file the file to read from
51 | * @throws FileNotFoundException if the file does not exist or cannot be
52 | * opened
53 | */
54 | public Utf8Reader(File file) throws FileNotFoundException {
55 | this(new FileInputStream(file));
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/main/java/biweekly/io/GlobalTimezoneIdResolver.java:
--------------------------------------------------------------------------------
1 | package biweekly.io;
2 |
3 | import java.util.TimeZone;
4 |
5 | /*
6 | Copyright (c) 2013-2024, Michael Angstadt
7 | All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice, this
13 | list of conditions and the following disclaimer.
14 | 2. Redistributions in binary form must reproduce the above copyright notice,
15 | this list of conditions and the following disclaimer in the documentation
16 | and/or other materials provided with the distribution.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | /**
31 | * Gets Java {@link TimeZone} objects that correspond with TZID parameters that
32 | * contain global timezone IDs (as opposed to IDs that correspond with a
33 | * VTIMEZONE component).
34 | * @author Michael Angstadt
35 | * @see RFC 5545
36 | * section 3.8.3.1
37 | * @see RFC 2445
38 | * section 4.2.19
39 | */
40 | public interface GlobalTimezoneIdResolver {
41 | /**
42 | * Returns an appropriate Java {@link TimeZone} object that corresponds to
43 | * the given global ID.
44 | * @param globalId the global ID (the value of the TZID parameter, without
45 | * the forward slash prefix)
46 | * @return the corresponding {@link TimeZone} object or null if the global
47 | * ID is not recognized
48 | */
49 | TimeZone resolve(String globalId);
50 | }
51 |
--------------------------------------------------------------------------------
/src/main/java/biweekly/util/com/google/ical/values/DateTimeValue.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2006 Google Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | * All Rights Reserved.
16 | */
17 |
18 | /*
19 | Copyright (c) 2013-2024, Michael Angstadt
20 | All rights reserved.
21 |
22 | Redistribution and use in source and binary forms, with or without
23 | modification, are permitted provided that the following conditions are met:
24 |
25 | 1. Redistributions of source code must retain the above copyright notice, this
26 | list of conditions and the following disclaimer.
27 | 2. Redistributions in binary form must reproduce the above copyright notice,
28 | this list of conditions and the following disclaimer in the documentation
29 | and/or other materials provided with the distribution.
30 |
31 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
32 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
33 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
34 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
35 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
36 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
37 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
38 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
40 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 | */
42 |
43 | package biweekly.util.com.google.ical.values;
44 |
45 | /**
46 | * An instant in time.
47 | * @author Neal Gafter
48 | * @author Michael Angstadt
49 | */
50 | public interface DateTimeValue extends DateValue, TimeValue {
51 | //simple union
52 | }
53 |
--------------------------------------------------------------------------------
/src/main/java/biweekly/property/TimezoneId.java:
--------------------------------------------------------------------------------
1 | package biweekly.property;
2 |
3 | import biweekly.component.VTimezone;
4 |
5 | /*
6 | Copyright (c) 2013-2024, Michael Angstadt
7 | All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice, this
13 | list of conditions and the following disclaimer.
14 | 2. Redistributions in binary form must reproduce the above copyright notice,
15 | this list of conditions and the following disclaimer in the documentation
16 | and/or other materials provided with the distribution.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | /**
31 | * Defines a unique identifier for a {@link VTimezone} component. The identifier
32 | * must be unique within the scope of the iCalendar object.
33 | * @author Michael Angstadt
34 | * @see RFC 5545
35 | * p.102-3
36 | * @see RFC 2445 p.97-8
37 | */
38 | public class TimezoneId extends TextProperty {
39 | /**
40 | * Creates a timezone identifier property.
41 | * @param timezone the timezone identifier
42 | */
43 | public TimezoneId(String timezone) {
44 | super(timezone);
45 | }
46 |
47 | /**
48 | * Copy constructor.
49 | * @param original the property to make a copy of
50 | */
51 | public TimezoneId(TimezoneId original) {
52 | super(original);
53 | }
54 |
55 | @Override
56 | public TimezoneId copy() {
57 | return new TimezoneId(this);
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/main/java/biweekly/io/scribe/property/StatusScribe.java:
--------------------------------------------------------------------------------
1 | package biweekly.io.scribe.property;
2 |
3 | import biweekly.ICalVersion;
4 | import biweekly.io.WriteContext;
5 | import biweekly.property.Status;
6 |
7 | /*
8 | Copyright (c) 2013-2024, Michael Angstadt
9 | All rights reserved.
10 |
11 | Redistribution and use in source and binary forms, with or without
12 | modification, are permitted provided that the following conditions are met:
13 |
14 | 1. Redistributions of source code must retain the above copyright notice, this
15 | list of conditions and the following disclaimer.
16 | 2. Redistributions in binary form must reproduce the above copyright notice,
17 | this list of conditions and the following disclaimer in the documentation
18 | and/or other materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
24 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | /**
33 | * Marshals {@link Status} properties.
34 | * @author Michael Angstadt
35 | */
36 | public class StatusScribe extends TextPropertyScribe {
37 | public StatusScribe() {
38 | super(Status.class, "STATUS");
39 | }
40 |
41 | @Override
42 | protected String _writeText(Status property, WriteContext context) {
43 | if (context.getVersion() == ICalVersion.V1_0 && property.isNeedsAction()) {
44 | //vCal doesn't have a hyphen in the value
45 | return "NEEDS ACTION";
46 | }
47 | return super._writeText(property, context);
48 | }
49 |
50 | @Override
51 | protected Status newInstance(String value, ICalVersion version) {
52 | if (version == ICalVersion.V1_0 && "NEEDS ACTION".equalsIgnoreCase(value)) {
53 | //vCal doesn't have a hyphen in the value
54 | return Status.needsAction();
55 | }
56 | return new Status(value);
57 | }
58 | }
--------------------------------------------------------------------------------
/src/main/java/biweekly/util/com/google/ical/compat/javautil/DateIterable.java:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2006 Google Inc.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | /*
16 | Copyright (c) 2013-2024, Michael Angstadt
17 | All rights reserved.
18 |
19 | Redistribution and use in source and binary forms, with or without
20 | modification, are permitted provided that the following conditions are met:
21 |
22 | 1. Redistributions of source code must retain the above copyright notice, this
23 | list of conditions and the following disclaimer.
24 | 2. Redistributions in binary form must reproduce the above copyright notice,
25 | this list of conditions and the following disclaimer in the documentation
26 | and/or other materials provided with the distribution.
27 |
28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
29 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
30 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
31 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
32 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
33 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
34 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
35 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
37 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 | */
39 |
40 | package biweekly.util.com.google.ical.compat.javautil;
41 |
42 | import java.util.Date;
43 |
44 | /**
45 | * Iterates over a series of {@link Date} objects in ascending order.
46 | * @author mikesamuel+svn@gmail.com (Mike Samuel)
47 | * @author Michael Angstadt
48 | */
49 | public interface DateIterable extends Iterable {
50 | DateIterator iterator();
51 | }
52 |
--------------------------------------------------------------------------------