Java 类net.sf.jasperreports.engine.fill.JRFillVariable 实例源码

项目:jasperreports    文件:JRAbstractScriptlet.java   
/**
 *
 */
public void setVariableValue(String variableName, Object value) throws JRScriptletException
{
    JRFillVariable variable = this.variablesMap.get(variableName);
    if (variable == null)
    {
        throw 
            new JRScriptletException(
                EXCEPTION_MESSAGE_KEY_VARIABLE_NOT_FOUND,
                new Object[]{variableName});
    }

    if (value != null && !variable.getValueClass().isInstance(value) )
    {
        throw 
            new JRScriptletException(
                EXCEPTION_MESSAGE_KEY_VARIABLE_VALUE_INCOMPATIBLE,
                new Object[]{variableName, variable.getValueClassName()});
    }

    variable.setValue(value);
}
项目:jasperreports    文件:JRBshEvaluator.java   
@Override
protected void customizedInit(
        Map<String, JRFillParameter> pars, 
        Map<String, JRFillField> fldsm, 
        Map<String, JRFillVariable> varsm
    ) throws JRException
{
    try
    {
        interpreter.set("calculator", this);
        interpreter.set("fldsm", fldsm);
        interpreter.set("varsm", varsm);
        interpreter.set("parsm", pars);
        interpreter.eval("bshEvaluator = createBshEvaluator()");
        interpreter.eval("bshEvaluator.init(calculator, parsm, fldsm, varsm)");
    }
    catch(EvalError e)
    {
        throw 
            new JRException(
                EXCEPTION_MESSAGE_KEY_INITIALIZING_REPORT_CALCULATOR, 
                null, 
                e);
    }
}
项目:jasperreports    文件:SortComponentFill.java   
protected FilterTypesEnum getFilterType()
{
    SortFieldTypeEnum type = sortComponent.getSortFieldType();
    String name = sortComponent.getSortFieldName();
    JRFillDataset dataset = fillContext.getFillDataset();

    FilterTypesEnum filterType = null;
    if (SortFieldTypeEnum.FIELD.equals(type))
    {
        JRFillField field = dataset.getFillField(name);
        filterType = SortElementUtils.getFilterType(field.getValueClass());
    }
    else if (SortFieldTypeEnum.VARIABLE.equals(type))
    {
        JRFillVariable variable = dataset.getFillVariable(name);
        filterType = SortElementUtils.getFilterType(variable.getValueClass());
    }
    return filterType;
}
项目:jasperreports    文件:JRAbstractScriptlet.java   
/**
 *
 */
public void setData(
    Map<String,JRFillParameter> parsm,
    Map<String,JRFillField> fldsm,
    Map<String,JRFillVariable> varsm,
    JRFillGroup[] grps
    )
{
    parametersMap = parsm;
    fieldsMap = fldsm;
    variablesMap = varsm;
    groups = grps;
}
项目:jasperreports    文件:JRAbstractScriptlet.java   
/**
 *
 */
