APIdia Launch Partner
Top Description Inners Fields Constructors Methods
io.github.spannm.jackcess.impl

public Class PropertyMaps

extends Object
implements Iterable<PropertyMapImpl>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable
Imports
io.github.spannm.jackcess.DataType, .PropertyMap, io.github.spannm.jackcess.util.StringUtil, .ToStringBuilder, java.io.IOException, java.nio.ByteBuffer, java.util.ArrayList, .HashMap, .Iterator, .LinkedHashMap, .LinkedHashSet, .List, .Map, .Objects, .Set

Collection of PropertyMap instances read from a single property data block.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
PropertyMaps.Handler

Utility class for reading/writing property blocks.

private static class
PropertyMaps.Key

The name and block type which together identify a PropertyMap within one group.

pack-priv static interface
PropertyMaps.Owner

Utility interface for the object which owns the PropertyMaps

Field Summary

Modifier and TypeField and Description
private static final short
public static final String
DEFAULT_NAME

the name of the "default" properties for a PropertyMaps instance

private static final short
private final PropertyMaps.Handler
private static final short
private final Map<PropertyMaps.Key, PropertyMapImpl>
maps

maps the PropertyMap name (case-insensitive) and block type to the PropertyMap instance.

private final int
private final PropertyMaps.Owner
private static final short
private final RowIdImpl

Constructor Summary

AccessConstructor and Description
public
PropertyMaps(int objectId, RowIdImpl rowId, PropertyMaps.Handler handler, PropertyMaps.Owner owner)

Method Summary

Modifier and TypeMethod and Description
public PropertyMapImpl

Returns:

the PropertyMap with the given name in this group, creating if necessary
get
(String name)

Returns the PropertyMap with the given name in this group, creating if necessary.

private PropertyMapImpl
get(String name, short type)

Returns: the PropertyMap with the given name and type in this group, creating if necessary

public PropertyMapImpl

Returns:

the unnamed "default" PropertyMap in this group, creating if necessary.
getDefault
()

Returns the unnamed "default" PropertyMap in this group, creating if necessary.

public PropertyMapImpl

Returns:

the PropertyMap for the index with the given name in this group, creating if necessary. An index has its own block, and access names an index after its column by default, so this is a separate map from the one get returns for the same name.
getIndex
(String name)

Returns the PropertyMap for the index with the given name in this group, creating if necessary.

public int
public int
public static String
public boolean
public Iterator<PropertyMapImpl>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

public void
save()

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public byte[]
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

COLUMN_PROPERTY_VALUE_LISTback to summary
private static final short COLUMN_PROPERTY_VALUE_LIST
DEFAULT_NAMEback to summary
public static final String DEFAULT_NAME

the name of the "default" properties for a PropertyMaps instance

DEFAULT_PROPERTY_VALUE_LISTback to summary
private static final short DEFAULT_PROPERTY_VALUE_LIST
handlerback to summary
private final PropertyMaps.Handler handler
INDEX_PROPERTY_VALUE_LISTback to summary
private static final short INDEX_PROPERTY_VALUE_LIST
mapsback to summary
private final Map<PropertyMaps.Key, PropertyMapImpl> maps

maps the PropertyMap name (case-insensitive) and block type to the PropertyMap instance. The type belongs in the key because a block of type 0x02 holds the properties of an index, and access names an index after its column by default, so a table can hold a column block and an index block with the same name

objectIdback to summary
private final int objectId
ownerback to summary
private final PropertyMaps.Owner owner
PROPERTY_NAME_LISTback to summary
private static final short PROPERTY_NAME_LIST
rowIdback to summary
private final RowIdImpl rowId

Constructor Detail

PropertyMapsback to summary
public PropertyMaps(int objectId, RowIdImpl rowId, PropertyMaps.Handler handler, PropertyMaps.Owner owner)

Method Detail

getback to summary
public PropertyMapImpl get(String name)

Returns the PropertyMap with the given name in this group, creating if necessary.

