Top Description Fields Constructors Methods
org.apache.poi.hssf.record

public final Class HyperlinkRecord

extends StandardRecord
Class Inheritance
Static Imports
org.apache.logging.log4j.util.Unbox.box, org.apache.poi.hpsf.ClassIDPredefined.FILE_MONIKER, .ClassIDPredefined.STD_MONIKER, .ClassIDPredefined.URL_MONIKER, org.apache.poi.util.GenericRecordUtil.getBitsAsString, .HexDump.toHex

The HyperlinkRecord (0x01B8) wraps an HLINK-record from the Excel-97 format. Supports only external links for now (eg http://)

Field Summary

Modifier and TypeField and Description
private String
private int
_fileOpts

Some sort of options for file links.

private ClassID
_guid

16-byte GUID

private String
_label

Test label

private int
_linkOpts

Link options.

private ClassID
_moniker

Moniker.

private CellRangeAddress
_range

cell range of this hyperlink

private String
_shortFilename

in 8:3 DOS format No Unicode string header, always 8-bit characters, zero-terminated

private String
private String
_textMark

Text describing a place in document.

private byte[]
private static final byte[]
FILE_TAIL

expected Tail of a file link

private static final Logger
public static final short
private static final int
private static final byte[]
URL_TAIL

expected Tail of a URL link

Constructor Summary

AccessConstructor and Description
public
HyperlinkRecord()

Create a new hyperlink

public
public

Method Summary

Modifier and TypeMethod and Description
private static String
private static String
public HyperlinkRecord
public String

Returns:

the address of this hyperlink
getAddress
()

Hyperlink address.

protected int
public int

Returns:

Options for a file link
getFileOptions
()

public int

Returns:

the 0-based column of the first cell that contains this hyperlink
getFirstColumn
()

public int

Returns:

the 0-based row of the first cell that contains this hyperlink
getFirstRow
()

public Map<String, Supplier<?>>
public HSSFRecordTypes
pack-priv ClassID

Returns:

16-byte guid identifier Seems to always equal ClassIDPredefined#STD_MONIKER
getGuid
()

public String

Returns:

text to display
getLabel
()

Return text label for this hyperlink

public int

Returns:

Label options
getLabelOptions
()

public int

Returns:

the 0-based column of the last cell that contains this hyperlink
getLastColumn
()

public int

Returns:

the 0-based row of the last cell that contains this hyperlink
getLastRow
()

pack-priv int

Returns:

Link options
getLinkOptions
()

Link options.

pack-priv ClassID

Returns:

16-byte moniker
getMoniker
()

public String
public short
getSid()

Implements abstract org.apache.poi.hssf.record.Record.getSid.

return the non static version of the id for this record.

public String
public String
private static byte[]
readTail(byte[] expectedTail, LittleEndianInput in)

public void
serialize(LittleEndianOutput
the output object
out
)

Implements abstract org.apache.poi.hssf.record.StandardRecord.serialize.

Write the data content of this BIFF record.

public void
setAddress(String
the address of this hyperlink
address
)

Hyperlink address.

public void
setFirstColumn(int
the first column (zero-based)
firstCol
)

Set the first column (zero-based) of the range that contains this hyperlink

public void
setFirstRow(int
the first row (zero-based)
firstRow
)

Set the first row (zero-based) of the range that contains this hyperlink

public void
setLabel(String
text label for this hyperlink
label
)

Sets text label for this hyperlink

public void
setLastColumn(int
the last column (zero-based)
lastCol
)

Set the last column (zero-based) of the range that contains this hyperlink

public void
setLastRow(int
the last row (zero-based)
lastRow
)

Set the last row (zero-based) of the range that contains this hyperlink

public void
setShortFilename(String shortFilename)

public void
setTextMark(String textMark)

private static void
writeTail(byte[] tail, LittleEndianOutput out)

Inherited from org.apache.poi.hssf.record.StandardRecord:
getRecordSizeserialize

Field Detail

_addressback to summary
private String _address

Link

_fileOptsback to summary
private int _fileOpts

Some sort of options for file links.

_guidback to summary
private ClassID _guid

16-byte GUID

_labelback to summary
private String _label

Test label

_linkOptsback to summary
private int _linkOpts

Link options. Can include any of HLINK_* flags.

_monikerback to summary
private ClassID _moniker

Moniker. Makes sense only for URL and file links

_rangeback to summary
private CellRangeAddress _range

cell range of this hyperlink

_shortFilenameback to summary
private String _shortFilename

in 8:3 DOS format No Unicode string header, always 8-bit characters, zero-terminated

_targetFrameback to summary
private String _targetFrame
_textMarkback to summary
private String _textMark

Text describing a place in document. In Excel UI, this is appended to the address, (after a '#' delimiter).
This field is optional. If present, the HLINK_PLACE must be set.

_uninterpretedTailback to summary
private byte[] _uninterpretedTail
FILE_TAILback to summary
private static final byte[] FILE_TAIL

expected Tail of a file link

LOGback to summary
private static final Logger LOG
sidback to summary
public static final short sid
TAIL_SIZEback to summary
private static final int TAIL_SIZE
URL_TAILback to summary
private static final byte[] URL_TAIL

expected Tail of a URL link

Constructor Detail

HyperlinkRecordback to summary
public HyperlinkRecord()

Create a new hyperlink

HyperlinkRecordback to summary
public HyperlinkRecord(HyperlinkRecord other)
HyperlinkRecordback to summary
public HyperlinkRecord(RecordInputStream in)

Method Detail

appendNullTermback to summary
private static String appendNullTerm(String s)
cleanStringback to summary
private static String cleanString(String s)
copyback to summary
public HyperlinkRecord copy()

Implements abstract org.apache.poi.hssf.record.StandardRecord.copy.

Implements org.apache.poi.common.Duplicatable.copy.

Returns:HyperlinkRecord

Doc from org.apache.poi.common.Duplicatable.copy.

a deep copy of the implementing class / instance

Annotations
@Override
getAddressback to summary
public String getAddress()

Hyperlink address. Depending on the hyperlink type it can be URL, e-mail, path to a file, etc.

Returns:String

the address of this hyperlink

getDataSizeback to summary
protected int getDataSize()

Implements abstract org.apache.poi.hssf.record.StandardRecord.getDataSize.

Annotations
@Override
getFileOptionsback to summary
public int getFileOptions()
Returns:int

Options for a file link

getFirstColumnback to summary
public int getFirstColumn()
Returns:int

the 0-based column of the first cell that contains this hyperlink

getFirstRowback to summary
public int getFirstRow()
Returns:int

the 0-based row of the first cell that contains this hyperlink

getGenericPropertiesback to summary
public Map<String, Supplier<?>> getGenericProperties()

Implements org.apache.poi.common.usermodel.GenericRecord.getGenericProperties.

Annotations
@Override
getGenericRecordTypeback to summary
public HSSFRecordTypes getGenericRecordType()

Overrides default org.apache.poi.common.usermodel.GenericRecord.getGenericRecordType.

Implements abstract org.apache.poi.hssf.record.Record.getGenericRecordType.

Annotations
@Override
getGuidback to summary
pack-priv ClassID getGuid()
Returns:ClassID

16-byte guid identifier Seems to always equal ClassIDPredefined#STD_MONIKER

getLabelback to summary
public String getLabel()

Return text label for this hyperlink

Returns:String

text to display

getLabelOptionsback to summary
public int getLabelOptions()
Returns:int

Label options

getLastColumnback to summary
public int getLastColumn()
Returns:int

the 0-based column of the last cell that contains this hyperlink

getLastRowback to summary
public int getLastRow()
Returns:int

the 0-based row of the last cell that contains this hyperlink

getLinkOptionsback to summary
pack-priv int getLinkOptions()

Link options. Must be a combination of HLINK_* constants. For testing only

Returns:int

Link options

getMonikerback to summary
pack-priv ClassID getMoniker()
Returns:ClassID

16-byte moniker

getShortFilenameback to summary
public String getShortFilename()
getSidback to summary
public short getSid()

Implements abstract org.apache.poi.hssf.record.Record.getSid.

Doc from org.apache.poi.hssf.record.Record.getSid.

return the non static version of the id for this record.

Returns:short

he id for this record

Annotations
@Override
getTargetFrameback to summary
public String getTargetFrame()
getTextMarkback to summary
public String getTextMark()
readTailback to summary
private static byte[] readTail(byte[] expectedTail, LittleEndianInput in)
serializeback to summary
public void serialize(LittleEndianOutput out)

Implements abstract org.apache.poi.hssf.record.StandardRecord.serialize.

Doc from org.apache.poi.hssf.record.StandardRecord.serialize.

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 org.apache.poi.hssf.record.Record#getRecordSize()} minus four ( record header consisting of a 'ushort sid' and 'ushort reclength' has already been written by their superclass).

Parameters
out:LittleEndianOutput

the output object

Annotations
@Override
setAddressback to summary
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:String

the address of this hyperlink

setFirstColumnback to summary
public void setFirstColumn(int firstCol)

Set the first column (zero-based) of the range that contains this hyperlink

Parameters
firstCol:int

the first column (zero-based)

setFirstRowback to summary
public void setFirstRow(int firstRow)

Set the first row (zero-based) of the range that contains this hyperlink

Parameters
firstRow:int

the first row (zero-based)

setLabelback to summary
public void setLabel(String label)

Sets text label for this hyperlink

Parameters
label:String

text label for this hyperlink

setLastColumnback to summary
public void setLastColumn(int lastCol)

Set the last column (zero-based) of the range that contains this hyperlink

Parameters
lastCol:int

the last column (zero-based)

setLastRowback to summary
public void setLastRow(int lastRow)

Set the last row (zero-based) of the range that contains this hyperlink

Parameters
lastRow:int

the last row (zero-based)

setShortFilenameback to summary
public void setShortFilename(String shortFilename)
setTextMarkback to summary
public void setTextMark(String textMark)
writeTailback to summary
private static void writeTail(byte[] tail, LittleEndianOutput out)