Java 类net.sf.jasperreports.engine.util.JRClassLoader 实例源码

项目:jasperreports    文件:SaveContributorUtils.java   
public static List<JRSaveContributor> createBuiltinContributors(JasperReportsContext context,
        Locale locale, ResourceBundle resourceBundle)
{
    ArrayList<JRSaveContributor> contributors = new ArrayList<JRSaveContributor>(DEFAULT_CONTRIBUTORS.length);
    for (String contributorClassName : DEFAULT_CONTRIBUTORS)
    {
        try
        {
            Class<?> saveContribClass = JRClassLoader.loadClassForName(contributorClassName);
            Constructor<?> constructor = saveContribClass.getConstructor(CONSTRUCTOR_SIGNATURE);
            JRSaveContributor saveContrib = (JRSaveContributor) constructor.newInstance(context, locale, resourceBundle);
            contributors.add(saveContrib);
        }
        catch (Exception e)
        {
            // shouldn't happen, but log anyway
            log.warn("Error creating save contributor of type " + contributorClassName, e);
        }
    }
    return contributors;
}
项目:jasperreports    文件:JRBaseField.java   
@Override
public Class<?> getValueClass()
{
    if (valueClass == null)
    {
        String className = getValueClassRealName();
        if (className != null)
        {
            try
            {
                valueClass = JRClassLoader.loadClassForName(className);
            }
            catch(ClassNotFoundException e)
            {
                throw new JRRuntimeException(e);
            }
        }
    }

    return valueClass;
}
项目:jasperreports    文件:JRBaseParameter.java   
@Override
public Class<?> getValueClass()
{
    if (valueClass == null)
    {
        String className = getValueClassRealName();
        if (className != null)
        {
            try
            {
                valueClass = JRClassLoader.loadClassForName(className);
            }
            catch(ClassNotFoundException e)
            {
                throw new JRRuntimeException(e);
            }
        }
    }

    return valueClass;
}
项目:jasperreports    文件:JRBaseParameter.java   
@Override
public Class<?> getNestedType()
{
    if (nestedTypeName != null && nestedType == null)
    {
        try
        {
            nestedType = JRClassLoader.loadClassForName(nestedTypeName);
        }
        catch(ClassNotFoundException e)
        {
            throw new JRRuntimeException(e);
        }
    }

    return nestedType;
}
项目:jasperreports    文件:JRBaseScriptlet.java   
@Override
public Class<?> getValueClass()
{
    if (valueClass == null)
    {
        String className = getValueClassRealName();
        if (className != null)
        {
            try
            {
                valueClass = JRClassLoader.loadClassForName(className);
            }
            catch(ClassNotFoundException e)
            {
                throw new JRRuntimeException(e);
            }
        }
    }

    return valueClass;
}
项目:jasperreports    文件:JRBaseExpression.java   
/**
 * @deprecated To be removed.
 */
