/** * Gets the parameter name as an instance of {@code MemberName}. * This method performs the following checks: * * <ul> * <li>If the {@linkplain DefaultParameterDescriptor#getName() primary name} is an instance of {@code MemberName}, * returns that primary name.</li> * <li>Otherwise this method searches for the first {@linkplain DefaultParameterDescriptor#getAlias() alias} * which is an instance of {@code MemberName}. If found, that alias is returned.</li> * <li>If no alias is found, then this method tries to build a member name from the primary name and the * {@linkplain DefaultParameterDescriptor#getValueClass() value class}, using the mapping defined in * {@link org.apache.sis.util.iso.DefaultTypeName} javadoc.</li> * </ul> * * This method can be used as a bridge between the parameter object * defined by ISO 19111 (namely {@code CC_OperationParameter}) and the one * defined by ISO 19115 (namely {@code SV_Parameter}). * * @param parameter the parameter from which to get the name (may be {@code null}). * @return the member name, or {@code null} if none. * * @see org.apache.sis.util.iso.Names#createMemberName(CharSequence, String, CharSequence, Class) * * @since 0.5 */ public static MemberName getMemberName(final ParameterDescriptor<?> parameter) { return ServiceParameter.getMemberName(parameter); }
/** * Gets the parameter name as an instance of {@code MemberName}. * This method performs the following checks: * * <ul> * <li>If the {@linkplain DefaultParameterDescriptor#getName() primary name} is an instance of {@code MemberName}, * returns that primary name.</li> * <li>Otherwise this method searches for the first {@linkplain DefaultParameterDescriptor#getAlias() alias} * which is an instance of {@code MemberName}. If found, that alias is returned.</li> * <li>If no alias is found, then this method tries to build a member name from the primary name and the * {@linkplain DefaultParameterDescriptor#getValueClass() value class}, using the mapping defined in * {@link org.apache.sis.util.iso.DefaultTypeName} javadoc.</li> * </ul> * * This method can be used as a bridge between the parameter object * defined by ISO 19111 (namely {@code CC_OperationParameter}) and the one * defined by ISO 19115 (namely {@code SV_Parameter}). * * @param parameter the parameter from which to get the name (may be {@code null}). * @return the member name, or {@code null} if none. * * @see org.apache.sis.util.iso.Names#createMemberName(CharSequence, String, CharSequence, Class) * * @since 0.5 */ public static MemberName getMemberName(final ParameterDescriptor<?> parameter) { return ServiceParameter.getMemberName(parameter); }
/** * Creates a parameter initialized to the values of the given one. */ private ServiceParameter(final ParameterDescriptor<?> parameter) { super(parameter); memberName = getMemberName(parameter); optionality = parameter.getMinimumOccurs() > 0; repeatability = parameter.getMaximumOccurs() > 1; }
/** * Creates a parameter initialized to the values of the given one. */ private ServiceParameter(final ParameterDescriptor<?> parameter) { super(parameter); memberName = getMemberName(parameter); optionality = parameter.getMinimumOccurs() > 0; repeatability = parameter.getMaximumOccurs() > 1; }