Java 类net.sf.jasperreports.engine.type.WhenResourceMissingTypeEnum 实例源码

项目:jasperreports    文件:JRDatasetFactory.java   
@Override
public Object createObject(Attributes attributes)
{
    JRXmlLoader xmlLoader = (JRXmlLoader)digester.peek(digester.getCount() - 1);
    JRDesignDataset dataset = new JRDesignDataset(xmlLoader.getJasperReportsContext(), false);

    dataset.setName(attributes.getValue(JRXmlConstants.ATTRIBUTE_name));
    dataset.setScriptletClass(attributes.getValue(JRXmlConstants.ATTRIBUTE_scriptletClass));

    dataset.setResourceBundle(attributes.getValue(JRXmlConstants.ATTRIBUTE_resourceBundle));

    WhenResourceMissingTypeEnum whenResourceMissingType = WhenResourceMissingTypeEnum.getByName(attributes.getValue(JRXmlConstants.ATTRIBUTE_whenResourceMissingType));
    if (whenResourceMissingType != null)
    {
        dataset.setWhenResourceMissingType(whenResourceMissingType);
    }

    String uuid = attributes.getValue(JRXmlConstants.ATTRIBUTE_uuid);
    if (uuid != null)
    {
        dataset.setUUID(UUID.fromString(uuid));
    }

    return dataset;
}
项目:jasperreports    文件:JRXmlWriter.java   
public void writeDataset(JRDataset dataset) throws IOException
{
    writer.startElement(JRXmlConstants.ELEMENT_subDataset, getNamespace());
    writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_name, dataset.getName());
    writer.addAttribute(JRXmlConstants.ATTRIBUTE_scriptletClass, dataset.getScriptletClass());
    writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_resourceBundle, dataset.getResourceBundle());
    writer.addAttribute(JRXmlConstants.ATTRIBUTE_whenResourceMissingType, dataset.getWhenResourceMissingTypeValue(), WhenResourceMissingTypeEnum.NULL);
    if (
        isNewerVersionOrEqual(JRConstants.VERSION_4_6_0)
        && !isExcludeUuids() 
        )
    {
        writer.addAttribute(JRXmlConstants.ATTRIBUTE_uuid, dataset.getUUID().toString());
    }

    writeProperties(dataset);

    if (isNewerVersionOrEqual(JRConstants.VERSION_6_3_1))
    {
        writePropertyExpressions(dataset.getPropertyExpressions());
    }

    writeDatasetContents(dataset);

    writer.closeElement();
}
项目:jasperreports    文件:JRApiWriter.java   
/**
 * 
 */
public void writeDataset( JRDataset dataset, String datasetName)
{
    if(dataset != null)
    {
        write( "JRDesignDataset " + datasetName + " = new JRDesignDataset(" + dataset.isMainDataset() + ");\n");    

        write( datasetName + ".setName(\"{0}\");\n", JRStringUtil.escapeJavaStringLiteral(dataset.getName()));
        write( datasetName + ".setScriptletClass(\"{0}\");\n", JRStringUtil.escapeJavaStringLiteral(dataset.getScriptletClass()));
        write( datasetName + ".setResourceBundle(\"{0}\");\n", JRStringUtil.escapeJavaStringLiteral(dataset.getResourceBundle()));
        write( datasetName + ".setWhenResourceMissingType({0});\n", dataset.getWhenResourceMissingTypeValue(), WhenResourceMissingTypeEnum.NULL);

        writeProperties( dataset, datasetName);
        writePropertyExpressions( dataset.getPropertyExpressions(), datasetName);

        writeDatasetContents( dataset, datasetName);
        flush();
    }

}
项目:jasperreports    文件:JREvaluator.java   
/**
 * Initializes the evaluator by setting the parameter, field and variable objects.
 * 
 * @param parametersMap the parameters indexed by name
 * @param fieldsMap the fields indexed by name
 * @param variablesMap the variables indexed by name
 * @param resourceMissingType the resource missing type
 * @throws JRException
 */