Returns:PropertyMapImpl

the PropertyMap with the given name in this group, creating if necessary

getback to summary
private PropertyMapImpl get(String name, short type)
Returns:PropertyMapImpl

the PropertyMap with the given name and type in this group, creating if necessary

getDefaultback to summary
public PropertyMapImpl getDefault()

Returns the unnamed "default" PropertyMap in this group, creating if necessary.

Returns:PropertyMapImpl

the unnamed "default" PropertyMap in this group, creating if necessary.

getIndexback to summary
public PropertyMapImpl getIndex(String name)

Returns the PropertyMap for the index with the given name in this group, creating if necessary. An index has its own block, and access names an index after its column by default, so this is a separate map from the one get returns for the same name.

Returns:PropertyMapImpl

the PropertyMap for the index with the given name in this group, creating if necessary. An index has its own block, and access names an index after its column by default, so this is a separate map from the one get returns for the same name.

getObjectIdback to summary
public int getObjectId()
getSizeback to summary
public int getSize()
getTrimmedStringPropertyback to summary
public static String getTrimmedStringProperty(PropertyMap props, String propName)
isEmptyback to summary
public boolean isEmpty()
iteratorback to summary
public Iterator<PropertyMapImpl> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Annotations
@Override
saveback to summary
public void save() throws IOException
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
writeback to summary
public byte[] write() throws IOException
io.github.spannm.jackcess.impl back to summary

pack-priv final Class PropertyMaps.Handler

extends Object
Class Inheritance

Utility class for reading/writing property blocks.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
PropertyMaps.Handler.BooleanPropColumn

Normal boolean columns do not write into the actual row data, so we need to do a little extra work.

private class
PropertyMaps.Handler.PropColumn

Column adapted to work w/out a Table.

Field Summary

Modifier and TypeField and Description
private final Map<DataType, PropertyMaps.Handler.PropColumn>
columns

cache of PropColumns used to read/write property values

private final DatabaseImpl
database

the current database

private static final byte[]
NO_PROPS

read() treats a null byte[] and an empty one identically, so write() can safely use this for "nothing to write".

private final ColumnImpl
propCol

the system table "property" column

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private PropertyMaps.Handler.PropColumn
getColumn(DataType dataType, String propName, int dataSize, Object value)

Gets a PropColumn capable of reading/writing a property of the given DataType

private static boolean
isPseudoGuidColumn(DataType dataType, String propName, int dataSize, Object value)

public PropertyMaps

Returns:

a PropertyMaps instance decoded from the given bytes (always returns non-null result).
read
(byte[] propBytes, int objectId, RowIdImpl rowId, PropertyMaps.Owner owner)

Returns a PropertyMaps instance decoded from the given bytes (always returns non-null result).

private List<String>
readPropertyNames(ByteBuffer bbBlock)

Returns: the property names parsed from the given data chunk

private PropertyMapImpl
readPropertyValues(ByteBuffer bbBlock, List<String> propNames, short blockType, PropertyMaps maps)

Returns: the PropertyMap created from the values parsed from the given data chunk combined with the given property names

private String
readPropName(ByteBuffer buffer)

Reads a property name from the given data block

public void
save(PropertyMaps maps)

Saves PropertyMaps instance to the db.

public byte[]

Returns:

a byte[] encoded from the given PropertyMaps instance
write
(PropertyMaps maps)

Returns a byte[] encoded from the given PropertyMaps instance.

private void
writeBlock(PropertyMapImpl propMap, Set<String> propNames, short blockType, ByteArrayBuilder bab)

private void
private void
private void
writePropName(String propName, ByteArrayBuilder bab)

Writes a property name to the given data block

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

columnsback to summary
private final Map<DataType, PropertyMaps.Handler.PropColumn> columns

cache of PropColumns used to read/write property values

databaseback to summary
private final DatabaseImpl database

the current database

NO_PROPSback to summary
private static final byte[] NO_PROPS

