Package org.apache.poi.hssf.record
Class HyperlinkRecord
- java.lang.Object
-
- org.apache.poi.hssf.record.RecordBase
-
- org.apache.poi.hssf.record.Record
-
- org.apache.poi.hssf.record.StandardRecord
-
- org.apache.poi.hssf.record.HyperlinkRecord
-
- All Implemented Interfaces:
Duplicatable
,GenericRecord
public final class HyperlinkRecord extends StandardRecord
TheHyperlinkRecord
(0x01B8) wraps an HLINK-record from the Excel-97 format. Supports only external links for now (eg http://)
-
-
Field Summary
Fields Modifier and Type Field Description static short
sid
-
Constructor Summary
Constructors Constructor Description HyperlinkRecord()
Create a new hyperlinkHyperlinkRecord(HyperlinkRecord other)
HyperlinkRecord(RecordInputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HyperlinkRecord
copy()
String
getAddress()
Hyperlink address.protected int
getDataSize()
int
getFileOptions()
int
getFirstColumn()
int
getFirstRow()
Map<String,Supplier<?>>
getGenericProperties()
HSSFRecordTypes
getGenericRecordType()
String
getLabel()
Return text label for this hyperlinkint
getLabelOptions()
int
getLastColumn()
int
getLastRow()
String
getShortFilename()
short
getSid()
return the non static version of the id for this record.String
getTargetFrame()
String
getTextMark()
boolean
isDocumentLink()
Based on the link options, is this a document?boolean
isFileLink()
Based on the link options, is this a file?boolean
isUrlLink()
Based on the link options, is this a url?void
newDocumentLink()
Initialize a new document linkvoid
newFileLink()
Initialize a new file linkvoid
newUrlLink()
Initialize a new url linkvoid
serialize(LittleEndianOutput out)
Write the data content of this BIFF record.void
setAddress(String address)
Hyperlink address.void
setFirstColumn(int firstCol)
Set the first column (zero-based) of the range that contains this hyperlinkvoid
setFirstRow(int firstRow)
Set the first row (zero-based) of the range that contains this hyperlinkvoid
setLabel(String label)
Sets text label for this hyperlinkvoid
setLastColumn(int lastCol)
Set the last column (zero-based) of the range that contains this hyperlinkvoid
setLastRow(int lastRow)
Set the last row (zero-based) of the range that contains this hyperlinkvoid
setShortFilename(String shortFilename)
void
setTextMark(String textMark)
-
Methods inherited from class org.apache.poi.hssf.record.StandardRecord
getRecordSize, serialize
-
Methods inherited from class org.apache.poi.hssf.record.Record
cloneViaReserialise, serialize, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.poi.common.usermodel.GenericRecord
getGenericChildren
-
-
-
-
Field Detail
-
sid
public static final short sid
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HyperlinkRecord
public HyperlinkRecord()
Create a new hyperlink
-
HyperlinkRecord
public HyperlinkRecord(HyperlinkRecord other)
-
HyperlinkRecord
public HyperlinkRecord(RecordInputStream in)
-
-
Method Detail
-
getFirstColumn
public int getFirstColumn()
- Returns:
- the 0-based column of the first cell that contains this hyperlink
-
setFirstColumn
public void setFirstColumn(int firstCol)
Set the first column (zero-based) of the range that contains this hyperlink- Parameters:
firstCol
- the first column (zero-based)
-
getLastColumn
public int getLastColumn()
- Returns:
- the 0-based column of the last cell that contains this hyperlink
-
setLastColumn
public void setLastColumn(int lastCol)
Set the last column (zero-based) of the range that contains this hyperlink- Parameters:
lastCol
- the last column (zero-based)
-
getFirstRow
public int getFirstRow()
- Returns:
- the 0-based row of the first cell that contains this hyperlink
-
setFirstRow
public void setFirstRow(int firstRow)
Set the first row (zero-based) of the range that contains this hyperlink- Parameters:
firstRow
- the first row (zero-based)
-
getLastRow
public int getLastRow()
- Returns:
- the 0-based row of the last cell that contains this hyperlink
-
setLastRow
public void setLastRow(int lastRow)
Set the last row (zero-based) of the range that contains this hyperlink- Parameters:
lastRow
- the last row (zero-based)
-
getLabel
public String getLabel()
Return text label for this hyperlink- Returns:
- text to display
-
setLabel
public void setLabel(String label)
Sets text label for this hyperlink- Parameters:
label
- text label for this hyperlink
-
getTargetFrame
public String getTargetFrame()
-
getAddress
public String getAddress()
Hyperlink address. Depending on the hyperlink type it can be URL, e-mail, path to a file, etc.- Returns:
- the address of this hyperlink
-
setAddress
public void setAddress(String address)
Hyperlink address. Depending on the hyperlink type it can be URL, e-mail, path to a file, etc.- Parameters:
address
- the address of this hyperlink
-
getShortFilename
public String getShortFilename()
-
setShortFilename
public void setShortFilename(String shortFilename)
-
getTextMark
public String getTextMark()
-
setTextMark
public void setTextMark(String textMark)
-
getLabelOptions
public int getLabelOptions()
- Returns:
- Label options
-
getFileOptions
public int getFileOptions()
- Returns:
- Options for a file link
-
serialize
public void serialize(LittleEndianOutput out)
Description copied from class:StandardRecord
Write the data content of this BIFF record. The 'ushort sid' and 'ushort size' header fields have already been written by the superclass.The number of bytes written must equal the record size reported by
RecordBase.getRecordSize()
} minus four ( record header consisting of a 'ushort sid' and 'ushort reclength' has already been written by their superclass).- Specified by:
serialize
in classStandardRecord
- Parameters:
out
- the output object
-
getDataSize
protected int getDataSize()
- Specified by:
getDataSize
in classStandardRecord
-
getSid
public short getSid()
Description copied from class:Record
return the non static version of the id for this record.
-
isUrlLink
public boolean isUrlLink()
Based on the link options, is this a url?- Returns:
- true, if this is a url link
-
isFileLink
public boolean isFileLink()
Based on the link options, is this a file?- Returns:
- true, if this is a file link
-
isDocumentLink
public boolean isDocumentLink()
Based on the link options, is this a document?- Returns:
- true, if this is a docment link
-
newUrlLink
public void newUrlLink()
Initialize a new url link
-
newFileLink
public void newFileLink()
Initialize a new file link
-
newDocumentLink
public void newDocumentLink()
Initialize a new document link
-
copy
public HyperlinkRecord copy()
- Specified by:
copy
in interfaceDuplicatable
- Specified by:
copy
in classStandardRecord
- Returns:
- a deep copy of the implementing class / instance
-
getGenericRecordType
public HSSFRecordTypes getGenericRecordType()
- Specified by:
getGenericRecordType
in interfaceGenericRecord
- Specified by:
getGenericRecordType
in classRecord
-
-