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.
/*
* JasperReports - Free Java Reporting Library.
* Copyright (C) 2001 - 2023 Cloud Software Group, Inc. All rights reserved.
* http://www.jaspersoft.com
*
* Unless you have purchased a commercial license agreement from Jaspersoft,
* the following license terms apply:
*
* This program is part of JasperReports.
*
* JasperReports is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* JasperReports is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with JasperReports. If not, see .
*/
package net.sf.jasperreports.extensions;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.commons.collections4.map.ReferenceMap;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import net.sf.jasperreports.annotations.properties.Property;
import net.sf.jasperreports.annotations.properties.PropertyScope;
import net.sf.jasperreports.engine.JRPropertiesMap;
import net.sf.jasperreports.engine.JRPropertiesUtil;
import net.sf.jasperreports.engine.JRPropertiesUtil.PropertySuffix;
import net.sf.jasperreports.engine.util.ClassLoaderResource;
import net.sf.jasperreports.engine.util.ClassUtils;
import net.sf.jasperreports.engine.util.JRLoader;
import net.sf.jasperreports.engine.util.ObjectUtils;
import net.sf.jasperreports.properties.PropertyConstants;
/**
* The default {@link ExtensionsRegistry extension registry} implementation.
*
*
* The implementation builds an extension registry by scanning the context
* classloader for resources named jasperreports_extension.properties.
*
*
* Each such resource is loaded as a properties file, and properties that start
* with {@link #PROPERTY_REGISTRY_FACTORY_PREFIX net.sf.jasperreports.extension.registry.factory.} are identified.
*
*
* Each such property should have as value the name of a
* {@link ExtensionsRegistryFactory} implementation. The registry factory class is
* instantiated, and
* {@link ExtensionsRegistryFactory#createRegistry(String, JRPropertiesMap)}
* is called on it, using the propery suffix as registry ID and passing the
* properties map. The registry factory can collect properties that apply to the
* specific registry by using a property prefix obtain by appending the registry ID
* to "{@link #PROPERTY_REGISTRY_PREFIX net.sf.jasperreports.extension.}".
*
*
* If instantiating an extension registry results in an exception, the registry
* is skipped and an error message is logged.
*
* @author Lucian Chirita ([email protected])
*/
public class DefaultExtensionsRegistry implements ExtensionsRegistry
{
private final Log log = LogFactory.getLog(DefaultExtensionsRegistry.class);
/**
* The name of property file resources that are used to load JasperReports
* extensions.
*/
public final static String EXTENSION_RESOURCE_NAME =
"jasperreports_extension.properties";
/**
* The property prefix of extension registry factories.
*/
@Property(
name = "net.sf.jasperreports.extension.registry.factory.{arbitrary_name}",
category = PropertyConstants.CATEGORY_EXTENSIONS,
scopes = {PropertyScope.EXTENSION},
sinceVersion = PropertyConstants.VERSION_3_1_0
)
public final static String PROPERTY_REGISTRY_FACTORY_PREFIX =
JRPropertiesUtil.PROPERTY_PREFIX + "extension.registry.factory.";
/**
* A prefix that can be used to provide registry-specific properties,
* by appending the registry ID and a fixed property suffix to it.
*/
@Property(
name = "net.sf.jasperreports.extension.{registry_id}.{property_suffix}",
category = PropertyConstants.CATEGORY_EXTENSIONS,
scopes = {PropertyScope.EXTENSION},
sinceVersion = PropertyConstants.VERSION_3_1_0
)
public static final String PROPERTY_REGISTRY_PREFIX =
JRPropertiesUtil.PROPERTY_PREFIX + "extension.";
private final ReferenceMap