@Override
public void init(
        Map<String, JRFillParameter> parametersMap, 
        Map<String, JRFillField> fieldsMap, 
        Map<String, JRFillVariable> variablesMap, 
        WhenResourceMissingTypeEnum resourceMissingType,
        boolean ignoreNPE
        ) throws JRException
{
    whenResourceMissingType = resourceMissingType;
    this.ignoreNPE = ignoreNPE;
    resourceBundle = parametersMap.get(JRParameter.REPORT_RESOURCE_BUNDLE);
    locale = parametersMap.get(JRParameter.REPORT_LOCALE);

    functions = new HashMap<String, FunctionSupport>();
    functionContext = new FillFunctionContext(parametersMap);

    customizedInit(parametersMap, fieldsMap, variablesMap);

    defaultValues = new FillExpressionDefaultValues(this, parametersMap, fieldsMap, variablesMap);
    oldValues =  new FillExpressionOldValues(this, parametersMap, fieldsMap, variablesMap);
    estimatedValues = new FillExpressionEstimatedValues(this, parametersMap, fieldsMap, variablesMap);
}
项目:com.opendoorlogistics    文件:ReportBuilderUtils.java   
static JasperDesign createEmpty(String tablename, int pageWidth, int pageHeight, boolean margins) {
    JasperDesign ret = new JasperDesign();
    ret.setName(Strings.removeExportIllegalChars(AppConstants.ORG_NAME + " - " + tablename));
    ret.setWhenNoDataType(WhenNoDataTypeEnum.ALL_SECTIONS_NO_DETAIL);
    ret.setWhenResourceMissingType(WhenResourceMissingTypeEnum.EMPTY);
    ret.setOrientation(OrientationEnum.LANDSCAPE);
    ret.setPageWidth(pageWidth);
    ret.setPageHeight(pageHeight);

    if (!margins) {
        ret.setLeftMargin(0);
        ret.setRightMargin(0);
        ret.setTopMargin(0);
        ret.setBottomMargin(0);
    }

    ret.setColumnWidth(Math.min(getAvailableWidth(ret), ret.getColumnWidth()));

    return ret;
}
项目:jasperreports    文件:JRBaseDataset.java   
@Override
public void setWhenResourceMissingType(WhenResourceMissingTypeEnum whenResourceMissingTypeValue)
{
    Object old = this.whenResourceMissingTypeValue;
    this.whenResourceMissingTypeValue = whenResourceMissingTypeValue;
    getEventSupport().firePropertyChange(PROPERTY_WHEN_RESOURCE_MISSING_TYPE, old, this.whenResourceMissingTypeValue);
}
项目:jasperreports    文件:JRBaseDataset.java   
@SuppressWarnings("deprecation")
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
    in.defaultReadObject();

    if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2)
    {
        whenResourceMissingTypeValue = WhenResourceMissingTypeEnum.getByValue(whenResourceMissingType);
    }
}
项目:jasperreports    文件:JRCalculator.java   
/**
 * Initializes the calculator.
 * 
 * @param dataset the dataset this calculator is used for
 * @throws JRException
 */
