001/*
002 * Syncany, www.syncany.org
003 * Copyright (C) 2011-2016 Philipp C. Heckel <philipp.heckel@gmail.com>
004 *
005 * This program is free software: you can redistribute it and/or modify
006 * it under the terms of the GNU General Public License as published by
007 * the Free Software Foundation, either version 3 of the License, or
008 * (at your option) any later version.
009 *
010 * This program is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013 * GNU General Public License for more details.
014 *
015 * You should have received a copy of the GNU General Public License
016 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
017 */
018package org.syncany.plugins.transfer.features;
019
020import java.lang.annotation.ElementType;
021import java.lang.annotation.Retention;
022import java.lang.annotation.RetentionPolicy;
023import java.lang.annotation.Target;
024
025import org.syncany.plugins.transfer.TransferManager;
026import org.syncany.plugins.transfer.TransferManagerFactory;
027
028/**
029 * Annotation to identify and configure {@link TransferManager} extensions.
030 * 
031 * <p>Features are extensions for transfer managers, such as path awareness,
032 * transaction awareness or retriability. This annotation is used to mark
033 * a feature annotation, which in turn corresponds to a {@link FeatureTransferManager}.
034 * 
035 * <p><b>Note</b>: This annotation must only be used to annotate feature
036 * annotations, i.e. it is an annotation annotation. It must not be used to
037 * mark feature transfer managers directly.
038 * 
039 * @see TransferManager
040 * @see TransferManagerFactory
041 * @see FeatureTransferManager
042 * @author Philipp C. Heckel (philipp.heckel@gmail.com)
043 */
044@Target(ElementType.TYPE)
045@Retention(RetentionPolicy.RUNTIME)
046public @interface Feature {
047        /**
048         * Specifies whether or not a feature is required. 
049         * 
050         * <p>If a feature is required, but the concrete feature annotation
051         * is not present at the original transfer manager, the {@link TransferManagerFactory}
052         * will throw an exception.
053         */
054        boolean required();
055}