@Override
public Class<?> getValueClass()
{
    if (valueClass == null)
    {
        String className = getValueClassRealName();
        if (className != null)
        {
            try
            {
                valueClass = JRClassLoader.loadClassForName(className);
            }
            catch(ClassNotFoundException e)
            {
                throw new JRRuntimeException(e);
            }
        }
    }

    return valueClass;
}
项目:jasperreports    文件:JRBaseVariable.java   
@Override
public Class<?> getValueClass()
{
    if (valueClass == null)
    {
        String className = getValueClassRealName();
        if (className != null)
        {
            try
            {
                valueClass = JRClassLoader.loadClassForName(className);
            }
            catch(ClassNotFoundException e)
            {
                throw new JRRuntimeException(e);
            }
        }
    }

    return valueClass;
}
项目:jasperreports    文件:JRBaseVariable.java   
@Override
public Class<?> getIncrementerFactoryClass()
{
    if (incrementerFactoryClass == null)
    {
        String className = getIncrementerFactoryClassRealName();
        if (className != null)
        {
            try
            {
                incrementerFactoryClass = JRClassLoader.loadClassForName(className);
            }
            catch(ClassNotFoundException e)
            {
                throw new JRRuntimeException(e);
            }
        }
    }

    return incrementerFactoryClass;
}
项目:jasperreports    文件:BaseDataLevelBucket.java   
@Override
public Class<?> getValueClass()
{
    if (valueClass == null)
    {
        String className = getValueClassRealName();
        if (className != null)
        {
            try
            {
                valueClass = JRClassLoader.loadClassForName(className);
            }
            catch (ClassNotFoundException e)
            {
                throw 
                    new JRRuntimeException(
                        EXCEPTION_MESSAGE_KEY_BUCKET_LOAD_ERROR,
                        (Object[])null,
                        e);
            }
        }
    }

    return valueClass;
}
项目:jasperreports    文件:BaseDataMeasure.java   
@Override
public Class<?> getValueClass()
{
    if (valueClass == null)
    {
        String className = JRClassLoader.getClassRealName(valueClassName);
        if (className != null)
        {
            try
            {
                valueClass = JRClassLoader.loadClassForName(className);
            }
            catch (ClassNotFoundException e)
            {
                throw 
                    new JRRuntimeException(
                        EXCEPTION_MESSAGE_KEY_MEASURE_VALUE_LOAD_ERROR,
                        (Object[])null,
                        e);
            }
        }
    }

    return valueClass;
}
项目:jasperreports    文件:BaseDataMeasure.java   
@Override
public Class<?> getIncrementerFactoryClass()
{
    if (incrementerFactoryClass == null)
    {
        String className = JRClassLoader.getClassRealName(incrementerFactoryClassName);
        if (className != null)
        {
            try
            {
                incrementerFactoryClass = JRClassLoader.loadClassForName(className);
            }
            catch (ClassNotFoundException e)
            {
                throw 
                    new JRRuntimeException(
                        EXCEPTION_MESSAGE_KEY_MEASURE_INCREMENTER_LOAD_ERROR,
                        (Object[])null,
                        e);
            }
        }
    }

    return incrementerFactoryClass;
}
项目:jasperreports    文件:JRVerifier.java   
protected void verifyFormatFactoryClass()
{
    String formatFactoryClassName = jasperDesign.getFormatFactoryClass();
    if (formatFactoryClassName != null)
    {
        try
        {
            Class<?> formatFactoryClass = JRClassLoader.loadClassForName(formatFactoryClassName);
            if (!FormatFactory.class.isAssignableFrom(formatFactoryClass))
            {
                addBrokenRule("The report format factory class is not compatible with " + FormatFactory.class.getName(), jasperDesign);
            }
        }
        catch (ClassNotFoundException e)
        {
            addBrokenRule(e.toString(), jasperDesign);
        }
    }
}
项目:jasperreports    文件:JRJdtCompiler.java   
/**
 *
 */
