Java 类net.sf.jasperreports.engine.component.ComponentsBundle 实例源码

项目:PDFReporter-Studio    文件:JasperReportsConfiguration.java   
/**
 * Return the components extension both by resolving the property of the current
 * project and from the commons extension. If it is available instead of 
 * request the extension from the superclass it search it in the common
 * cache
 * 
 * @return a not null components extension
 */
@SuppressWarnings("unchecked")
private List<ComponentsBundle> getExtensionComponents(){
    if (bundles == null || refreshBundles) {
        bundles = (List<ComponentsBundle>)ExtensionLoader.getSharedExtension(ComponentsBundle.class);
        //fallback if something in the cache goes wrong
        if (bundles == null) bundles = super.getExtensions(ComponentsBundle.class);
        // remove all duplicates
        Set<ComponentsBundle> components = new LinkedHashSet<ComponentsBundle>(bundles);
        bundles = new ArrayList<ComponentsBundle>(components);
        for (ComponentsBundle cb : bundles) {
            try {
                ComponentManager cm = cb.getComponentManager(ComponentsExtensionsRegistryFactory.MAP_COMPONENT_NAME);
                if (cm != null && cm instanceof ComponentsManager)
                    ((ComponentsManager) cm).setDesignConverter(MapDesignConverter.getInstance());
            } catch (Exception e) {
            }
        }
        refreshBundles = false;
    }
    return bundles;
}
项目:jasperreports    文件:FormComponentsExtensionsRegistryFactory.java   
@Override
@SuppressWarnings("unchecked")
public <T> List<T> getExtensions(Class<T> extensionType) 
{
    if (ComponentsBundle.class.equals(extensionType))
    {
        return Collections.singletonList((T)bundle);
    }

    return null;
}
项目:jasperreports    文件:HtmlComponentExtensionsRegistryFactory.java   
@Override
@SuppressWarnings("unchecked")
public <T> List<T> getExtensions(Class<T> extensionType)
{
    if (ComponentsBundle.class.equals(extensionType))
    {
        return Collections.singletonList((T)bundle);
    }

    return null;
}
项目:jasperreports    文件:JRXmlDigesterFactory.java   
protected static void addComponentRules(JasperReportsContext jasperReportsContext, Digester digester)
{
    digester.addFactoryCreate("*/componentElement", JRComponentElementFactory.class.getName());
    digester.addSetNext("*/componentElement", "addElement", JRDesignElement.class.getName());

    Collection<ComponentsBundle> components = ComponentsEnvironment.getInstance(jasperReportsContext).getBundles();
    for (Iterator<ComponentsBundle> it = components.iterator(); it.hasNext();)
    {
        ComponentsBundle componentsBundle = it.next();
        ComponentsXmlParser xmlParser = componentsBundle.getXmlParser();
        digester.setRuleNamespaceURI(xmlParser.getNamespace());

        XmlDigesterConfigurer configurer = xmlParser.getDigesterConfigurer();
        if (configurer != null)
        {
            configurer.configureDigester(digester);
        }

        digester.setRuleNamespaceURI(xmlParser.getNamespace());
        for (Iterator<String> namesIt = componentsBundle.getComponentNames().iterator(); 
                namesIt.hasNext();)
        {
            String componentName = namesIt.next();
            digester.addRule("*/componentElement/" + componentName, 
                    JRComponentRule.newInstance());
        }
    }

    digester.setRuleNamespaceURI(JRXmlConstants.JASPERREPORTS_NAMESPACE);
}
项目:dynamicreports-jasper    文件:GoogleChartsExtensionsRegistryFactory.java   
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public List getExtensions(Class extensionType) {
    if (ComponentsBundle.class.equals(extensionType)) {
        return Collections.singletonList(bundle);
    }
    if (GenericElementHandlerBundle.class.equals(extensionType)) {
        return Collections.singletonList(handler);
    }
    if (CustomComponentTransform.class.equals(extensionType)) {
        return transforms;
    }
    return null;
}
项目:jasperreports-wms-component    文件:ComponentsExtensionsRegistryFactory.java   
@SuppressWarnings("unchecked")
@Override
public <T> List<T> getExtensions(Class<T> extensionType) {
  if (extensionType == ComponentsBundle.class) {
    return (List<T>) Collections.singletonList(COMPONENTS_BUNDLE);
  }
  if (extensionType == GenericElementHandlerBundle.class) {
    return (List<T>) Collections.singletonList(HANDLER_BUNDLE);
  }
  return null;
}