public Object getVariableValue(String variableName) throws JRScriptletException
{
    JRFillVariable variable = this.variablesMap.get(variableName);
    if (variable == null)
    {
        throw 
            new JRScriptletException(
                EXCEPTION_MESSAGE_KEY_VARIABLE_NOT_FOUND,
                new Object[]{variableName});
    }
    return variable.getValue();
}
项目:jasperreports    文件:JavaScriptCompiledEvaluator.java   
@Override
protected void customizedInit(
        Map<String, JRFillParameter> parametersMap, 
        Map<String, JRFillField> fieldsMap,
        Map<String, JRFillVariable> variablesMap
        ) throws JRException
{
    evaluatorScope = new JavaScriptEvaluatorScope(jasperReportsContext, this, functionsUtil);
    evaluatorScope.init(parametersMap, fieldsMap, variablesMap);
}
项目:jasperreports    文件:JavaScriptEvaluator.java   
@Override
protected void customizedInit(
        Map<String, JRFillParameter> parametersMap, 
        Map<String, JRFillField> fieldsMap,
        Map<String, JRFillVariable> variablesMap
        ) throws JRException
{
    evaluatorScope = new JavaScriptEvaluatorScope(jrContext, this, functionsUtil);
    evaluatorScope.init(parametersMap, fieldsMap, variablesMap);
}
项目:jasperreports    文件:HeaderLabelUtil.java   
@Override
public void init(Map<String, JRFillParameter> parametersMap,
        Map<String, JRFillField> fieldsMap, 
        Map<String, JRFillVariable> variablesMap,
        WhenResourceMissingTypeEnum resourceMissingType) throws JRException
{
    // NOP
}
项目:jasperreports    文件:ConstantBuiltinExpression.java   
@Override
public void init(Map<String, JRFillParameter> parametersMap,
        Map<String, JRFillField> fieldsMap, 
        Map<String, JRFillVariable> variablesMap,
        WhenResourceMissingTypeEnum resourceMissingType) throws JRException
{
    // NOP
}
项目:jasperreports    文件:BuiltinExpressionEvaluatorDecorator.java   
@Override
public void init(Map<String, JRFillParameter> parametersMap, 
        Map<String, JRFillField> fieldsMap, 
        Map<String, JRFillVariable> variablesMap, 
        WhenResourceMissingTypeEnum resourceMissingType,
        boolean ignoreNPE) throws JRException
{
    decorated.init(parametersMap, fieldsMap, variablesMap, resourceMissingType, ignoreNPE);

    for (BuiltinExpressionEvaluator builtinEvaluator : builtinEvaluators.values())
    {
        builtinEvaluator.init(parametersMap, fieldsMap, variablesMap, 
                resourceMissingType);
    }
}
项目:jasperreports    文件:TableReport.java   
@Override
public void init(Map<String, JRFillParameter> parametersMap, 
        Map<String, JRFillField> fieldsMap, 
        Map<String, JRFillVariable> variablesMap, 
        WhenResourceMissingTypeEnum resourceMissingType)
        throws JRException
{
    tableScriptletParam = parametersMap.get(TABLE_SCRIPTLET_NAME 
            + JRScriptlet.SCRIPTLET_PARAMETER_NAME_SUFFIX);
}
项目:jasperreports    文件:FillExpressionEvaluatorDatasetAdapter.java   
@Override
public void init(Map<String, JRFillParameter> parametersMap,
        Map<String, JRFillField> fieldsMap,
        Map<String, JRFillVariable> variablesMap,
        WhenResourceMissingTypeEnum resourceMissingType,
        boolean ignoreNPE) throws JRException
{
    // NOP
}
项目:PDFReporter-Studio    文件:JEvalExpressionEvaluator.java   
@Override
protected void customizedInit(Map<String, JRFillParameter> parametersMap,
        Map<String, JRFillField> fieldsMap,
        Map<String, JRFillVariable> variablesMap) throws JRException {
    if (parametersMap!=null) {
    m_parameters.putAll(parametersMap);
}
if (fieldsMap!=null) {
    m_fields.putAll(fieldsMap);
}
if (variablesMap!=null) {
    m_variables.putAll(variablesMap);
}
}
项目:jasperreports    文件:JRFillCrosstabMeasure.java   
public JRFillVariable getFillVariable()
{
    return variable;
}
项目:jasperreports    文件:JRCrosstabExpressionEvaluator.java   
public void init(Map<String, JRFillParameter> parametersMap, 
        Map<String, JRFillVariable> variablesMap, WhenResourceMissingTypeEnum whenResourceMissingType, boolean ignoreNPE) throws JRException
{
    evaluator.init(parametersMap, null, variablesMap, whenResourceMissingType, ignoreNPE);
}
项目:jasperreports    文件:JRFillCrosstabGroup.java   
public JRFillVariable getFillVariable()
{
    return variable;
}
项目:jasperreports    文件:JavaScriptEvaluatorScope.java   
public JSVariable(JRFillVariable variable, ScriptableObject scope)
{
    super(scope);
    this.variable = variable;
}
项目:jasperreports    文件:BuiltinExpressionEvaluator.java   
void init(Map<String, JRFillParameter> parametersMap, 
Map<String, JRFillField> fieldsMap, 
Map<String, JRFillVariable> variablesMap, 
WhenResourceMissingTypeEnum resourceMissingType) throws JRException;
项目:PDFReporter-Studio    文件:ExpressionVariable.java   
private JRFillVariable getVariable() {
    return data.getVariable(getName());
}
项目:PDFReporter-Studio    文件:JEvalExpressionEvaluator.java   
public JRFillVariable getVariable(String name) {
    return m_variables.get(name);
}
项目:dynamicreports-jasper    文件:JasperScriptlet.java   
@Override
public void setData(Map<String, JRFillParameter> parsm, Map<String, JRFillField> fldsm, Map<String, JRFillVariable> varsm, JRFillGroup[] grps) {
    super.setData(parsm, fldsm, varsm, grps);
    reportParameters = new JasperReportParameters(this);
}
项目:PDFReporter-Studio    文件:IDataHolder.java   
JRFillVariable getVariable(String name);