Example usage for org.apache.poi.ss.usermodel Hyperlink getLabel

List of usage examples for org.apache.poi.ss.usermodel Hyperlink getLabel

Introduction

In this page you can find the example usage for org.apache.poi.ss.usermodel Hyperlink getLabel.

Prototype

public String getLabel();

Source Link

Document

Return text label for this hyperlink

Usage

From source file:io.konig.spreadsheet.WorkbookProcessorImpl.java

License:Apache License

private String cellStringValue(Cell cell) {
    if (cell == null) {
        return null;
    }//from  w  w  w.j  a v a2s  . c o  m
    String text = dataFormatter.formatCellValue(cell);
    if (text != null && !text.startsWith("HYPERLINK(")) {
        text = text.trim();
        if (text.length() == 0) {
            text = null;
        }
    } else {

        Hyperlink link = cell.getHyperlink();
        if (link != null) {
            text = link.getLabel();
            if (text == null) {
                text = link.getAddress();
            }
            if (text != null) {
                text = text.trim();

            }
        }
    }
    return text;
}