Class QualityParameter
java.lang.Object
org.apache.sis.internal.simple.SimpleIdentifiedObject
org.apache.sis.internal.jaxb.metadata.replace.Parameter
org.apache.sis.internal.jaxb.metadata.replace.QualityParameter
- All Implemented Interfaces:
Serializable,LenientComparable,org.opengis.parameter.GeneralParameterDescriptor,org.opengis.parameter.ParameterDescriptor,org.opengis.referencing.IdentifiedObject
Parameter information conform to the ISO 19157:2013 specification.
GeoAPI tries to provides a single API for the parameter classes defined in various specifications
(ISO 19111, ISO 19115, ISO 19157, Web Processing Service).
But we still need separated representations at XML (un)marshalling time.
This class is for the ISO 19157:2013 case.
Note that this implementation is simple and serves no other purpose than being a container for XML
parsing and formatting. For real parameter framework, consider using org.apache.sis.parameter
package instead.
Note about raw-type usage
We use raw type (i.e. we implementParameterDescriptor instead of ParameterDescriptor<T>)
because there is no way we can know <T> for sure at unmarshalling time. This is not a recommended
practice, so this class shall not be in public API. However, it should be okay to create
QualityParameter instances in Apache SIS internal code if all methods creating such instances
declare ParameterDescriptor<?> as their return type.- Since:
- 1.3
- Version:
- 1.3
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) StringName of the data quality parameter, to be represented as identifier code.(package private) org.opengis.util.InternationalStringDefinition of the data quality parameter.(package private) DefaultMeasureDescriptionDescription of the data quality parameter.(package private) org.opengis.util.TypeNameValue type of the data quality parameter (shall be one of the data types defined in ISO/TS 19103:2005).Fields inherited from class org.apache.sis.internal.simple.SimpleIdentifiedObject
nameFields inherited from interface org.opengis.referencing.IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY -
Constructor Summary
ConstructorsModifierConstructorDescription(package private)Creates an initially empty parameter.privateQualityParameter(org.opengis.parameter.ParameterDescriptor<?> parameter) Creates a parameter initialized to the values of the given one. -
Method Summary
Modifier and TypeMethodDescriptionstatic QualityParametercastOrCopy(org.opengis.parameter.ParameterDescriptor<?> parameter) Returns the given parameter as an instance ofQualityParameter.intintorg.opengis.referencing.ReferenceIdentifiergetName()Returns the name as anIdentifier, which is the type requested by ISO 19111.Class<?>Infers the value class from the type name.org.opengis.util.TypeNameReturns the name that describes the type of parameter values.static org.opengis.util.TypeNamegetValueType(Class<?> valueClass) Suggests a type name for the components of given collection or array class.Methods inherited from class org.apache.sis.internal.jaxb.metadata.replace.Parameter
createValue, equals, getDefaultValue, getMaximumValue, getMinimumValue, getUnit, getValidValuesMethods inherited from class org.apache.sis.internal.simple.SimpleIdentifiedObject
equals, getAlias, getDomainOfValidity, getIdentifiers, getRemarks, getScope, hashCode, toString, toWKTMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opengis.referencing.IdentifiedObject
getAlias, getIdentifiers, getRemarks, toWKT
-
Field Details
-
code
String codeName of the data quality parameter, to be represented as identifier code.- See Also:
-
definition
org.opengis.util.InternationalString definitionDefinition of the data quality parameter. Stored inIdentifier#getDescription().- See Also:
-
description
DefaultMeasureDescription descriptionDescription of the data quality parameter.- See Also:
-
#getDescription()
-
valueType
org.opengis.util.TypeName valueTypeValue type of the data quality parameter (shall be one of the data types defined in ISO/TS 19103:2005).- See Also:
-
-
Constructor Details
-
QualityParameter
QualityParameter()Creates an initially empty parameter. This constructor is needed by JAXB at unmarshalling time.Consider this constructor as private except for testing purpose. See Note about raw-type usage in class javadoc.
-
QualityParameter
private QualityParameter(org.opengis.parameter.ParameterDescriptor<?> parameter) Creates a parameter initialized to the values of the given one. This is used for marshalling an arbitrary parameter as an ISO 19157 parameter.
-
-
Method Details
-
castOrCopy
Returns the given parameter as an instance ofQualityParameter.- Parameters:
parameter- the parameter (may benull).- Returns:
- the service parameter, or
nullif the given argument was null.
-
getMinimumOccurs
public int getMinimumOccurs() -
getMaximumOccurs
public int getMaximumOccurs() -
getName
public org.opengis.referencing.ReferenceIdentifier getName()Returns the name as anIdentifier, which is the type requested by ISO 19111. Note that this is different than the type requested by ISO 19157, which isString.- Specified by:
getNamein interfaceorg.opengis.referencing.IdentifiedObject- Overrides:
getNamein classSimpleIdentifiedObject- Returns:
- the parameter name as an identifier (the type specified by ISO 19111).
-
getValueClass
Infers the value class from the type name. This method is the reason why we cannot parameterize thisQualityParameterclass (see Note about raw-type usage in class javadoc), because there is no way we can ensure that the class inferred fromvalueTypeis really for type<T>.- Specified by:
getValueClassin interfaceorg.opengis.parameter.ParameterDescriptor- Overrides:
getValueClassin classParameter- Returns:
- the value class inferred from the attribute type, or
nullif unknown.
-
getValueType
public org.opengis.util.TypeName getValueType()Returns the name that describes the type of parameter values.- Overrides:
getValueTypein classParameter- Returns:
- the type name of value component(s) in this parameter.
-
getValueType
Suggests a type name for the components of given collection or array class. The component type is fetched on a best effort basis only. This method does the following checks:- If the given class is a class, then its component type is used.
- Otherwise if the class is an
Iterable, then the upper bound of elements is fetched. - Otherwise if the class is a
Map, then the upper bound of keys is fetched. - Otherwise if the class is a
MatrixorCoverage, thenDoublecomponents is assumed. - Otherwise the given class is used as if it was already a component type (i.e. a singleton item).
- Parameters:
valueClass- the type of values for which to infer aTypeNameinstance.- Returns:
- a type name for components of the given type.
-