/** * Returns a SIS metadata implementation with the values of the given arbitrary implementation. * This method performs the first applicable action in the following choices: * * <ul> * <li>If the given object is {@code null}, then this method returns {@code null}.</li> * <li>Otherwise if the given object is already an instance of * {@code DefaultUsage}, then it is returned unchanged.</li> * <li>Otherwise a new {@code DefaultUsage} instance is created using the * {@linkplain #DefaultUsage(Usage) copy constructor} * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other * metadata contained in the given object are not recursively copied.</li> * </ul> * * @param object the object to get as a SIS implementation, or {@code null} if none. * @return a SIS implementation containing the values of the given object (may be the * given object itself), or {@code null} if the argument was null. */ public static DefaultUsage castOrCopy(final Usage object) { if (object == null || object instanceof DefaultUsage) { return (DefaultUsage) object; } return new DefaultUsage(object); }
/** * Invoked by JAXB at marshalling time for getting the actual metadata to write * inside the {@code <gmd:MD_Usage>} XML element. * This is the value or a copy of the value given in argument to the {@code wrap} method. * * @return the metadata to be marshalled. */ @XmlElementRef public DefaultUsage getElement() { return DefaultUsage.castOrCopy(metadata); }
/** * Sets a brief description of the resource and/or resource series usage. * * @param newValue the new specific usage. */ public void setSpecificUsage(final InternationalString newValue) { checkWritePermission(); specificUsage = newValue; }
/** * Constructs a new instance initialized with the values from the specified metadata object. * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the * given object are not recursively copied. * * @param object the metadata to copy values from, or {@code null} if none. * * @see #castOrCopy(Usage) */ public DefaultUsage(final Usage object) { super(object); if (object != null) { specificUsage = object.getSpecificUsage(); usageDate = toMilliseconds(object.getUsageDate()); userDeterminedLimitations = object.getUserDeterminedLimitations(); userContactInfo = copyCollection(object.getUserContactInfo(), ResponsibleParty.class); if (object instanceof DefaultUsage) { final DefaultUsage c = (DefaultUsage) object; responses = copyCollection(c.getResponses(), InternationalString.class); additionalDocumentation = copyCollection(c.getAdditionalDocumentation(), Citation.class); identifiedIssues = copyCollection(c.getIdentifiedIssues(), Citation.class); } } }
/** * Returns identification of and means of communicating with person(s) and organization(s) using the resource(s). * * <div class="warning"><b>Upcoming API change — generalization</b><br> * As of ISO 19115:2014, {@code ResponsibleParty} is replaced by the {@code Responsibility} parent interface. * This change may be applied in GeoAPI 4.0. * </div> * * @return means of communicating with person(s) and organization(s) using the resource(s). */ @Override @XmlElement(name = "userContactInfo", required = true) public Collection<ResponsibleParty> getUserContactInfo() { return userContactInfo = nonNullCollection(userContactInfo, ResponsibleParty.class); }
/** * Sets a new response to the user-determined limitations. * * @param newValues the new response to the user-determined limitations. * * @since 0.5 */ public void setResponses(final Collection<? extends InternationalString> newValues) { responses = writeCollection(newValues, responses, InternationalString.class); }
/** * Creates an usage initialized to the specified values. * * @param specificUsage brief description of the resource and/or resource series usage, or {@code null} if none. * @param userContactInfo means of communicating with person(s) and organization(s), or {@code null} if none. */ public DefaultUsage(final CharSequence specificUsage, final ResponsibleParty userContactInfo) { this.specificUsage = Types.toInternationalString(specificUsage); this.userContactInfo = singleton(userContactInfo, ResponsibleParty.class); }
/** * Invoked by JAXB at both marshalling and unmarshalling time. * This attribute has been added by ISO 19115:2014 standard. * If (and only if) marshalling an older standard version, we omit this attribute. */ @XmlElement(name = "response") private Collection<InternationalString> getResponse() { return FilterByVersion.CURRENT_METADATA.accept() ? getResponses() : null; }
@XmlElement(name = "identifiedIssues") private Collection<Citation> getIssues() { return FilterByVersion.CURRENT_METADATA.accept() ? getIdentifiedIssues() : null; } }
@XmlElement(name = "additionalDocumentation") private Collection<Citation> getAdditionalDocumentations() { return FilterByVersion.CURRENT_METADATA.accept() ? getAdditionalDocumentation() : null; }
/** * Constructs a new instance initialized with the values from the specified metadata object. * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the * given object are not recursively copied. * * @param object the metadata to copy values from, or {@code null} if none. * * @see #castOrCopy(Usage) */ public DefaultUsage(final Usage object) { super(object); if (object != null) { specificUsage = object.getSpecificUsage(); usageDate = toMilliseconds(object.getUsageDate()); userDeterminedLimitations = object.getUserDeterminedLimitations(); userContactInfo = copyCollection(object.getUserContactInfo(), ResponsibleParty.class); if (object instanceof DefaultUsage) { final DefaultUsage c = (DefaultUsage) object; responses = copyCollection(c.getResponses(), InternationalString.class); additionalDocumentation = copyCollection(c.getAdditionalDocumentation(), Citation.class); identifiedIssues = copyCollection(c.getIdentifiedIssues(), Citation.class); } } }
/** * Returns identification of and means of communicating with person(s) and organization(s) using the resource(s). * * <div class="warning"><b>Upcoming API change — generalization</b><br> * As of ISO 19115:2014, {@code ResponsibleParty} is replaced by the {@code Responsibility} parent interface. * This change may be applied in GeoAPI 4.0. * </div> * * @return means of communicating with person(s) and organization(s) using the resource(s). */ @Override @XmlElement(name = "userContactInfo") public Collection<ResponsibleParty> getUserContactInfo() { return userContactInfo = nonNullCollection(userContactInfo, ResponsibleParty.class); }
/** * Sets a new citation of a description of known issues associated with the resource * along with proposed solutions if available. * * @param newValues the new citation of a description. * * @since 0.5 */ public void setIdentifiedIssues(final Collection<? extends Citation> newValues) { identifiedIssues = writeCollection(newValues, identifiedIssues, Citation.class); } }
/** * Creates an usage initialized to the specified values. * * @param specificUsage brief description of the resource and/or resource series usage, or {@code null} if none. * @param userContactInfo means of communicating with person(s) and organization(s), or {@code null} if none. */ public DefaultUsage(final CharSequence specificUsage, final ResponsibleParty userContactInfo) { this.specificUsage = Types.toInternationalString(specificUsage); this.userContactInfo = singleton(userContactInfo, ResponsibleParty.class); }
/** * Publications that describe usage of data. * * @return publications that describe usage of data. * * @since 0.5 */ /// @XmlElement(name = "additionalDocumentation") @UML(identifier="additionalDocumentation", obligation=OPTIONAL, specification=ISO_19115) public Collection<Citation> getAdditionalDocumentation() { return additionalDocumentation = nonNullCollection(additionalDocumentation, Citation.class); }
/** * Sets the publications that describe usage of data. * * @param newValues the new publications. * * @since 0.5 */ public void setAdditionalDocumentation(final Collection<? extends Citation> newValues) { additionalDocumentation = writeCollection(newValues, additionalDocumentation, Citation.class); }
/** * Sets applications, determined by the user for which the resource and/or resource series is not suitable. * * @param newValue the new user determined limitations. */ public void setUserDeterminedLimitations(final InternationalString newValue) { checkWritePermission(); this.userDeterminedLimitations = newValue; }
/** * Invoked by JAXB at marshalling time for getting the actual metadata to write * inside the {@code <mri:MD_Usage>} XML element. * This is the value or a copy of the value given in argument to the {@code wrap} method. * * @return the metadata to be marshalled. */ @XmlElementRef public DefaultUsage getElement() { return DefaultUsage.castOrCopy(metadata); }
/** * Returns a SIS metadata implementation with the values of the given arbitrary implementation. * This method performs the first applicable action in the following choices: * * <ul> * <li>If the given object is {@code null}, then this method returns {@code null}.</li> * <li>Otherwise if the given object is already an instance of * {@code DefaultUsage}, then it is returned unchanged.</li> * <li>Otherwise a new {@code DefaultUsage} instance is created using the * {@linkplain #DefaultUsage(Usage) copy constructor} * and returned. Note that this is a <cite>shallow</cite> copy operation, since the other * metadata contained in the given object are not recursively copied.</li> * </ul> * * @param object the object to get as a SIS implementation, or {@code null} if none. * @return a SIS implementation containing the values of the given object (may be the * given object itself), or {@code null} if the argument was null. */ public static DefaultUsage castOrCopy(final Usage object) { if (object == null || object instanceof DefaultUsage) { return (DefaultUsage) object; } return new DefaultUsage(object); }
/** * Responses to the user-determined limitations. * * @return response to the user-determined limitations. * * @since 0.5 */ /// @XmlElement(name = "response") @UML(identifier="response", obligation=OPTIONAL, specification=ISO_19115) public Collection<? extends InternationalString> getResponses() { return responses = nonNullCollection(responses, InternationalString.class); }