protected void init(JRFillDataset dataset) throws JRException
{
    this.dataset = dataset;
    parsm = dataset.parametersMap;
    fldsm = dataset.fieldsMap;
    varsm = dataset.variablesMap;
    variables = dataset.variables;
    groups = dataset.groups;
    datasets = dataset.elementDatasets;

    pageNumber = varsm.get(JRVariable.PAGE_NUMBER);
    columnNumber = varsm.get(JRVariable.COLUMN_NUMBER);

    WhenResourceMissingTypeEnum whenResourceMissingType = dataset.getWhenResourceMissingTypeValue();
    boolean ignoreNPE = 
        JRPropertiesUtil.getInstance(getFillDataset().getJasperReportsContext())
            .getBooleanProperty(
                getFillDataset(), 
                JREvaluator.PROPERTY_IGNORE_NPE, 
                true
                );
    evaluator.init(parsm, fldsm,varsm, whenResourceMissingType, ignoreNPE);

    legacyBandEvaluationEnabled = 
        JRPropertiesUtil.getInstance(getFillDataset().getJasperReportsContext())
            .getBooleanProperty(
                PROPERTY_LEGACY_BAND_EVALUATION_ENABLED
                );
}
项目:jasperreports    文件:DatasetExpressionEvaluator.java   
void init(
Map<String, JRFillParameter> parametersMap, 
Map<String, JRFillField> fieldsMap, 
Map<String, JRFillVariable> variablesMap, 
WhenResourceMissingTypeEnum resourceMissingType,
boolean ignoreNPE
) throws JRException;
项目: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
}
项目:ireport-fork    文件:DatasetNode.java   
@SuppressWarnings("unchecked")
public WhenResourceMissingTypeProperty(JRDesignDataset dataset)
{
    // TODO: Replace WhenNoDataType with the right constant
    super(WhenResourceMissingTypeEnum.class, dataset);
    this.dataset = dataset;
    setValue("suppressCustomEditor", Boolean.TRUE);
}
项目:ireport-fork    文件:DatasetNode.java   
@Override
public List getTagList()
{
    List tags = new java.util.ArrayList();
    tags.add(new Tag(WhenResourceMissingTypeEnum.EMPTY, I18n.getString("DatasetNode.Property.Empty")));
    tags.add(new Tag(WhenResourceMissingTypeEnum.ERROR, I18n.getString("DatasetNode.Property.Error")));
    tags.add(new Tag(WhenResourceMissingTypeEnum.KEY, I18n.getString("DatasetNode.Property.Key")));
    tags.add(new Tag(WhenResourceMissingTypeEnum.NULL, I18n.getString("DatasetNode.Property.Null")));
    return tags;
}
项目:jasperreports    文件:JRBaseReport.java   
@Override
public WhenResourceMissingTypeEnum getWhenResourceMissingTypeValue()
{
    return mainDataset.getWhenResourceMissingTypeValue();
}
项目:jasperreports    文件:JRBaseReport.java   
@Override
public void setWhenResourceMissingType(WhenResourceMissingTypeEnum whenResourceMissingType)
{
    mainDataset.setWhenResourceMissingType(whenResourceMissingType);
}
项目:jasperreports    文件:JRBaseDataset.java   
@Override
public WhenResourceMissingTypeEnum getWhenResourceMissingTypeValue()
{
    return whenResourceMissingTypeValue;
}
项目:jasperreports    文件:JRFillDataset.java   
@Override
public WhenResourceMissingTypeEnum getWhenResourceMissingTypeValue()
{
    return whenResourceMissingType;
}
项目:jasperreports    文件:JRFillDataset.java   
@Override
public void setWhenResourceMissingType(WhenResourceMissingTypeEnum whenResourceMissingType)
{
    this.whenResourceMissingType = whenResourceMissingType;
}
项目:jasperreports    文件:JRBaseFiller.java   
protected WhenResourceMissingTypeEnum getWhenResourceMissingType()
{
    return mainDataset.whenResourceMissingType;
}
项目: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    文件:BuiltinExpressionEvaluator.java   
void init(Map<String, JRFillParameter> parametersMap, 
Map<String, JRFillField> fieldsMap, 
Map<String, JRFillVariable> variablesMap, 
WhenResourceMissingTypeEnum resourceMissingType) throws JRException;
项目:jasperreports    文件:TableReportDataset.java   
@Override
public WhenResourceMissingTypeEnum getWhenResourceMissingTypeValue()
{
    return tableSubdataset.getWhenResourceMissingTypeValue();
}
项目:jasperreports    文件:TableReportDataset.java   
@Override
public void setWhenResourceMissingType(
        WhenResourceMissingTypeEnum whenResourceMissingType)
{
    throw new UnsupportedOperationException();
}
项目:jasperreports    文件:TableReport.java   
@Override
public WhenResourceMissingTypeEnum getWhenResourceMissingTypeValue()
{
    return mainDataset.getWhenResourceMissingTypeValue();
}
项目:jasperreports    文件:TableReport.java   
@Override
public void setWhenResourceMissingType(
        WhenResourceMissingTypeEnum whenResourceMissingType)
{
    throw new UnsupportedOperationException();
}
项目:PDFReporter-Studio    文件:MDataset.java   
/**
 * Creates the property descriptors.
 * 
 * @param desc
 *          the desc
 */
