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} - The organizer of the event.</li> 039 * <li>{@link VTodo} - The creator of the to-do task.</li> 040 * <li>{@link VJournal} - The owner of the journal entry.</li> 041 * <li>{@link VFreeBusy} - The person requesting the free/busy time.</li> 042 * </ul> 043 * </p> 044 * <p> 045 * <b>Examples:</b> 046 * 047 * <pre class="brush:java"> 048 * Organizer organizer = Organizer.email("johndoe@example.com"); 049 * organizer.setCommonName("John Doe"); 050 * </pre> 051 * 052 * </p> 053 * @author Michael Angstadt 054 * @rfc 5545 p.111-2 055 */ 056 public class Organizer extends TextProperty { 057 /** 058 * Creates an organizer property 059 * @param uri a URI representing the organizer (typically, an email address, 060 * e.g. "mailto:johndoe@example.com") 061 */ 062 public Organizer(String uri) { 063 super(uri); 064 } 065 066 /** 067 * Creates an organizer property using an email address as its value. 068 * @param email the email address (e.g. "johndoe@example.com") 069 * @return the property 070 */ 071 public static Organizer email(String email) { 072 return new Organizer("mailto:" + email); 073 } 074 075 @Override 076 public String getSentBy() { 077 return super.getSentBy(); 078 } 079 080 @Override 081 public void setSentBy(String sentBy) { 082 super.setSentBy(sentBy); 083 } 084 085 @Override 086 public String getCommonName() { 087 return super.getCommonName(); 088 } 089 090 @Override 091 public void setCommonName(String commonName) { 092 super.setCommonName(commonName); 093 } 094 095 @Override 096 public String getDirectoryEntry() { 097 return super.getDirectoryEntry(); 098 } 099 100 @Override 101 public void setDirectoryEntry(String directoryEntry) { 102 super.setDirectoryEntry(directoryEntry); 103 } 104 105 /** 106 * Gets the language that the common name parameter is written in. 107 */ 108 @Override 109 public String getLanguage() { 110 return super.getLanguage(); 111 } 112 113 /** 114 * Sets the language that the common name parameter is written in. 115 */ 116 @Override 117 public void setLanguage(String language) { 118 super.setLanguage(language); 119 } 120 }