private ClassLoader getClassLoader()
{
    ClassLoader clsLoader = Thread.currentThread().getContextClassLoader();

    if (clsLoader != null)
    {
        try
        {
            Class.forName(JRJdtCompiler.class.getName(), true, clsLoader);
        }
        catch (ClassNotFoundException e)
        {
            clsLoader = null;
            //if (log.isWarnEnabled())
            //  log.warn("Failure using Thread.currentThread().getContextClassLoader() in JRJdtCompiler class. Using JRJdtCompiler.class.getClassLoader() instead.");
        }
    }

    if (clsLoader == null)
    {
        clsLoader = JRClassLoader.class.getClassLoader();
    }

    return clsLoader;
}
项目:jasperreports    文件:JRBaseCrosstabMeasure.java   
@Override
public Class<?> getIncrementerFactoryClass()
{
    if (incrementerFactoryClass == null)
    {
        String className = getIncrementerFactoryClassRealName();
        if (className != null)
        {
            try
            {
                incrementerFactoryClass = JRClassLoader.loadClassForName(className);
            }
            catch (ClassNotFoundException e)
            {
                throw 
                    new JRRuntimeException(
                        EXCEPTION_MESSAGE_KEY_MEASURE_INCREMENTER_CLASS_LOAD_ERROR,
                        (Object[])null,
                        e);
            }
        }
    }

    return incrementerFactoryClass;
}
项目:jasperreports    文件:JRBaseCrosstabMeasure.java   
@Override
public Class<?> getValueClass()
{
    if (valueClass == null)
    {
        String className = getValueClassRealName();
        if (className != null)
        {
            try
            {
                valueClass = JRClassLoader.loadClassForName(className);
            }
            catch (ClassNotFoundException e)
            {
                throw 
                    new JRRuntimeException(
                        EXCEPTION_MESSAGE_KEY_MEASURE_VALUE_CLASS_LOAD_ERROR,
                        (Object[])null,
                        e);
            }
        }
    }

    return valueClass;
}
项目:jasperreports    文件:JRBaseCrosstabMeasure.java   
@Override
public Class<?> getPercentageCalculatorClass()
{
    if (percentageCalculatorClass == null)
    {
        String className = getPercentageCalculatorClassRealName();
        if (className != null)
        {
            try
            {
                percentageCalculatorClass = JRClassLoader.loadClassForName(className);
            }
            catch (ClassNotFoundException e)
            {
                throw 
                    new JRRuntimeException(
                        EXCEPTION_MESSAGE_KEY_MEASURE_PERCENTAGE_CALCULATOR_CLASS_LOAD_ERROR,
                        (Object[])null,
                        e);
            }
        }
    }

    return percentageCalculatorClass;
}
项目:jasperreports    文件:JRBaseCrosstabBucket.java   
@Override
public Class<?> getValueClass()
{
    if (valueClass == null)
    {
        String className = getValueClassRealName();
        if (className != null)
        {
            try
            {
                valueClass = JRClassLoader.loadClassForName(className);
            }
            catch (ClassNotFoundException e)
            {
                throw 
                    new JRRuntimeException(
                        EXCEPTION_MESSAGE_KEY_BUCKET_LOAD_ERROR,
                        (Object[])null,
                        e);
            }
        }
    }

    return valueClass;
}
项目:jasperreports    文件:JavaScriptClassLoader.java   
protected ProtectionDomain getProtectionDomain()
{
    ProtectionDomain domain = protectionDomain;
    if (domain == null)
    {
        synchronized (this)
        {
            domain = protectionDomain;
            if (domain == null)
            {
                ProtectionDomainFactory protectionDomainFactory = JRClassLoader.getProtectionDomainFactory();
                domain = protectionDomain = protectionDomainFactory.getProtectionDomain(this);
            }
        }
    }
    return domain;
}
项目:jasperreports    文件:JavaScriptEvaluatorScope.java   
protected ProtectionDomain getProtectionDomain()
{
    ProtectionDomain domain = protectionDomain;
    if (domain == null)
    {
        synchronized (this)
        {
            domain = protectionDomain;
            if (domain == null)
            {
                ProtectionDomainFactory protectionDomainFactory = JRClassLoader.getProtectionDomainFactory();
                domain = protectionDomain = protectionDomainFactory.getProtectionDomain(
                        Codegen.class.getClassLoader());
            }
        }
    }
    return domain;
}
项目:PDFReporter-Studio    文件:JRJdtCompiler.java   
/**
 *
 */
