What Is poi-5.2.3.jar?

What Is poi-5.2.3.jar?

✍: FYIcenter.com

poi-5.2.3.jar is one of the JAR files for Apache POI 5.2.3, which provides an API for Microsoft document files of Word, Excel, PowerPoint, and Visio.

poi-5.2.3.jar supports Apache POI components that read and write Microsoft's OLE 2 Compound document format, which is used in early versions of Microsoft Office tools like Word 97, Excel 97, PowerPoint 97, etc.

poi-5.2.3.jar is distributed as part of the poi-bin-5.2.3-20220909.zip download file.

JAR File Size and Download Location:

JAR name: poi-5.2.3.jar
Target JDK version: 9

File name: poi.jar, poi-5.2.3.jar
File size: 2964641 bytes
Release date: 09-09-2022
Download: Apache POI Website

Here are Java Source Code files for poi-5.2.3.jar:

org/apache/poi/hssf/usermodel/HSSFDataValidation.java

/* ====================================================================
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
==================================================================== */

package org.apache.poi.hssf.usermodel;

import org.apache.poi.hssf.record.DVRecord;
import org.apache.poi.hssf.usermodel.DVConstraint.FormulaPair;
import org.apache.poi.ss.usermodel.DataValidation;
import org.apache.poi.ss.usermodel.DataValidationConstraint;
import org.apache.poi.ss.usermodel.DataValidationConstraint.ValidationType;
import org.apache.poi.ss.util.CellRangeAddressList;

/**
 * Utility class for creating data validation cells
 */
public final class HSSFDataValidation implements DataValidation {
    private String _prompt_title;
    private String _prompt_text;
    private String _error_title;
    private String _error_text;

    private int _errorStyle = ErrorStyle.STOP;
    private boolean _emptyCellAllowed = true;
    private boolean _suppress_dropdown_arrow;
    private boolean _showPromptBox = true;
    private boolean _showErrorBox = true;
    private CellRangeAddressList _regions;
    private DVConstraint _constraint;

    /**
     * Constructor which initializes the cell range on which this object will be
     * applied
     *
     * @param regions A list of regions where the constraint is validated.
     * @param constraint The constraints to apply for this validation.
     */
    public HSSFDataValidation(CellRangeAddressList regions, DataValidationConstraint constraint) {
        _regions = regions;
        
        //FIXME: This cast can be avoided.
        _constraint = (DVConstraint)constraint;
    }


    /* (non-Javadoc)
     * @see org.apache.poi.hssf.usermodel.DataValidation#getConstraint()
     */
    public DataValidationConstraint getValidationConstraint() {
        return _constraint;
    }

    public DVConstraint getConstraint() {
        return _constraint;
    }
    
    public CellRangeAddressList getRegions() {
        return _regions;
    }


    /* (non-Javadoc)
     * @see org.apache.poi.hssf.usermodel.DataValidation#setErrorStyle(int)
     */
    public void setErrorStyle(int error_style) {
        _errorStyle = error_style;
    }

    /* (non-Javadoc)
     * @see org.apache.poi.hssf.usermodel.DataValidation#getErrorStyle()
     */
    public int getErrorStyle() {
        return _errorStyle;
    }

    /* (non-Javadoc)
     * @see org.apache.poi.hssf.usermodel.DataValidation#setEmptyCellAllowed(boolean)
     */
    public void setEmptyCellAllowed(boolean allowed) {
        _emptyCellAllowed = allowed;
    }

    /* (non-Javadoc)
     * @see org.apache.poi.hssf.usermodel.DataValidation#getEmptyCellAllowed()
     */
    public boolean getEmptyCellAllowed() {
        return _emptyCellAllowed;
    }

    /* (non-Javadoc)
     * @see org.apache.poi.hssf.usermodel.DataValidation#setSuppressDropDownArrow(boolean)
     */
    public void setSuppressDropDownArrow(boolean suppress) {
        _suppress_dropdown_arrow = suppress;
    }

    /* (non-Javadoc)
     * @see org.apache.poi.hssf.usermodel.DataValidation#getSuppressDropDownArrow()
     */
    public boolean getSuppressDropDownArrow() {
        //noinspection SimplifiableIfStatement
        if (_constraint.getValidationType()==ValidationType.LIST) {
            return _suppress_dropdown_arrow;
        }
        return false;
    }

