Class AbstractParameterDescriptor
- All Implemented Interfaces:
Serializable
,Formattable
,Deprecable
,LenientComparable
,org.opengis.parameter.GeneralParameterDescriptor
,org.opengis.referencing.IdentifiedObject
- Direct Known Subclasses:
DefaultParameterDescriptor
,DefaultParameterDescriptorGroup
,TensorValues
Getter method | ISO 19111 | WPS | ISO 19115 | Remarks |
---|---|---|---|---|
getName() |
name |
Identifier |
name |
See Parameters.getMemberName(ParameterDescriptor) for MemberName ↔ Identifier mapping. |
AbstractIdentifiedObject.getDescription() |
Abstract |
description |
Also known as “definition”. | |
getDirection() |
direction |
Tells if the parameter is a WPS Input or Output structure. |
||
getMinimumOccurs() |
minimumOccurs |
MinOccurs |
optionality |
optionality = (minimumOccurs > 0) |
getMaximumOccurs() |
maximumOccurs |
MaxOccurs |
repeatability |
repeatability = (maximumOccurs > 1) |
- Since:
- 0.5
- Version:
- 0.6
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate short
The maximum number of times that values for this parameter group are required, as an unsigned short.private short
The minimum number of times that values for this parameter group are required, as an unsigned short.private static final long
Serial number for inter-operability with different versions.Fields inherited from class org.apache.sis.referencing.AbstractIdentifiedObject
DEPRECATED_KEY, LOCALE_KEY
Fields inherited from interface org.opengis.referencing.IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
-
Constructor Summary
ConstructorsModifierConstructorDescription(package private)
Constructs a new object in which every attributes are set to a null value.protected
AbstractParameterDescriptor
(Map<String, ?> properties, int minimumOccurs, int maximumOccurs) Constructs a parameter descriptor from a set of properties.protected
AbstractParameterDescriptor
(org.opengis.parameter.GeneralParameterDescriptor descriptor) Constructs a new parameter descriptor with the same values than the specified one. -
Method Summary
Modifier and TypeMethodDescriptionprivate static short
crop
(int n) Crops the given integer in the [0 … 0xFFFF] range.boolean
equals
(Object object, ComparisonMode mode) Compares the specified object with this parameter for equality.protected String
Formats this descriptor as a pseudo-Well Known Text element.Class
<? extends org.opengis.parameter.GeneralParameterDescriptor> Returns the GeoAPI interface implemented by this class.int
The maximum number of times that values for this parameter group or parameter can be included.int
The minimum number of times that values for this parameter group or parameter are required.private Integer
Invoked by JAXB for marshalling themaximumOccurs
value.private Integer
Invoked by JAXB for marshalling theminimumOccurs
value.void
print()
Prints a string representation of this descriptor to the standard output stream.private void
Invoked by JAXB for unmarshalling themaximumOccurs
value.private void
Invoked by JAXB for unmarshalling theminimumOccurs
value.toString()
Returns a string representation of this descriptor.Methods inherited from class org.apache.sis.referencing.AbstractIdentifiedObject
castOrCopy, computeHashCode, equals, formatTo, getAlias, getDescription, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForName
Methods inherited from class org.apache.sis.io.wkt.FormattableObject
toString, toWKT
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opengis.parameter.GeneralParameterDescriptor
createValue
Methods inherited from interface org.opengis.referencing.IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial number for inter-operability with different versions.- See Also:
-
minimumOccurs
private short minimumOccursThe minimum number of times that values for this parameter group are required, as an unsigned short. We use a short because this value is usually either 0 or 1, or a very small number like 2 or 3. A large number would be a bad idea with this parameter implementation.Consider this field as final! This field is modified only at unmarshalling time by
setNonDefaultMinimumOccurs(Integer)
-
maximumOccurs
private short maximumOccursThe maximum number of times that values for this parameter group are required, as an unsigned short. Value0xFFFF
(or -1) means an unrestricted number of occurrences.We use a short because this value is usually 1 or a very small number like 2 or 3. It also serves as a safety since a large number would be a bad idea with this parameter implementation.
Consider this field as final! This field is modified only at unmarshalling time by
setNonDefaultMaximumOccurs(Integer)
-
-
Constructor Details
-
AbstractParameterDescriptor
protected AbstractParameterDescriptor(Map<String, ?> properties, int minimumOccurs, int maximumOccurs) Constructs a parameter descriptor from a set of properties. The properties map is given unchanged to the super-class constructor. The following table is a reminder of main (not all) properties:Recognized properties (non exhaustive list) Property name Value type Returned by "name" ReferenceIdentifier
orString
AbstractIdentifiedObject.getName()
"alias" GenericName
orCharSequence
(optionally as array)AbstractIdentifiedObject.getAlias()
"identifiers" ReferenceIdentifier
(optionally as array)AbstractIdentifiedObject.getIdentifiers()
"remarks" InternationalString
orString
AbstractIdentifiedObject.getRemarks()
- Parameters:
properties
- the properties to be given to the identified object.minimumOccurs
- the minimum number of times that values for this parameter group are required, or 0 if no restriction.maximumOccurs
- the maximum number of times that values for this parameter group are required, orInteger.MAX_VALUE
if no restriction.
-
AbstractParameterDescriptor
protected AbstractParameterDescriptor(org.opengis.parameter.GeneralParameterDescriptor descriptor) Constructs a new parameter descriptor with the same values than the specified one. This copy constructor provides a way to convert an arbitrary implementation into a SIS one or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API.This constructor performs a shallow copy, i.e. the properties are not cloned.
- Parameters:
descriptor
- the object to shallow copy.
-
AbstractParameterDescriptor
AbstractParameterDescriptor()Constructs a new object in which every attributes are set to a null value. This is not a valid object. This constructor is strictly reserved to JAXB, which will assign values to the fields using reflection.
-
-
Method Details
-
crop
private static short crop(int n) Crops the given integer in the [0 … 0xFFFF] range. -
getInterface
Returns the GeoAPI interface implemented by this class. The default implementation returnsGeneralParameterDescriptor.class
. Subclasses implementing a more specific GeoAPI interface shall override this method.- Overrides:
getInterface
in classAbstractIdentifiedObject
- Returns:
- the parameter descriptor interface implemented by this class.
-
getMinimumOccurs
public int getMinimumOccurs()The minimum number of times that values for this parameter group or parameter are required. A value of 0 means an optional parameter.- Specified by:
getMinimumOccurs
in interfaceorg.opengis.parameter.GeneralParameterDescriptor
- Returns:
- the minimum occurrence.
-
getMaximumOccurs
public int getMaximumOccurs()The maximum number of times that values for this parameter group or parameter can be included. A value greater than 1 means a repeatable parameter.- Specified by:
getMaximumOccurs
in interfaceorg.opengis.parameter.GeneralParameterDescriptor
- Returns:
- the maximum occurrence.
-
equals
Compares the specified object with this parameter for equality.- Specified by:
equals
in interfaceLenientComparable
- Overrides:
equals
in classAbstractIdentifiedObject
- Parameters:
object
- the object to compare tothis
.mode
- the strictness level of the comparison.- Returns:
true
if both objects are equal according the given comparison mode.- See Also:
-
toString
Returns a string representation of this descriptor.This method is for information purpose only and may change in future SIS version.
- Overrides:
toString
in classFormattableObject
- Returns:
- the Well Known Text (WKT) or an alternative representation of this object.
-
print
Prints a string representation of this descriptor to the standard output stream. If a console is attached to the running JVM (i.e. if the application is run from the command-line and the output is not redirected to a file) and if Apache SIS thinks that the console supports the ANSI escape codes (a.k.a. X3.64), then a syntax coloring will be applied.This is a convenience method for debugging purpose and for console applications.
- Overrides:
print
in classFormattableObject
-
formatTo
Formats this descriptor as a pseudo-Well Known Text element. The WKT specification does not define any representation of parameter descriptors. Apache SIS fallbacks on a list of descriptors. The text formatted by this method is flagged as invalid WKT.- Overrides:
formatTo
in classAbstractIdentifiedObject
- Parameters:
formatter
- the formatter where to format the inner content of this WKT element.- Returns:
"Parameter"
or"ParameterGroup"
.- See Also:
-
getNonDefaultMinimumOccurs
Invoked by JAXB for marshalling theminimumOccurs
value. Omit marshalling of thisgml:minimumOccurs
element if its value is equal to the default value, which is 1. -
getNonDefaultMaximumOccurs
Invoked by JAXB for marshalling themaximumOccurs
value. Omit marshalling of thisgml:maximumOccurs
element if its value is equal to the default value, which is 1.This property should not be marshalled in
DefaultParameterDescriptor
objects (the GML schema does not allow that). It should be marshalled only forDefaultParameterDescriptorGroup
objects. Since SIS marshalsminimumOccurs
andmaximumOccurs
properties only when their value is different than 1, and sinceParameterDescriptor
should not have amaximumOccurs
value different than 1 when ISO 19111 compliance is desired, the GML document should be valid in most cases. -
setNonDefaultMinimumOccurs
Invoked by JAXB for unmarshalling theminimumOccurs
value. -
setNonDefaultMaximumOccurs
Invoked by JAXB for unmarshalling themaximumOccurs
value.
-