private ClassLoader getClassLoader() {
    ClassLoader clsLoader = Thread.currentThread().getContextClassLoader();
    if (clsLoader != null) {
        try {
            Class.forName(JRJdtCompiler.class.getName(), true, clsLoader);
        } catch (ClassNotFoundException e) {
            clsLoader = null;
            // if (log.isWarnEnabled())
            // log.warn("Failure using Thread.currentThread().getContextClassLoader() in JRJdtCompiler class. Using JRJdtCompiler.class.getClassLoader() instead.");
        }
    }
    if (clsLoader == null)
        clsLoader = JRClassLoader.class.getClassLoader();
    return clsLoader;
}
项目:openbravo-pos    文件:JRViewer300.java   
/**
 *
 */
protected void initSaveContributors()
{
    final String[] DEFAULT_CONTRIBUTORS =
        {
            "net.sf.jasperreports.view.save.JRPrintSaveContributor",
            "net.sf.jasperreports.view.save.JRPdfSaveContributor",
            "net.sf.jasperreports.view.save.JRRtfSaveContributor",
            "net.sf.jasperreports.view.save.JROdtSaveContributor",
            "net.sf.jasperreports.view.save.JRHtmlSaveContributor",
            "net.sf.jasperreports.view.save.JRSingleSheetXlsSaveContributor",
            "net.sf.jasperreports.view.save.JRMultipleSheetsXlsSaveContributor",
            "net.sf.jasperreports.view.save.JRCsvSaveContributor",
            "net.sf.jasperreports.view.save.JRXmlSaveContributor",
            "net.sf.jasperreports.view.save.JREmbeddedImagesXmlSaveContributor"
        };

    for(int i = 0; i < DEFAULT_CONTRIBUTORS.length; i++)
    {
        try
        {
            Class saveContribClass = JRClassLoader.loadClassForName(DEFAULT_CONTRIBUTORS[i]);
            Constructor constructor = saveContribClass.getConstructor(new Class[]{Locale.class, ResourceBundle.class});
            JRSaveContributor saveContrib = (JRSaveContributor)constructor.newInstance(new Object[]{getLocale(), resourceBundle});
            saveContributors.add(saveContrib);
        }
        catch (Exception e)
        {
        }
    }
}
项目:jasperreports    文件:JRBaseField.java   
/**
 *
 */
private String getValueClassRealName()
{
    if (valueClassRealName == null)
    {
        valueClassRealName = JRClassLoader.getClassRealName(valueClassName);
    }

    return valueClassRealName;
}
项目:jasperreports    文件:JRBaseParameter.java   
/**
 *
 */
private String getValueClassRealName()
{
    if (valueClassRealName == null)
    {
        valueClassRealName = JRClassLoader.getClassRealName(valueClassName);
    }

    return valueClassRealName;
}
项目:jasperreports    文件:JRBaseScriptlet.java   
/**
 *
 */
private String getValueClassRealName()
{
    if (valueClassRealName == null)
    {
        valueClassRealName = JRClassLoader.getClassRealName(valueClassName);
    }

    return valueClassRealName;
}
项目:jasperreports    文件:JRBaseExpression.java   
/**
 * @deprecated To be removed.
 */
private String getValueClassRealName()
{
    if (valueClassRealName == null)
    {
        valueClassRealName = JRClassLoader.getClassRealName(valueClassName);
    }

    return valueClassRealName;
}
项目:jasperreports    文件:JRBaseVariable.java   
/**
 *
 */
private String getValueClassRealName()
{
    if (valueClassRealName == null)
    {
        valueClassRealName = JRClassLoader.getClassRealName(valueClassName);
    }

    return valueClassRealName;
}
项目:jasperreports    文件:JRBaseVariable.java   
/**
 *
 */
