001    /*
002     * Copyright 2013 Google Inc.
003     * 
004     * Licensed under the Apache License, Version 2.0 (the "License"); you may not
005     * use this file except in compliance with the License. You may obtain a copy of
006     * the License at
007     * 
008     * http://www.apache.org/licenses/LICENSE-2.0
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
012     * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
013     * License for the specific language governing permissions and limitations under
014     * the License.
015     */
016    package com.google.gwtmockito;
017    
018    import static java.lang.annotation.ElementType.FIELD;
019    import static java.lang.annotation.RetentionPolicy.RUNTIME;
020    
021    import java.lang.annotation.Retention;
022    import java.lang.annotation.Target;
023    
024    /**
025     * Annotates a field to be filled with a mock object and returned via calls to
026     * GWT.create. Any calls to GWT.create for a type matching the type of the field
027     * will return that field. In order for this annotation to take effect, the test
028     * must either be run with {@link GwtMockitoTestRunner} or it must invoke
029     * {@link GwtMockito#initMocks}.
030     *
031     * @see GwtMockito
032     * @author ekuefler@google.com (Erik Kuefler)
033     */
034    @Retention(RUNTIME)
035    @Target(FIELD)
036    public @interface GwtMock {}