001/** 002 * Copyright (c) 2011, The University of Southampton and the individual contributors. 003 * All rights reserved. 004 * 005 * Redistribution and use in source and binary forms, with or without modification, 006 * are permitted provided that the following conditions are met: 007 * 008 * * Redistributions of source code must retain the above copyright notice, 009 * this list of conditions and the following disclaimer. 010 * 011 * * Redistributions in binary form must reproduce the above copyright notice, 012 * this list of conditions and the following disclaimer in the documentation 013 * and/or other materials provided with the distribution. 014 * 015 * * Neither the name of the University of Southampton nor the names of its 016 * contributors may be used to endorse or promote products derived from this 017 * software without specific prior written permission. 018 * 019 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 020 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 021 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 022 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 023 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 024 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 025 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 026 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 027 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 028 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 029 */ 030package org.openimaj.citation.annotation; 031 032import java.lang.annotation.Documented; 033import java.lang.annotation.ElementType; 034import java.lang.annotation.Retention; 035import java.lang.annotation.RetentionPolicy; 036import java.lang.annotation.Target; 037 038/** 039 * Annotation for bibtex-style references inside the code. 040 * 041 * @author Jonathon Hare (jsh2@ecs.soton.ac.uk) 042 * 043 */ 044@Retention(RetentionPolicy.RUNTIME) 045@Documented 046@Target(value = { ElementType.METHOD, ElementType.TYPE, ElementType.PACKAGE }) 047public @interface Reference { 048 049 /** 050 * The name(s) of the author(s) 051 * 052 * @return The name(s) of the author(s) 053 */ 054 String[] author(); 055 056 /** 057 * The title of the work 058 * 059 * @return The title of the work 060 */ 061 String title(); 062 063 /** 064 * The type of publication 065 * 066 * @return The type of publication 067 * @see ReferenceType 068 */ 069 ReferenceType type(); 070 071 /** 072 * The year of publication (or, if unpublished, the year of creation) 073 * 074 * @return The year of publication (or, if unpublished, the year of creation) 075 */ 076 String year(); 077 078 /** 079 * The journal or magazine the work was published in 080 * 081 * @return The journal or magazine the work was published in 082 */ 083 String journal() default ""; 084 085 /** 086 * The title of the book, if only part of it is being cited 087 * 088 * @return The title of the book, if only part of it is being cited 089 */ 090 String booktitle() default ""; 091 092 /** 093 * Page numbers 094 * 095 * @return Page numbers 096 */ 097 String[] pages() default {}; 098 099 /** 100 * The chapter number 101 * 102 * @return The chapter number 103 */ 104 String chapter() default ""; 105 106 /** 107 * The edition of a book, long form (such as "first" or "second") 108 * 109 * @return The edition of a book, long form (such as "first" or "second") 110 */ 111 String edition() default ""; 112 113 /** 114 * An optional URL reference where the publication can be found. 115 * 116 * @return A URL where the reference can be found. 117 */ 118 String url() default ""; 119 120 /** 121 * Miscellaneous extra information 122 * 123 * @return Miscellaneous extra information 124 */ 125 String note() default ""; 126 127 /** 128 * The name(s) of the editor(s) 129 * 130 * @return The name(s) of the editor(s) 131 */ 132 String[] editor() default {}; 133 134 /** 135 * The institution that was involved in the publishing, but not necessarily the publisher 136 * 137 * @return The institution that was involved in the publishing, but not necessarily the publisher 138 */ 139 String institution() default ""; 140 141 /** 142 * The month of publication (or, if unpublished, the month of creation) 143 * 144 * @return The month of publication (or, if unpublished, the month of creation) 145 */ 146 String month() default ""; 147 148 /** 149 * The "(issue) number" of a journal, magazine, or tech-report, if applicable. (Most publications have a "volume", but no "number" field.) 150 * 151 * @return The "(issue) number" of a journal, magazine, or tech-report, if applicable. (Most publications have a "volume", but no "number" field.) 152 */ 153 String number() default ""; 154 155 /** 156 * The conference sponsor 157 * 158 * @return The conference sponsor 159 */ 160 String organization() default "";; 161 162 /** 163 * The publisher's name 164 * 165 * @return The publisher's name 166 */ 167 String publisher() default ""; 168 169 /** 170 * The school where the thesis was written 171 * 172 * @return The school where the thesis was written 173 */ 174 String school() default ""; 175 176 /** 177 * The series of books the book was published in (e.g. "The Hardy Boys" or "Lecture Notes in Computer Science") 178 * 179 * @return The series of books the book was published in (e.g. "The Hardy Boys" or "Lecture Notes in Computer Science") 180 */ 181 String series() default ""; 182 183 /** 184 * The volume of a journal or multi-volume book 185 * 186 * @return The volume of a journal or multi-volume book 187 */ 188 String volume() default ""; 189 190 /** 191 * A list of custom key value data pairs. 192 * 193 * @return A list of custom key value data pairs. 194 */ 195 String [] customData() default {}; 196}