private String getIncrementerFactoryClassRealName()
{
    if (incrementerFactoryClassRealName == null)
    {
        incrementerFactoryClassRealName = JRClassLoader.getClassRealName(incrementerFactoryClassName);
    }

    return incrementerFactoryClassRealName;
}
项目:jasperreports    文件:BaseDataLevelBucket.java   
private String getValueClassRealName()
{
    if (valueClassRealName == null)
    {
        valueClassRealName = JRClassLoader.getClassRealName(valueClassName);
    }

    return valueClassRealName;
}
项目:jasperreports    文件:JRAbstractJavaCompiler.java   
@Override
protected JREvaluator loadEvaluator(Serializable compileData, String className) throws JRException
{
    JREvaluator evaluator = null;

    try
    {
        Class<?> clazz = getClassFromCache(className);
        if (clazz == null)
        {
            clazz = JRClassLoader.loadClassFromBytes(className, (byte[]) compileData);
            putClassInCache(className, clazz);
        }

        if (JRPropertiesUtil.getInstance(jasperReportsContext).getBooleanProperty(PROPERTY_EVALUATOR_CLASS_REFERENCE_FIX_ENABLED))
        {
            //FIXME multiple classes per thread?
            classFromBytesRef.set(clazz);
        }

        evaluator = (JREvaluator) clazz.newInstance();
    }
    catch (Exception e)
    {
        throw 
        new JRException(
            EXCEPTION_MESSAGE_KEY_EXPRESSION_CLASS_NOT_LOADED, 
            new Object[]{className}, 
            e);
    }

    return evaluator;
}
项目:jasperreports    文件:JRFillChart.java   
/**
 *
 */
protected JRChartCustomizer createAndInitCustomizer(
    String customizerClassName,
    String customizerName
    )
{
    JRChartCustomizer customizer = null;

    if (customizerClassName != null && customizerClassName.length() > 0) 
    {
        try 
        {
            Class<?> customizerClass = JRClassLoader.loadClassForName(customizerClassName);
            customizer = (JRChartCustomizer) customizerClass.newInstance();
        }
        catch (Exception e) 
        {
            throw 
                new JRRuntimeException(
                    EXCEPTION_MESSAGE_KEY_CUSTOMIZER_INSTANCE_ERROR,
                    (Object[])null,
                    e);
        }

        if (customizer instanceof JRAbstractChartCustomizer)
        {
            ((JRAbstractChartCustomizer) customizer).init(this);
        }

        if (customizer instanceof NamedChartCustomizer)
        {
            ((NamedChartCustomizer) customizer).setName(customizerName);
        }
    }

    return customizer;
}
项目:jasperreports    文件:JRFillCommonReturnValue.java   
/**
 * Gets the incrementer to be used for this copied value.
 */
public JRIncrementer getIncrementer()
{
    if (incrementer == null)
    {
        String incrementerFactoryClassName = getIncrementerFactoryClassName();

        JRIncrementerFactory incrementerFactory;
        if (incrementerFactoryClassName == null)
        {
            JRVariable toVariable = filler.getVariable(getToVariable());
            incrementerFactory = JRDefaultIncrementerFactory.getFactory(toVariable.getValueClass());
        }
        else
        {
            try
            {
                Class<?> incrementerFactoryClass = JRClassLoader.loadClassForName(incrementerFactoryClassName);
                incrementerFactory = JRIncrementerFactoryCache.getInstance(incrementerFactoryClass); 
            }
            catch (ClassNotFoundException e)
            {
                throw 
                    new JRRuntimeException(
                        EXCEPTION_MESSAGE_KEY_INCREMENTER_CLASS_NOT_FOUND,
                        new Object[]{incrementerFactoryClassName},
                        e);
            }
        }

        incrementer = incrementerFactory.getIncrementer(getCalculation().getValue());
    }

    return incrementer;
}
项目:jasperreports    文件:JRBaseCrosstabMeasure.java   
/**
 *
 */
private String getIncrementerFactoryClassRealName()
{
    if (incrementerFactoryClassRealName == null)
    {
        incrementerFactoryClassRealName = JRClassLoader.getClassRealName(incrementerFactoryClassName);
    }

    return incrementerFactoryClassRealName;
}
项目:jasperreports    文件:JRBaseCrosstabMeasure.java   
/**
 *
 */