read() treats a null byte[] and an empty one identically, so write() can safely use this for "nothing to write".

propColback to summary
private final ColumnImpl propCol

the system table "property" column

Constructor Detail

Handlerback to summary
pack-priv Handler(DatabaseImpl database)

Method Detail

getColumnback to summary
private PropertyMaps.Handler.PropColumn getColumn(DataType dataType, String propName, int dataSize, Object value) throws IOException

Gets a PropColumn capable of reading/writing a property of the given DataType

isPseudoGuidColumnback to summary
private static boolean isPseudoGuidColumn(DataType dataType, String propName, int dataSize, Object value) throws IOException
readback to summary
public PropertyMaps read(byte[] propBytes, int objectId, RowIdImpl rowId, PropertyMaps.Owner owner) throws IOException

Returns a PropertyMaps instance decoded from the given bytes (always returns non-null result).

Returns:PropertyMaps

a PropertyMaps instance decoded from the given bytes (always returns non-null result).

readPropertyNamesback to summary
private List<String> readPropertyNames(ByteBuffer bbBlock)
Returns:List<String>

the property names parsed from the given data chunk

readPropertyValuesback to summary
private PropertyMapImpl readPropertyValues(ByteBuffer bbBlock, List<String> propNames, short blockType, PropertyMaps maps) throws IOException
Returns:PropertyMapImpl

the PropertyMap created from the values parsed from the given data chunk combined with the given property names

readPropNameback to summary
private String readPropName(ByteBuffer buffer)

Reads a property name from the given data block

saveback to summary
public void save(PropertyMaps maps) throws IOException

Saves PropertyMaps instance to the db.

writeback to summary
public byte[] write(PropertyMaps maps) throws IOException

Returns a byte[] encoded from the given PropertyMaps instance.

Returns:byte[]

a byte[] encoded from the given PropertyMaps instance

writeBlockback to summary
private void writeBlock(PropertyMapImpl propMap, Set<String> propNames, short blockType, ByteArrayBuilder bab) throws IOException
writePropertyNamesback to summary
private void writePropertyNames(Set<String> propNames, ByteArrayBuilder bab)
writePropertyValuesback to summary
private void writePropertyValues(PropertyMapImpl propMap, Set<String> propNames, ByteArrayBuilder bab) throws IOException
writePropNameback to summary
private void writePropName(String propName, ByteArrayBuilder bab)

Writes a property name to the given data block

io.github.spannm.jackcess.impl back to summary

private final Class PropertyMaps.Handler.BooleanPropColumn

extends PropColumn
Class Inheritance

Normal boolean columns do not write into the actual row data, so we need to do a little extra work.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Object
read(byte[] data)

Overrides io.github.spannm.jackcess.impl.ColumnImpl.read.

Deserialize a raw byte value for this column into an Object

public ByteBuffer
write(Object obj, int remainingRowLength)

Overrides io.github.spannm.jackcess.impl.ColumnImpl.write.

Serialize an Object into a raw byte value for this column in little endian order

Inherited from io.github.spannm.jackcess.impl.PropertyMaps.Handler.PropColumn:
getDatabase

Constructor Detail

BooleanPropColumnback to summary
private BooleanPropColumn()

Method Detail

readback to summary
public Object read(byte[] data)

Overrides io.github.spannm.jackcess.impl.ColumnImpl.read.

Doc from io.github.spannm.jackcess.impl.ColumnImpl.read.

Deserialize a raw byte value for this column into an Object

Annotations
@Override
writeback to summary
public ByteBuffer write(Object obj, int remainingRowLength)

Overrides io.github.spannm.jackcess.impl.ColumnImpl.write.

Doc from io.github.spannm.jackcess.impl.ColumnImpl.write.

Serialize an Object into a raw byte value for this column in little endian order

Annotations
@Override
io.github.spannm.jackcess.impl back to summary

private Class PropertyMaps.Handler.PropColumn

