001/*
002 * Copyright (c) 2004-2010, Kohsuke Kawaguchi
003 * All rights reserved.
004 *
005 * Redistribution and use in source and binary forms, with or without modification, are permitted provided
006 * that the following conditions are met:
007 *
008 *     * Redistributions of source code must retain the above copyright notice, this list of
009 *       conditions and the following disclaimer.
010 *     * Redistributions in binary form must reproduce the above copyright notice, this list of
011 *       conditions and the following disclaimer in the documentation and/or other materials
012 *       provided with the distribution.
013 *
014 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
015 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
016 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
017 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
018 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
019 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
020 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
021 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
022 */
023
024package org.kohsuke.stapler.export;
025
026import org.jvnet.hudson.annotation_indexer.Indexed;
027
028import java.lang.annotation.Retention;
029import java.lang.annotation.RetentionPolicy;
030import java.lang.annotation.Documented;
031import java.lang.annotation.Inherited;
032import java.lang.annotation.Target;
033import java.lang.annotation.ElementType;
034
035/**
036 * Indicates that the class has {@link Exported} annotations
037 * on its properties to indicate which properties are written
038 * as values to the remote XML/JSON API.
039 *
040 * <p>
041 * This annotation inherits, so it only needs to be placed on the base class.
042 *
043 * @author Kohsuke Kawaguchi
044 * @see Exported
045 */
046@Retention(RetentionPolicy.RUNTIME)
047@Documented
048@Inherited
049@Target(ElementType.TYPE)
050@Indexed
051public @interface ExportedBean {
052    /**
053     * Controls the default visibility of all {@link Exported} properties
054     * of this class (and its descendants.)
055     *
056     * <p>
057     * A big default visibility value usually indicates that the bean
058     * is always exposed as a descendant of another bean. In such case,
059     * unless the default visibility is set no property will be exposed.
060     */
061    int defaultVisibility() default 1;
062}