1 /* 2 * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package javax.annotation; 27 import java.lang.annotation.*; 28 import static java.lang.annotation.ElementType.*; 29 import static java.lang.annotation.RetentionPolicy.*; 30 31 /** 32 * The <code>Generated</code> annotation is used to mark source code 33 * that has been generated. 34 * It can also be used to differentiate user written code from generated code 35 * in a single file. 36 * <p>The <code>value</code> element must have the name of the 37 * code generator. The recommended convention is to use the fully qualified 38 * name of the code generator in the value field, 39 * for example <code>com.company.package.classname</code>.</p> 40 * <p>The <code>date</code> element is used to indicate the date the 41 * source was generated. 42 * The <code>date</code> element must follow the ISO 8601 standard. 43 * For example, the <code>date</code> element could have the 44 * value <code>2001-07-04T12:08:56.235-0700</code>, 45 * which represents 2001-07-04 12:08:56 local time in the U.S. Pacific 46 * time zone.</p> 47 * <p>The <code>comment</code> element is a place holder for any comments 48 * that the code generator may want to include in the generated code.</p> 49 * 50 * @since 1.6, Common Annotations 1.0 51 */ 52 53 @Documented 54 @Retention(SOURCE) 55 @Target({PACKAGE, TYPE, ANNOTATION_TYPE, METHOD, CONSTRUCTOR, FIELD, 56 LOCAL_VARIABLE, PARAMETER}) 57 public @interface Generated { 58 /** 59 * The value element must have the name of the code generator. 60 * The recommended convention is to use the fully qualified name of the 61 * code generator. For example: <code>com.acme.generator.CodeGen</code>. 62 */ 63 String[] value(); 64 65 /** 66 * Date when the source was generated. 67 */ 68 String date() default ""; 69 70 /** 71 * A place holder for any comments that the code generator may want to 72 * include in the generated code. 73 */ 74 String comments() default ""; 75 }