| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| ConstructorCache |
|
| 0.0;0 |
| 1 | /* | |
| 2 | * ConstructorCache.java July 2006 | |
| 3 | * | |
| 4 | * Copyright (C) 2006, Niall Gallagher <niallg@users.sf.net> | |
| 5 | * | |
| 6 | * This library is free software; you can redistribute it and/or | |
| 7 | * modify it under the terms of the GNU Lesser General Public | |
| 8 | * License as published by the Free Software Foundation. | |
| 9 | * | |
| 10 | * This library is distributed in the hope that it will be useful, | |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 13 | * GNU Lesser General Public License for more details. | |
| 14 | * | |
| 15 | * You should have received a copy of the GNU Lesser General | |
| 16 | * Public License along with this library; if not, write to the | |
| 17 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, | |
| 18 | * Boston, MA 02111-1307 USA | |
| 19 | */ | |
| 20 | ||
| 21 | package org.simpleframework.xml.load; | |
| 22 | ||
| 23 | import org.simpleframework.xml.util.WeakCache; | |
| 24 | import java.lang.reflect.Constructor; | |
| 25 | ||
| 26 | /** | |
| 27 | * The <code>ConstructorCache</code> object is a typed hash map used | |
| 28 | * to store the constructors used in converting a primitive type to | |
| 29 | * a primitive value using a string. This cache is used to reduce the | |
| 30 | * time taken to convert the primitives by reducing the amount of | |
| 31 | * reflection required and eliminate type resolution. | |
| 32 | * | |
| 33 | * @author Niall Gallagher | |
| 34 | * | |
| 35 | * @see org.simpleframework.xml.load.PrimitiveFactory | |
| 36 | */ | |
| 37 | class ConstructorCache extends WeakCache<Class, Constructor> { | |
| 38 | ||
| 39 | /** | |
| 40 | * Constructor for the <code>ConstructorCache</code> object. It | |
| 41 | * is used to create a typed hash table that can be used to map | |
| 42 | * the constructors used to convert strings to primitive types. | |
| 43 | * If the class is unloaded then the cached constructor is lost. | |
| 44 | */ | |
| 45 | public ConstructorCache() { | |
| 46 | 45 | super(); |
| 47 | 45 | } |
| 48 | } |