001    package biweekly.property;
002    
003    import biweekly.component.VEvent;
004    import biweekly.component.VFreeBusy;
005    import biweekly.component.VJournal;
006    import biweekly.component.VTodo;
007    
008    /*
009     Copyright (c) 2013, Michael Angstadt
010     All rights reserved.
011    
012     Redistribution and use in source and binary forms, with or without
013     modification, are permitted provided that the following conditions are met: 
014    
015     1. Redistributions of source code must retain the above copyright notice, this
016     list of conditions and the following disclaimer. 
017     2. Redistributions in binary form must reproduce the above copyright notice,
018     this list of conditions and the following disclaimer in the documentation
019     and/or other materials provided with the distribution. 
020    
021     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
022     ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
023     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
024     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
025     ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
026     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
027     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
028     ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
029     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
030     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
031     */
032    
033    /**
034     * <p>
035     * Defines an organizer. This property has different meanings depending on the
036     * component it belongs to:
037     * <ul>
038     * <li>{@link VEvent}, {@link VTodo}, {@link VJournal} - the organizer of the
039     * event/to-do/journal</li>
040     * <li>{@link VFreeBusy} - the person requesting the free/busy time</li>
041     * </ul>
042     * </p>
043     * 
044     * <pre>
045     * Organizer organizer = Organizer.email("johndoe@example.com")
046     * </pre>
047     * @author Michael Angstadt
048     * @see <a href="http://tools.ietf.org/html/rfc5545#page-111">RFC 5545
049     * p.111-2</a>
050     */
051    public class Organizer extends TextProperty {
052            /**
053             * Creates an organizer property
054             * @param uri a URI representing the organizer (typically, an email address,
055             * e.g. "mailto:johndoe@example.com")
056             */
057            public Organizer(String uri) {
058                    super(uri);
059            }
060    
061            /**
062             * Creates an organizer property using an email address as its value.
063             * @param email the email address (e.g. "johndoe@example.com")
064             * @return the property
065             */
066            public static Organizer email(String email) {
067                    return new Organizer("mailto:" + email);
068            }
069    
070            @Override
071            public String getSentBy() {
072                    return super.getSentBy();
073            }
074    
075            @Override
076            public void setSentBy(String sentBy) {
077                    super.setSentBy(sentBy);
078            }
079    
080            @Override
081            public String getCommonName() {
082                    return super.getCommonName();
083            }
084    
085            @Override
086            public void setCommonName(String commonName) {
087                    super.setCommonName(commonName);
088            }
089    
090            @Override
091            public String getDirectoryEntry() {
092                    return super.getDirectoryEntry();
093            }
094    
095            @Override
096            public void setDirectoryEntry(String directoryEntry) {
097                    super.setDirectoryEntry(directoryEntry);
098            }
099    
100            /**
101             * Gets the language that the common name parameter is written in.
102             */
103            @Override
104            public String getLanguage() {
105                    return super.getLanguage();
106            }
107    
108            /**
109             * Sets the language that the common name parameter is written in.
110             */
111            @Override
112            public void setLanguage(String language) {
113                    super.setLanguage(language);
114            }
115    }