private String getValueClassRealName()
{
    if (valueClassRealName == null)
    {
        valueClassRealName = JRClassLoader.getClassRealName(valueClassName);
    }

    return valueClassRealName;
}
项目:jasperreports    文件:JRBaseCrosstabMeasure.java   
/**
 *
 */
private String getPercentageCalculatorClassRealName()
{
    if (percentageCalculatorClassRealName == null)
    {
        percentageCalculatorClassRealName = JRClassLoader.getClassRealName(percentageCalculatorClassName);
    }

    return percentageCalculatorClassRealName;
}
项目:jasperreports    文件:JRBaseCrosstabBucket.java   
/**
 *
 */
private String getValueClassRealName()
{
    if (valueClassRealName == null)
    {
        valueClassRealName = JRClassLoader.getClassRealName(valueClassName);
    }

    return valueClassRealName;
}
项目:jasperreports    文件:FunctionsBundle.java   
/**
 *
 */
public void addFunctionClass(String className) 
{
    try 
    {
        Class<?> clazz = JRClassLoader.loadClassForName(className);
        addFunctionClass(clazz);
    }
    catch (ClassNotFoundException e)
    {
        throw new JRRuntimeException(e);
    }
}
项目:wifepos    文件:JRViewer300.java   
/**
     *
     */
// JG Jul 2012 Added Docx Contributor
        protected void initSaveContributors()
    {
        final String[] defaultContributors =
            {
                "net.sf.jasperreports.view.save.JRCsvSaveContributor",
                "net.sf.jasperreports.view.save.JRDocxSaveContributor",                                
                "net.sf.jasperreports.view.save.JREmbeddedImagesXmlSaveContributor",
                "net.sf.jasperreports.view.save.JRHtmlSaveContributor",
                "net.sf.jasperreports.view.save.JRMultipleSheetsXlsSaveContributor",
                "net.sf.jasperreports.view.save.JROdtSaveContributor",
                                "net.sf.jasperreports.view.save.JRPdfSaveContributor",
                                "net.sf.jasperreports.view.save.JRPrintSaveContributor",
                                "net.sf.jasperreports.view.save.JRRtfSaveContributor",
                "net.sf.jasperreports.view.save.JRSingleSheetXlsSaveContributor",
                "net.sf.jasperreports.view.save.JRXmlSaveContributor",


            };

        for(int i = 0; i < defaultContributors.length; i++)
        {
            try
            {
                Class saveContribClass = JRClassLoader.loadClassForName(defaultContributors[i]);
                Constructor constructor = saveContribClass.getConstructor(new Class[]{Locale.class, ResourceBundle.class});
                JRSaveContributor saveContrib = (JRSaveContributor)constructor.newInstance(new Object[]{getLocale(), resourceBundle});
                saveContributors.add(saveContrib);
            }
            catch (ClassNotFoundException | NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e)
            {
            }
        }
    }
项目:micro-Blagajna    文件:JRViewer300.java   
/**
     *
     */
// JG Jul 2012 Added Docx Contributor
        protected void initSaveContributors()
    {
        final String[] defaultContributors =
            {
                "net.sf.jasperreports.view.save.JRCsvSaveContributor",
                "net.sf.jasperreports.view.save.JRDocxSaveContributor",                                
                "net.sf.jasperreports.view.save.JREmbeddedImagesXmlSaveContributor",
                "net.sf.jasperreports.view.save.JRHtmlSaveContributor",
                "net.sf.jasperreports.view.save.JRMultipleSheetsXlsSaveContributor",
                "net.sf.jasperreports.view.save.JROdtSaveContributor",
                                "net.sf.jasperreports.view.save.JRPdfSaveContributor",
                                "net.sf.jasperreports.view.save.JRPrintSaveContributor",
                                "net.sf.jasperreports.view.save.JRRtfSaveContributor",
                "net.sf.jasperreports.view.save.JRSingleSheetXlsSaveContributor",
                "net.sf.jasperreports.view.save.JRXmlSaveContributor",


            };

        for(int i = 0; i < defaultContributors.length; i++)
        {
            try
            {
                Class saveContribClass = JRClassLoader.loadClassForName(defaultContributors[i]);
                Constructor constructor = saveContribClass.getConstructor(new Class[]{Locale.class, ResourceBundle.class});
                JRSaveContributor saveContrib = (JRSaveContributor)constructor.newInstance(new Object[]{getLocale(), resourceBundle});
                saveContributors.add(saveContrib);
            }
            catch (ClassNotFoundException | NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e)
            {
            }
        }
    }