    /* (non-Javadoc)
     * @see org.apache.poi.hssf.usermodel.DataValidation#setShowPromptBox(boolean)
     */
    public void setShowPromptBox(boolean show) {
        _showPromptBox = show;
    }

    /* (non-Javadoc)
     * @see org.apache.poi.hssf.usermodel.DataValidation#getShowPromptBox()
     */
    public boolean getShowPromptBox() {
        return _showPromptBox;
    }

    /* (non-Javadoc)
     * @see org.apache.poi.hssf.usermodel.DataValidation#setShowErrorBox(boolean)
     */
    public void setShowErrorBox(boolean show) {
        _showErrorBox = show;
    }

    /* (non-Javadoc)
     * @see org.apache.poi.hssf.usermodel.DataValidation#getShowErrorBox()
     */
    public boolean getShowErrorBox() {
        return _showErrorBox;
    }


    /* (non-Javadoc)
     * @see org.apache.poi.hssf.usermodel.DataValidation#createPromptBox(java.lang.String, java.lang.String)
     */
    public void createPromptBox(String title, String text) {
        // check length-limits
        if(title != null && title.length() > 32) {
            throw new IllegalStateException("Prompt-title cannot be longer than 32 characters, but had: " + title);
        }
        if(text != null && text.length() > 255) {
            throw new IllegalStateException("Prompt-text cannot be longer than 255 characters, but had: " + text);
        }
        _prompt_title = title;
        _prompt_text = text;
        this.setShowPromptBox(true);
    }

    /* (non-Javadoc)
     * @see org.apache.poi.hssf.usermodel.DataValidation#getPromptBoxTitle()
     */
    public String getPromptBoxTitle() {
        return _prompt_title;
    }

    /* (non-Javadoc)
     * @see org.apache.poi.hssf.usermodel.DataValidation#getPromptBoxText()
     */
    public String getPromptBoxText() {
        return _prompt_text;
    }

    /* (non-Javadoc)
     * @see org.apache.poi.hssf.usermodel.DataValidation#createErrorBox(java.lang.String, java.lang.String)
     */
    public void createErrorBox(String title, String text) {
        if(title != null && title.length() > 32) {
            throw new IllegalStateException("Error-title cannot be longer than 32 characters, but had: " + title);
        }
        if(text != null && text.length() > 255) {
            throw new IllegalStateException("Error-text cannot be longer than 255 characters, but had: " + text);
        }
        _error_title = title;
        _error_text = text;
        this.setShowErrorBox(true);
    }

    /* (non-Javadoc)
     * @see org.apache.poi.hssf.usermodel.DataValidation#getErrorBoxTitle()
     */
    public String getErrorBoxTitle() {
        return _error_title;
    }

    /* (non-Javadoc)
     * @see org.apache.poi.hssf.usermodel.DataValidation#getErrorBoxText()
     */
    public String getErrorBoxText() {
        return _error_text;
    }

    public DVRecord createDVRecord(HSSFSheet sheet) {

        FormulaPair fp = _constraint.createFormulas(sheet);
        
        return new DVRecord(_constraint.getValidationType(),
                _constraint.getOperator(),
                _errorStyle, _emptyCellAllowed, getSuppressDropDownArrow(),
                _constraint.getValidationType()==ValidationType.LIST && _constraint.getExplicitListValues()!=null,
                _showPromptBox, _prompt_title, _prompt_text,
                _showErrorBox, _error_title, _error_text,
                fp.getFormula1(), fp.getFormula2(),
                _regions);
    }
}

org/apache/poi/hssf/usermodel/HSSFDataValidation.java

Or download all of them as a single archive file:

File name: poi-5.2.3-src.zip
File size: 2479830 bytes
Release date: 2022-09-09
Download 

 

What Is poi-ooxml-5.2.3.jar?

What Is poi-bin-5.2.3-20220909.zip?

Downloading and Installing Apache POI Java Library

⇑⇑ FAQ for Apache POI (Poor Obfuscation Implementation)

2017-04-04, 53959👍, 0💬