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

public final Class ProtectRecord

extends StandardRecord
Class Inheritance
Imports
java.util.Map, java.util.function.Supplier, org.apache.poi.util.BitField, .BitFieldFactory, .GenericRecordUtil, .LittleEndianOutput

Defines whether a sheet or workbook is protected (HSSF DOES NOT SUPPORT ENCRYPTION)

HSSF now supports the simple "protected" sheets (where they are not encrypted and open office et al ignore the password record entirely).

Field Summary

Modifier and TypeField and Description
private int
private static final BitField
public static final short

Constructor Summary

AccessConstructor and Description
private
ProtectRecord(int options)

private
public
ProtectRecord(boolean isProtected)

public

Method Summary

Modifier and TypeMethod and Description
public ProtectRecord
protected int
public Map<String, Supplier<?>>
public HSSFRecordTypes
public boolean

Returns:

whether to protect the sheet or not
getProtect
()

get whether the sheet is protected or not

public short
getSid()

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

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

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
setProtect(boolean
whether to protect the sheet or not
protect
)

set whether the sheet is protected or not

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

Field Detail

_optionsback to summary
private int _options
protectFlagback to summary
private static final BitField protectFlag
sidback to summary
public static final short sid

Constructor Detail

ProtectRecordback to summary
private ProtectRecord(int options)
ProtectRecordback to summary
private ProtectRecord(ProtectRecord other)
ProtectRecordback to summary
public ProtectRecord(boolean isProtected)
ProtectRecordback to summary
public ProtectRecord(RecordInputStream in)

Method Detail

copyback to summary
public ProtectRecord copy()

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

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

Returns:ProtectRecord

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

a deep copy of the implementing class / instance

Annotations
@Override
getDataSizeback to summary
protected int getDataSize()

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

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
getProtectback to summary
public boolean getProtect()

get whether the sheet is protected or not

Returns:boolean

whether to protect the sheet or not

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

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

setProtectback to summary
public void setProtect(boolean protect)

set whether the sheet is protected or not

Parameters
protect:boolean

whether to protect the sheet or not