Class ExcelHyperlink
java.lang.Object
com.northconcepts.datapipeline.excel.ExcelHyperlink
Represents a hyperlink that can be attached to an Excel cell.
Supports hyperlinks to document locations, URLs, email addresses, and files.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionExcelHyperlink(ExcelHyperlinkType type, String location) Creates a new ExcelHyperlink with the specified type and location. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic FieldLocationPredicateCreates a field location predicate that matches fields containing an ExcelHyperlink in their metadata.static ExcelHyperlinkCreates a hyperlink to another cell in the same Excel workbook.static ExcelHyperlinkCreates a hyperlink to an email address.static ExcelHyperlinkCreates a hyperlink to a file.static ExcelHyperlinkCreates a hyperlink to a URL.Gets the location/address of this hyperlink.getType()Gets the type of this hyperlink.inthashCode()toString()
-
Constructor Details
-
ExcelHyperlink
Creates a new ExcelHyperlink with the specified type and location.- Parameters:
type- the type of hyperlinklocation- the hyperlink location/address
-
-
Method Details
-
forCell
Creates a hyperlink to another cell in the same Excel workbook.- Parameters:
sheetName- the name of the sheet containing the target cellcolumnIndex- the zero-based column index of the target cellrowIndex- the zero-based row index of the target cell- Returns:
- an ExcelHyperlink pointing to the specified cell
- Throws:
DataException- if sheetName is null or empty, or if columnIndex or rowIndex is negative
-
forEmail
Creates a hyperlink to an email address.- Parameters:
email- the email address- Returns:
- an ExcelHyperlink pointing to the email address
- Throws:
DataException- if email is null or empty
-
forUrl
Creates a hyperlink to a URL.- Parameters:
url- the URL- Returns:
- an ExcelHyperlink pointing to the URL
- Throws:
DataException- if url is null or empty
-
forFile
Creates a hyperlink to a file.- Parameters:
fileUri- the file URI- Returns:
- an ExcelHyperlink pointing to the file
- Throws:
DataException- if fileUri is null or empty
-
fieldHasHyperlink
Creates a field location predicate that matches fields containing an ExcelHyperlink in their metadata.- Returns:
- a predicate that returns true if the field has an associated ExcelHyperlink
-
getType
Gets the type of this hyperlink.- Returns:
- the hyperlink type
-
getLocation
Gets the location/address of this hyperlink.- Returns:
- the hyperlink location
-
toString
-
hashCode
public int hashCode() -
equals
-