Class ServiceParameter
java.lang.Object
org.apache.sis.internal.simple.SimpleIdentifiedObject
org.apache.sis.internal.jaxb.metadata.replace.ServiceParameter
- All Implemented Interfaces:
Serializable,LenientComparable,org.opengis.parameter.GeneralParameterDescriptor,org.opengis.parameter.ParameterDescriptor,org.opengis.referencing.IdentifiedObject
Parameter information conform to the ISO 19115:2014 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 19115:2014 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
ServiceParameter instances in Apache SIS internal code if all methods creating such instances
declare ParameterDescriptor<?> as their return type.- Since:
- 0.5
- Version:
- 1.3
- Author:
- Rémi Maréchal (Geomatys), Martin Desruisseaux (Geomatys)
- See Also:
-
Field Summary
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic ServiceParametercastOrCopy(org.opengis.parameter.ParameterDescriptor<?> parameter) Returns the given parameter as an instance ofServiceParameter.final org.opengis.parameter.ParameterValueCreates a new instance ofParameterValue.final booleanequals(Object object, ComparisonMode mode) Compares this object with the given one for equality.org.opengis.util.InternationalStringReturns a narrative explanation of the role of the parameter.intThe maximum number of times that values for this parameter group or parameter can be included.static org.opengis.util.MemberNamegetMemberName(org.opengis.parameter.ParameterDescriptor<?> parameter) Gets the parameter name as an instance ofMemberName.intThe minimum number of times that values for this parameter group or parameter are required.org.opengis.referencing.ReferenceIdentifiergetName()Returns the name as anIdentifier, which is the type requested by ISO 19111.javax.measure.UnitgetUnit()Optional properties.Class<?> Infers the value class from the attribute type.org.opengis.util.TypeNameReturns the name that describes the type of parameter values.Methods 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
-
Method Details
-
castOrCopy
Returns the given parameter as an instance ofServiceParameter.- Parameters:
parameter- the parameter (may benull).- Returns:
- the service parameter, or
nullif the given argument was null.
-
getMemberName
public static org.opengis.util.MemberName getMemberName(org.opengis.parameter.ParameterDescriptor<?> parameter) Gets the parameter name as an instance ofMemberName. This method performs the following checks:- If the
is an instance of
invalid reference
primary name
MemberName, returns that primary name. - Otherwise this method searches for the first
which is an instance of
invalid reference
alias
MemberName. If found, that alias is returned. - If no alias is found, then this method tries to build a member name from the primary name and the
(if available) or the value class.
invalid reference
value type
CC_OperationParameter) and the one defined by ISO 19115 (namelySV_Parameter).- Parameters:
parameter- the parameter from which to get the name (may benull).- Returns:
- the member name, or
nullif none.
- If the
-
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 19115, which isMemberName. This method is the converse ofgetMemberName(ParameterDescriptor).- Specified by:
getNamein interfaceorg.opengis.referencing.IdentifiedObject- Overrides:
getNamein classSimpleIdentifiedObject- Returns:
- the parameter name as an identifier (the type specified by ISO 19111).
-
getValueType
public org.opengis.util.TypeName getValueType()Returns the name that describes the type of parameter values.- Returns:
- the type name of value component(s) in this parameter.
-
getValueClass
Infers the value class from the attribute type. This method is the reason why we cannot parameterize thisServiceParameterclass (see Note about raw-type usage in class javadoc), because there is no way we can ensure that the class inferred fromMemberName.getAttributeType()is really for type<T>.- Specified by:
getValueClassin interfaceorg.opengis.parameter.ParameterDescriptor- Returns:
- the value class inferred from the attribute type, or
nullif unknown.
-
getDescription
public org.opengis.util.InternationalString getDescription()Returns a narrative explanation of the role of the parameter.- Returns:
- a narrative explanation of the role of the parameter, or
nullif none.
-
getMinimumOccurs
public int getMinimumOccurs()The minimum number of times that values for this parameter group or parameter are required.- Returns:
- the minimum occurrence.
-
getMaximumOccurs
public int getMaximumOccurs()The maximum number of times that values for this parameter group or parameter can be included.- Returns:
- the maximum occurrence.
-
createValue
public final org.opengis.parameter.ParameterValue createValue()Creates a new instance ofParameterValue. This method delegates the work toDefaultParameterDescriptorsince thisServiceParameterclass is not a full-featured parameter descriptor implementation.- Specified by:
createValuein interfaceorg.opengis.parameter.GeneralParameterDescriptor- Specified by:
createValuein interfaceorg.opengis.parameter.ParameterDescriptor<T>- Returns:
- a new instance of
ParameterValue.
-
getValidValues
Optional properties.- Specified by:
getValidValuesin interfaceorg.opengis.parameter.ParameterDescriptor<T>- Returns:
null.
-
getMinimumValue
- Specified by:
getMinimumValuein interfaceorg.opengis.parameter.ParameterDescriptor<T>
-
getMaximumValue
- Specified by:
getMaximumValuein interfaceorg.opengis.parameter.ParameterDescriptor<T>
-
getDefaultValue
- Specified by:
getDefaultValuein interfaceorg.opengis.parameter.ParameterDescriptor<T>
-
getUnit
public javax.measure.Unit getUnit()- Specified by:
getUnitin interfaceorg.opengis.parameter.ParameterDescriptor<T>
-
equals
Compares this object with the given one for equality. This implementation should be consistent withAbstractIdentifiedObject.equals(Object)implementation, with the simplification that someParameterproperty values are always null.- Specified by:
equalsin interfaceLenientComparable- Overrides:
equalsin classSimpleIdentifiedObject- Parameters:
object- the object to compare with this reference system.mode- the strictness level of the comparison.- Returns:
trueif both objects are equal.- See Also:
-