Coverage Report - org.simpleframework.xml.convert.Scanner
 
Classes in this File Line Coverage Branch Coverage Complexity
Scanner
N/A
N/A
1
 
 1  
 /*
 2  
  * Scanner.java January 2010
 3  
  *
 4  
  * Copyright (C) 2010, Niall Gallagher <niallg@users.sf.net>
 5  
  *
 6  
  * Licensed under the Apache License, Version 2.0 (the "License");
 7  
  * you may not use this file except in compliance with the License.
 8  
  * You may obtain a copy of the License at
 9  
  *
 10  
  *     http://www.apache.org/licenses/LICENSE-2.0
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing, software
 13  
  * distributed under the License is distributed on an "AS IS" BASIS,
 14  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 
 15  
  * implied. See the License for the specific language governing 
 16  
  * permissions and limitations under the License.
 17  
  */
 18  
 
 19  
 package org.simpleframework.xml.convert;
 20  
 
 21  
 import java.lang.annotation.Annotation;
 22  
 
 23  
 /**
 24  
  * The <code>Scanner</code> interface is used to scan a class for a
 25  
  * given annotation. A scanner will cache all previous lookups to
 26  
  * ensure the look time is reduced. Caches include misses, so if a
 27  
  * class does not contain an annotation when scanned it will not
 28  
  * be scanned again.
 29  
  * 
 30  
  * @author Niall Gallagher
 31  
  */
 32  
 interface Scanner {
 33  
 
 34  
    /**
 35  
     * This method will scan a class for the specified annotation. 
 36  
     * If the annotation is found on the class, or on one of the super
 37  
     * types then it is returned. All scans should be cached to ensure
 38  
     * scanning is only performed once.
 39  
     * 
 40  
     * @param type this is the annotation type to be scanned for
 41  
     * 
 42  
     * @return this will return the annotation if it is found
 43  
     */
 44  
    <T extends Annotation> T scan(Class<T> type);
 45  
 }