001/* $Id: DigesterRule.java 992737 2010-09-05 08:49:48Z simonetripodi $
002 *
003 * Licensed to the Apache Software Foundation (ASF) under one or more
004 * contributor license agreements.  See the NOTICE file distributed with
005 * this work for additional information regarding copyright ownership.
006 * The ASF licenses this file to You under the Apache License, Version 2.0
007 * (the "License"); you may not use this file except in compliance with
008 * the License.  You may obtain a copy of the License at
009 *
010 *      http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.apache.commons.digester.annotations;
019
020import java.lang.annotation.Annotation;
021import java.lang.annotation.Documented;
022import java.lang.annotation.ElementType;
023import java.lang.annotation.Retention;
024import java.lang.annotation.RetentionPolicy;
025import java.lang.annotation.Target;
026import java.lang.reflect.AnnotatedElement;
027
028import org.apache.commons.digester.Rule;
029import org.apache.commons.digester.annotations.handlers.DefaultLoaderHandler;
030
031/**
032 * Meta-annotation that marks an annotation as part of commons-digester.
033 *
034 * @since 2.1
035 */
036@Documented
037@Target(ElementType.ANNOTATION_TYPE)
038@Retention(RetentionPolicy.RUNTIME)
039public @interface DigesterRule {
040
041    /**
042     * The reflected commons-digester rule.
043     *
044     * @return the reflected commons-digester rule.
045     */
046    Class<? extends Rule> reflectsRule();
047
048    /**
049     * The handler that takes care on converting this annotation in the related
050     * {@link AnnotationRuleProvider} and adds it o the {@link FromAnnotationsRuleSet}
051     *
052     * @return the {@link DigesterLoaderHandler}
053     */
054    Class<? extends DigesterLoaderHandler<? extends Annotation, ? extends AnnotatedElement>>
055        handledBy() default DefaultLoaderHandler.class;
056
057    /**
058     * Define the {@link AnnotationRuleProvider} that builds the {@link Rule}
059     * related to the digester rule.
060     *
061     * @return the {@link AnnotationRuleProvider}.
062     */
063    Class<? extends AnnotationRuleProvider<? extends Annotation, ? extends AnnotatedElement, ? extends Rule>>
064        providedBy();
065
066}