All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.milyn.annotation.AnnotationManager Maven / Gradle / Ivy

The newest version!
// Copyright 2007 Fusionsoft, Inc. All rights reserved.
// Use is subject to license terms.
package org.milyn.annotation;

import java.util.HashMap;
import java.util.Map;

/** The core class for wrapping classes as annotated classes.
 * The annotated class provides access to all declared and inherited
 * annotations from classes and interfaces. Also the annotated class
 * provides wrapping for its methods for gathering all declared and inherited
 * annotations for it from base classes and interfaces.
 *
 * 

By now only public methods can inherit annotations with the mechanism. * * Note: This class is a modified version of the original Fusionsoft Annotation * library. See: {@link http://www.fusionsoft-online.com/articles-java-annotations.php} * * @author Vladimir Ovchinnikov * @author [email protected] * @version 1.0 */ public class AnnotationManager { private static Map, AnnotatedClass> classToAnnotatedMap = new HashMap, AnnotatedClass>(); /** * @param theClass to wrap. * @return the annotated class wrapping the specified one. */ public static AnnotatedClass getAnnotatedClass(Class theClass){ AnnotatedClass annotatedClass = classToAnnotatedMap.get(theClass); if (annotatedClass == null){ annotatedClass = new AnnotatedClassImpl(theClass); classToAnnotatedMap.put(theClass, annotatedClass); } return annotatedClass; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy