Package org.apache.sis.metadata.sql
Class LookupInfo
java.lang.Object
org.apache.sis.metadata.sql.LookupInfo
Information about the last used metadata type. Those information are cached on the assumption
that the same maps will be used more than once before to move to another metadata object.
Each thread shall have its own LastUsedInfo
instance.
Consequently, there is no need for synchronization in this class.
- Since:
- 0.8
- Version:
- 0.8
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ObjectConverter
<?, ?> The last converter used.The last used "method name to property indices" map returned byasIndexMap(MetadataStandard)
.The last "method name to column name" map returned byasNameMap(MetadataStandard)
.private Class
<?> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasIndexMap
(MetadataStandard standard) Maps method names to property indices for the current metadata type.asNameMap
(MetadataStandard standard) Maps method names to the name of columns in the database table corresponding to the current metadata type.(package private) final Object
Converts the specified non-metadata value into an object of the expected type.(package private) final Class
<?> Returns the type of metadata objects for whichasNameMap(MetadataStandard)
orasIndexMap(MetadataStandard)
will return "name to name" or "name to index" mappings.(package private) final void
setMetadataType
(Class<?> t) Sets the type of metadata objects for whichasNameMap(MetadataStandard)
orasIndexMap(MetadataStandard)
will return "name to name" or "name to index" mappings.
-
Field Details
-
type
-
names
The last "method name to column name" map returned byasNameMap(MetadataStandard)
. Cached on assumption that the same map will be used more than once before to move to another metadata object. -
indices
The last used "method name to property indices" map returned byasIndexMap(MetadataStandard)
. Cached on assumption that the same map will be used more than once before to move to another metadata object. -
converter
The last converter used. This field exists only for performance purposes, on the assumption that the last used converter has good chances to be used again.
-
-
Constructor Details
-
LookupInfo
LookupInfo()Creates a new cache.
-
-
Method Details
-
getMetadataType
Returns the type of metadata objects for whichasNameMap(MetadataStandard)
orasIndexMap(MetadataStandard)
will return "name to name" or "name to index" mappings. -
setMetadataType
Sets the type of metadata objects for whichasNameMap(MetadataStandard)
orasIndexMap(MetadataStandard)
will return "name to name" or "name to index" mappings.- Parameters:
t
- the type of metadata object for which to get column names or property indices.
-
asNameMap
Maps method names to the name of columns in the database table corresponding to the current metadata type. The values in the returned map must be the same than the keys in the map returned byMetadataSource.asValueMap(Object)
.- Throws:
ClassCastException
- if the metadata object type does not extend a metadata interface of the expected package.
-
asIndexMap
Maps method names to property indices for the current metadata type.- Returns:
- a map from method names to property indices.
- Throws:
ClassCastException
- if the metadata object type does not extend a metadata interface of the expected package.
-
convert
Converts the specified non-metadata value into an object of the expected type. The expected value is an instance of a class outside the metadata package, for exampleString
,InternationalString
,URI
, etc.- Throws:
UnconvertibleObjectException
- if the value cannot be converter.
-