项目:unicenta    文件:JRViewer300.java   
/**
     *
     */
// JG Jul 2012 Added Docx Contributor
        protected void initSaveContributors()
    {
        final String[] defaultContributors =
            {
                "net.sf.jasperreports.view.save.JRCsvSaveContributor",
                "net.sf.jasperreports.view.save.JRDocxSaveContributor",                                
                "net.sf.jasperreports.view.save.JREmbeddedImagesXmlSaveContributor",
                "net.sf.jasperreports.view.save.JRHtmlSaveContributor",
                "net.sf.jasperreports.view.save.JRMultipleSheetsXlsSaveContributor",
                "net.sf.jasperreports.view.save.JROdtSaveContributor",
                                "net.sf.jasperreports.view.save.JRPdfSaveContributor",
                                "net.sf.jasperreports.view.save.JRPrintSaveContributor",
                                "net.sf.jasperreports.view.save.JRRtfSaveContributor",
                "net.sf.jasperreports.view.save.JRSingleSheetXlsSaveContributor",
                "net.sf.jasperreports.view.save.JRXmlSaveContributor",


            };

        for(int i = 0; i < defaultContributors.length; i++)
        {
            try
            {
                Class saveContribClass = JRClassLoader.loadClassForName(defaultContributors[i]);
                Constructor constructor = saveContribClass.getConstructor(new Class[]{Locale.class, ResourceBundle.class});
                JRSaveContributor saveContrib = (JRSaveContributor)constructor.newInstance(new Object[]{getLocale(), resourceBundle});
                saveContributors.add(saveContrib);
            }
            catch (ClassNotFoundException | NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e)
            {
            }
        }
    }
项目:ireport-fork    文件:JrxmlPreviewToolbar.java   
/**
 *
 */
protected void initSaveContributors()
{
    final String[] DEFAULT_CONTRIBUTORS =
        {
            "net.sf.jasperreports.view.save.JRPrintSaveContributor",
            "net.sf.jasperreports.view.save.JRPdfSaveContributor",
            "net.sf.jasperreports.view.save.JRRtfSaveContributor",
            "net.sf.jasperreports.view.save.JROdtSaveContributor",
            "net.sf.jasperreports.view.save.JRHtmlSaveContributor",
            "net.sf.jasperreports.view.save.JRSingleSheetXlsSaveContributor",
            "net.sf.jasperreports.view.save.JRMultipleSheetsXlsSaveContributor",
            "net.sf.jasperreports.view.save.JRCsvSaveContributor",
            "net.sf.jasperreports.view.save.JRXmlSaveContributor",
            "net.sf.jasperreports.view.save.JREmbeddedImagesXmlSaveContributor"
        };

    for(int i = 0; i < DEFAULT_CONTRIBUTORS.length; i++)
    {
        try
        {
            Class saveContribClass = JRClassLoader.loadClassForName(DEFAULT_CONTRIBUTORS[i]);
            Constructor constructor = saveContribClass.getConstructor(new Class[]{Locale.class, ResourceBundle.class});
            JRSaveContributor saveContrib = (JRSaveContributor)constructor.newInstance(new Object[]{getLocale(), getViewerContext().getResourceBundle()});
            saveContributors.add(saveContrib);
        }
        catch (Exception e)
        {
        }
    }
}