Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.beanutils2;
import java.beans.PropertyDescriptor;
import java.lang.ref.Reference;
import java.lang.ref.SoftReference;
import java.util.HashMap;
import java.util.Map;
import java.util.WeakHashMap;
/**
* Implementation of {@link DynaClass} that wrap
* standard JavaBean instances.
*
* This class should not usually need to be used directly
* to create new {@link WrapDynaBean} instances -
* it's usually better to call the {@link WrapDynaBean} constructor.
* For example:
*
*
*/
public class WrapDynaClass implements DynaClass {
/**
* Constructs a new WrapDynaClass for the specified JavaBean class. This
* constructor is private; WrapDynaClass instances will be created as
* needed via calls to the {@code createDynaClass(Class)} method.
*
* @param beanClass JavaBean class to be introspected around
* @param propUtils the {@code PropertyUtilsBean} associated with this class
*/
private WrapDynaClass(final Class> beanClass, final PropertyUtilsBean propUtils) {
this.beanClassRef = new SoftReference<>(beanClass);
this.beanClassName = beanClass.getName();
propertyUtilsBean = propUtils;
introspect();
}
/**
* Name of the JavaBean class represented by this WrapDynaClass.
*/
private final String beanClassName;
/**
* Reference to the JavaBean class represented by this WrapDynaClass.
*/
private final Reference> beanClassRef;
/** Stores the associated {@code PropertyUtilsBean} instance. */
private final PropertyUtilsBean propertyUtilsBean;
/**
* The set of PropertyDescriptors for this bean class.
*/
protected PropertyDescriptor[] descriptors;
/**
* The set of PropertyDescriptors for this bean class, keyed by the
* property name. Individual descriptor instances will be the same
* instances as those in the {@code descriptors} list.
*/
protected HashMap descriptorsMap = new HashMap<>();
/**
* The set of dynamic properties that are part of this DynaClass.
*/
protected DynaProperty[] properties;
/**
* The set of dynamic properties that are part of this DynaClass,
* keyed by the property name. Individual descriptor instances will
* be the same instances as those in the {@code properties} list.
*/
protected HashMap propertiesMap = new HashMap<>();
private static final ContextClassLoaderLocal