1 /* -------------------------------------------------------------------
2 * Java source file for the class BeanInfoFinder
3 *
4 * Copyright (c), 2002, Masahiro Takatsuka.
5 * All Rights Researved.
6 *
7 * Original Author: Masahiro Takatsuka (masa@jbeans.net)
8 * $Author: takatsukam $
9 *
10 * $Date: 2003/07/25 04:51:44 $
11 *
12 * $Id: BeanInfoFinder.java,v 1.1.1.1 2003/07/25 04:51:44 takatsukam Exp $
13 *
14 * Reference: Document no:
15 * ___ ___
16 *
17 * To Do:
18 * ___
19 *
20 ------------------------------------------------------------------- */
21
22 /* --------------------------- Package ---------------------------- */
23 package net.jbeans.bean;
24
25 /* ------------------ Import classes (packages) ------------------- *//package-summary/html">color="#329900"> ------------------ Import classes (packages) ------------------- *//package-summary.html">color="#329900">/* ------------------ Import classes (packages) ------------------- *//package-summary.html">color="#329900"> ------------------ Import classes (packages) ------------------- */
26 import java.beans.*;
27 import java.util.*;
28
29 import net.jbeans.util.debug.*;
30
31 /*====================================================================
32 Implementation of class BeanInfoFinder
33 ====================================================================*/
34 /***
35 * BeanInfoFinder returns a BeanInfo object of the specified class.
36 * Once a beaninfo is found, it is stored in a hashmap for faster retrieval.
37 *
38 * @version $Revision: 1.1.1.1 $
39 * @author Masahiro Takatsuka (masa@jbeans.net)
40 */
41
42 public final class BeanInfoFinder {
43 /***
44 * debug flag
45 */
46 private static final boolean DEBUG = Debug.getDebugFlag(BeanInfoFinder.class);
47
48 private static Map sBeanInfos = Collections.synchronizedMap(new HashMap());
49
50 private BeanInfoFinder() {
51 super();
52 }
53
54 /***
55 * Retrieves the BeanInfo for the specified Class.
56 */
57 public final static BeanInfo getBeanInfo(Class beanClass) throws IntrospectionException {
58 BeanInfo beanInfo = (BeanInfo) sBeanInfos.get(beanClass);
59
60 if (beanInfo == null) {
61 beanInfo = Introspector.getBeanInfo(beanClass);
62 sBeanInfos.put(beanClass, beanInfo);
63 }
64
65 return beanInfo;
66 }
67 }
This page was automatically generated by Maven