@Override
public void createPropertyDescriptors(List<IPropertyDescriptor> desc, Map<String, Object> defaultsMap) {
    validator = new DatasetNameValidator();
    validator.setTargetNode(this);
    JSSValidatedTextPropertyDescriptor nameD = new JSSValidatedTextPropertyDescriptor(JRDesignDataset.PROPERTY_NAME,
            Messages.common_name, validator);
    nameD.setDescription(Messages.MDataset_name_description);
    desc.add(nameD);

    JPropertiesPropertyDescriptor propertiesD = new JPropertiesPropertyDescriptor(PROPERTY_MAP,
            Messages.common_properties);
    propertiesD.setDescription(Messages.MDataset_properties_description);
    desc.add(propertiesD);
    propertiesD.setHelpRefBuilder(new HelpReferenceBuilder(
            "net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#property"));

    NClassTypePropertyDescriptor classD = new NClassTypePropertyDescriptor(JRDesignDataset.PROPERTY_SCRIPTLET_CLASS,
            Messages.MDataset_scriplet_class);
    classD.setDescription(Messages.MDataset_class_description);
    desc.add(classD);
    classD.setHelpRefBuilder(new HelpReferenceBuilder(
            "net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#scriptlet"));

    ResourceBundlePropertyDescriptor resBundleD = new ResourceBundlePropertyDescriptor(
            JRDesignDataset.PROPERTY_RESOURCE_BUNDLE, Messages.MDataset_resource_bundle);
    resBundleD.setDescription(Messages.MDataset_resource_bundle_description);
    desc.add(resBundleD);

    JRQueryButtonPropertyDescriptor queryD = new JRQueryButtonPropertyDescriptor(JRDesignDataset.PROPERTY_QUERY,
            Messages.common_query, NullEnum.NULL, Messages.MDataset_Edit_Query_Button_Text);
    queryD.setDescription(Messages.MDataset_query_description);
    desc.add(queryD);
    queryD.setHelpRefBuilder(new HelpReferenceBuilder(
            "net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#queryString"));

    whenResMissTypeD = new JSSEnumPropertyDescriptor(JRDesignDataset.PROPERTY_WHEN_RESOURCE_MISSING_TYPE,
            Messages.MDataset_when_resource_missing_type, WhenResourceMissingTypeEnum.class, NullEnum.NOTNULL);
    whenResMissTypeD.setDescription(Messages.MDataset_when_resource_missing_type_description);
    desc.add(whenResMissTypeD);

    JRExpressionPropertyDescriptor filterExpression = new JRExpressionPropertyDescriptor(
            JRDesignDataset.PROPERTY_FILTER_EXPRESSION, Messages.MDataset_filter_expression);
    filterExpression.setDescription(Messages.MDataset_filter_expression_description);
    desc.add(filterExpression);
    filterExpression.setHelpRefBuilder(new HelpReferenceBuilder(
            "net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#filterExpression"));

    defaultsMap.put(JRDesignDataset.PROPERTY_RESOURCE_BUNDLE, null);
    defaultsMap.put(JRDesignDataset.PROPERTY_WHEN_RESOURCE_MISSING_TYPE,
            EnumHelper.getValue(WhenResourceMissingTypeEnum.NULL, 1, false));
    defaultsMap.put(JRDesignDataset.PROPERTY_FILTER_EXPRESSION, null);

    setHelpPrefix(desc, "net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#subDataset");
}
项目:ireport-fork    文件:DatasetNode.java   
@Override
public Object getDefaultValue()
{
    return WhenResourceMissingTypeEnum.NULL;
}
项目:ireport-fork    文件:DatasetNode.java   
@Override
public void setPropertyValue(Object val)
{
    dataset.setWhenResourceMissingType((WhenResourceMissingTypeEnum)val);
}
项目:jasperreports    文件:JRDataset.java   
/**
 * Returns the resource missing handling type.
 * 
 * @return the resource missing handling type
 */
public WhenResourceMissingTypeEnum getWhenResourceMissingTypeValue();
项目:jasperreports    文件:JRDataset.java   
/**
 * Sets the resource missing handling type.
 * @param whenResourceMissingType the resource missing handling type
 */
public void setWhenResourceMissingType(WhenResourceMissingTypeEnum whenResourceMissingType);
项目:jasperreports    文件:JRReport.java   
/**
 * Returns the resource missing handling type.
 */
public WhenResourceMissingTypeEnum getWhenResourceMissingTypeValue();
项目:jasperreports    文件:JRReport.java   
/**
 * Sets the resource missing handling type.
 * @param whenResourceMissingType the resource missing handling type
 */
public void setWhenResourceMissingType(WhenResourceMissingTypeEnum whenResourceMissingType);
项目:jasperreports-scala    文件:JRReport.java   
/**
 * Returns the resource missing handling type.
 */
public WhenResourceMissingTypeEnum getWhenResourceMissingTypeValue();
项目:jasperreports-scala    文件:JRReport.java   
/**
 * Sets the resource missing handling type.
 * @param whenResourceMissingType the resource missing handling type
 */
public void setWhenResourceMissingType(WhenResourceMissingTypeEnum whenResourceMissingType);