extends ColumnImpl
Class Inheritance
Known Direct Subclasses
io.github.spannm.jackcess.impl.PropertyMaps.Handler.BooleanPropColumn

Column adapted to work w/out a Table.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public DatabaseImpl
getDatabase()

Overrides io.github.spannm.jackcess.impl.ColumnImpl.getDatabase.

Implements io.github.spannm.jackcess.Column.getDatabase.

Returns the database to which this column's table belongs.

Inherited from io.github.spannm.jackcess.impl.ColumnImpl:
booleanToIntegercalcLengthInUnitscollectUsageMapPagescompareTocountVariableLengthcreatedecodeTextValuedecodeUncompressedTextencodeTextValueencodeUncompressedTextfromDateDoublefromLocalDateDoublegenerateDefaultValuegetAutoNumberGeneratorgetCalculationContextgetCharsetgetColumnIdgetColumnIndexgetColumnNumbergetColumnValidatorgetComplexInfogetDateTimeFactorygetDateTimeFactorygetDisplayIndexgetFixedDataOffsetgetFixedDataSizegetFormatgetLengthgetLengthInUnitsgetNamegetOriginalDataTypegetOwnedPageCountgetPageChannelgetPrecisiongetPropertiesgetRowValuegetRowValuegetScalegetSQLTypegetTablegetTextCodePagegetTextSortOrdergetTimeZonegetTypegetVarLenTableIndexgetVersionHistoryColumngetZoneIdinitColumnValidatorisAppendOnlyisAutoNumberisCalculatedisComplexValueForeignKeyisCompressedUnicodeisGUIDValueisHyperlinkisImmutableValueisRawDataisThisColumnisVariableLengthldtFromLocalDateDoublepostTableLoadInitpropertiesUpdatedrawDataWrapperreadreadreadCodePagereadExtraFlagsreadFromNullMaskreadSortOrderreloadPropertiesValidatorssetCalcColEvalContextsetColumnIndexsetColumnValidatorsetRowValuesetRowValuesetUsageMapssetVersionHistoryColumnstoreInNullMasktoBigDecimaltoBigDecimaltoBigDecimaltoBooleanValuetoByteArraytoCharSequencetoDateDoubletoDateDoubletoInternalValuetoInternalValuetoLocalDateDoubletoLocalDateTimetoStringtoUnscaledByteArrayvalidatewithErrorContextwritewritewriteColUsageMapDefinitionwriteColUsageMapDefinitionswriteDefinitionwriteDefinitionswriteFixedLengthFieldwriteFixedLengthFieldwriteRealDatawriteToNullMask

Constructor Detail

PropColumnback to summary
private PropColumn(DataType type)

Method Detail

getDatabaseback to summary
public DatabaseImpl getDatabase()

Overrides io.github.spannm.jackcess.impl.ColumnImpl.getDatabase.

Implements io.github.spannm.jackcess.Column.getDatabase.

Doc from io.github.spannm.jackcess.Column.getDatabase.

Returns the database to which this column's table belongs.

Annotations
@Override
io.github.spannm.jackcess.impl back to summary

private final Class PropertyMaps.Key

extends Object
Class Inheritance

The name and block type which together identify a PropertyMap within one group.

Field Summary

Modifier and TypeField and Description
private final String
private final short

Constructor Summary

AccessConstructor and Description
private
Key(String name, short type)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object obj)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

lookupNameback to summary
private final String lookupName
typeback to summary
private final short type

Constructor Detail

Keyback to summary
private Key(String name, short type)

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
io.github.spannm.jackcess.impl back to summary

pack-priv Interface PropertyMaps.Owner

Known Direct Implementers
io.github.spannm.jackcess.impl.TableImpl

Utility interface for the object which owns the PropertyMaps

Method Summary

Modifier and TypeMethod and Description
public void
propertiesUpdated()

Invoked when new properties are saved.

Method Detail

propertiesUpdatedback to summary
public void propertiesUpdated() throws IOException

Invoked when new properties are saved.