Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 
 /*
  * Carrot2 project.
  *
  * Copyright (C) 2002-2012, Dawid Weiss, Stanisław Osiński.
  * All rights reserved.
  *
  * Refer to the full license file "carrot2.LICENSE"
  * in the root folder of the repository checkout or at:
 * http://www.carrot2.org/carrot2.LICENSE
 */
package org.carrot2.util.attribute;
A predicate that tests the presence of a given set of annotations on an AttributeDescriptor.
public final class AnnotationsPredicate implements Predicate<AttributeDescriptor>
    private final Class<? extends Annotation> [] annotationClasses;
    private final boolean requireAll;
    public AnnotationsPredicate(boolean requireAllClass<? extends Annotation>... annotationClasses)
    {
        this. = annotationClasses;
        this. = requireAll;
    }
    public boolean apply(AttributeDescriptor descriptor)
    {
        for (final Class<? extends AnnotationannotationClass : )
        {
            if (descriptor.getAnnotation(annotationClass) == null ^ !)
            {
                return !;
            }
        }
        return ;
    }
New to GrepCode? Check out our FAQ X