Tabnine Logo
DefaultResponsibleParty
Code IndexAdd Tabnine to your IDE (free)

How to use
DefaultResponsibleParty
in
org.apache.sis.metadata.iso.citation

Best Java code snippets using org.apache.sis.metadata.iso.citation.DefaultResponsibleParty (Showing top 20 results out of 315)

origin: apache/sis

/**
 * Creates the responsibility object if it does not already exists, then returns it.
 *
 * @return the responsibility party (never {@code null}).
 */
private DefaultResponsibleParty responsibility() {
  if (responsibility == null) {
    responsibility = new DefaultResponsibleParty();
  }
  return responsibility;
}
origin: apache/sis

/**
 * set the role or position of the responsible person Only one of
 * {@link #getIndividualName() individualName}, {@link #getOrganisationName() organisationName}
 * and {@code positionName} shall be provided.
 *
 * <p>This implementation sets the position name of the first {@code Individual} found in the collection of
 * {@linkplain #getParties() parties}, or create a new individual if no existing instance was found.</p>
 *
 * @param  newValue  the new position name, or {@code null} if none.
 *
 * @deprecated As of ISO 19115:2014, replaced by {@link DefaultIndividual#setPositionName(InternationalString)}.
 */
@Deprecated
public void setPositionName(final InternationalString newValue) {
  if (!setName(DefaultIndividual.class, true, newValue)) {
    getParties().add(new DefaultIndividual(null, newValue, null));
  }
}
origin: org.apache.sis.core/sis-metadata

/**
 * 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(ResponsibleParty)
 */
public DefaultResponsibleParty(final ResponsibleParty object) {
  super(object);
  if (object != null && !(object instanceof DefaultResponsibility)) {
    setIndividualName(object.getIndividualName());
    setOrganisationName(object.getOrganisationName());
  }
}
origin: org.apache.sis.core/sis-metadata

/**
 * Returns the name or the position of the first individual. If no individual is found in the list of parties,
 * then this method will search in the list of organization members. The later structure is used by our netCDF
 * reader.
 *
 * @param  position {@code true} for returning the position name instead than individual name.
 * @return the name or position of the first individual, or {@code null}.
 *
 * @see #getIndividualName()
 * @see #getPositionName()
 */
private InternationalString getIndividual(final boolean position) {
  final Collection<AbstractParty> parties = getParties();
  InternationalString name = getName(parties, DefaultIndividual.class, position);
  if (name == null && parties != null) {
    for (final AbstractParty party : parties) {
      if (party instanceof DefaultOrganisation) {
        name = getName(((DefaultOrganisation) party).getIndividual(), DefaultIndividual.class, position);
        if (name != null) {
          break;
        }
      }
    }
  }
  return name;
}
origin: apache/sis

final DefaultResponsibleParty r = new DefaultResponsibleParty(Role.OWNER);
r.setParties(Collections.singleton(party));
c.setCitedResponsibleParties(Collections.singleton(r));
origin: apache/sis

/**
 * Creates a citation with an arbitrary title, presentation form and other properties.
 *
 * @return an arbitrary citation.
 *
 * @since 0.7
 */
public static DefaultCitation create() {
  final DefaultCitation citation = new DefaultCitation();
  final DefaultInternationalString title = new DefaultInternationalString();
  title.add(Locale.JAPANESE, "アンダーカレント");
  title.add(Locale.ENGLISH,  "Undercurrent");
  citation.setTitle(title);
  citation.setISBN("9782505004509");
  citation.setPresentationForms(Arrays.asList(
      PresentationForm.DOCUMENT_HARDCOPY,
      PresentationForm.DOCUMENT_DIGITAL));
  citation.setAlternateTitles(Collections.singleton(
      new SimpleInternationalString("Andākarento")));   // Actually a different script of the Japanese title.
  final DefaultResponsibleParty author = new DefaultResponsibleParty(Role.AUTHOR);
  author.setParties(Collections.singleton(new DefaultIndividual("Testsuya Toyoda", null, null)));
  final DefaultResponsibleParty editor = new DefaultResponsibleParty(Role.valueOf("EDITOR"));
  editor.setParties(Collections.singleton(new DefaultOrganisation("Kōdansha", null, null, null)));
  editor.setExtents(Collections.singleton(Extents.WORLD));
  citation.setCitedResponsibleParties(Arrays.asList(author, editor));
  return citation;
}
origin: Geomatys/geotoolkit

DefaultResponsibleParty producer = new DefaultResponsibleParty();
producer.setIndividualName("John Q.Public");
producer.setOrganisationName(new SimpleInternationalString("US National Geospatial-Intelligence Agency (NGA)"));
DefaultContact contact = new DefaultContact();
DefaultTelephone phone = new DefaultTelephone();
address.setElectronicMailAddresses(ema);
contact.setAddress(address);
producer.setContactInfo(contact);
producer.setRole(Role.POINT_OF_CONTACT);
source.setEdition(new SimpleInternationalString("Fifth"));
List<ResponsibleParty> rps = new ArrayList<>();
DefaultResponsibleParty rp = new DefaultResponsibleParty();
rp.setOrganisationName(new SimpleInternationalString("International Hydrographic Bureau"));
rp.setRole(Role.PUBLISHER);
rps.add(rp);
source.setCitedResponsibleParties(rps);
origin: apache/sis

final DefaultResponsibleParty author = new DefaultResponsibleParty(Role.AUTHOR);
final Anchor country = new Anchor(URI.create("SDN:C320:2:FR"), "France"); // Non-public SIS class.
  address.setElectronicMailAddresses(singleton("xx@xx.fr"));
  contact.setAddresses(singleton(address));
  author.setParties(singleton(new DefaultOrganisation("Marine institutes", null, null, contact)));
  metadata.setContacts(singleton(author));
    final DefaultResponsibleParty originator = new DefaultResponsibleParty(Role.ORIGINATOR);
    final DefaultOnlineResource online = new DefaultOnlineResource(URI.create("http://www.com.univ-mrs.fr/LOB/"));
    online.setProtocol("http");
    address.setCountry(country);
    contact.setAddresses(singleton(address));
    originator.setParties(singleton(new DefaultOrganisation("Oceanology laboratory", null, null, contact)));
    citation.setCitedResponsibleParties(singleton(originator));
    final DefaultResponsibleParty custodian = new DefaultResponsibleParty((DefaultResponsibility) author);
    custodian.setRole(Role.CUSTODIAN);
    identification.setPointOfContacts(singleton(custodian));
  final DefaultResponsibleParty distributor = new DefaultResponsibleParty((DefaultResponsibility) author);
  final DefaultDistribution distributionInfo = new DefaultDistribution();
  distributor.setRole(Role.DISTRIBUTOR);
  distributionInfo.setDistributors(singleton(new DefaultDistributor(distributor)));
origin: apache/sis

/**
 * Tests hash code computation of an object containing another metadata object.
 */
@Test
@DependsOnMethod("testSimple")
public void testNested() {
  final InternationalString   title    = new SimpleInternationalString("Some title");
  final InternationalString   person   = new SimpleInternationalString("Illustre inconnu");
  final DefaultIndividual     party    = new DefaultIndividual(person, null, null);
  final DefaultResponsibleParty resp   = new DefaultResponsibleParty(Role.AUTHOR);
  final DefaultCitation       instance = new DefaultCitation(title);
  resp.getParties().add(party);
  instance.getCitedResponsibleParties().add(resp);
  /*
   * Individual hash code is the sum of all its properties, none of them being a collection.
   */
  int expected = DefaultIndividual.class.hashCode() + person.hashCode();
  assertEquals("Individual", Integer.valueOf(expected), hash(party));
  /*
   * The +31 below come from java.util.List contract, since above Individual is a list member.
   */
  expected += ResponsibleParty.class.hashCode() + Role.AUTHOR.hashCode() + 31;
  assertEquals("Responsibility", Integer.valueOf(expected), hash(resp));
  /*
   * The +31 below come from java.util.List contract, since above Responsibility is a list member.
   */
  expected += Citation.class.hashCode() + title.hashCode() + 31;
  assertEquals("Citation", Integer.valueOf(expected), hash(instance));
}
origin: org.apache.sis.core/sis-metadata

/**
 * Sets the address of the responsible party.
 *
 * <p>This implementation sets the contact info in the first party found in the collection of
 * {@linkplain #getParties() parties}.</p>
 *
 * @param  newValue  the new contact info, or {@code null} if none.
 *
 * @deprecated As of ISO 19115:2014, replaced by {@link AbstractParty#setContactInfo(Collection)}.
 */
@Deprecated
public void setContactInfo(final Contact newValue) {
  checkWritePermission();
  final Iterator<AbstractParty> it = getParties().iterator();
  while (it.hasNext()) {
    final AbstractParty party = it.next();
    party.setContactInfo(newValue != null ? Collections.singleton(newValue) : null);
    if (party.isEmpty()) {
      it.remove();
    }
    return;
  }
  /*
   * If no existing AbstractParty were found, add a new one. However there is no way to know if
   * it should be an individual or an organization. Arbitrarily choose an individual for now.
   */
  if (newValue != null) {
    getParties().add(new DefaultIndividual(null, null, newValue));
  }
}
origin: apache/sis

/**
 * Returns the address of the responsible party.
 *
 * <p>This implementation returns the first non-null contact found in the collection of
 * {@linkplain #getParties() parties}.</p>
 *
 * @return address of the responsible party, or {@code null}.
 *
 * @deprecated As of ISO 19115:2014, replaced by {@link AbstractParty#getContactInfo()}.
 */
@Override
@Deprecated
@XmlElement(name = "contactInfo")
@Dependencies("getParties")
public Contact getContactInfo() {
  final Collection<AbstractParty> parties = getParties();
  if (parties != null) {                                          // May be null on marshalling.
    for (final AbstractParty party : parties) {
      final Collection<? extends Contact> contacts = party.getContactInfo();
      if (contacts != null) {                                 // May be null on marshalling.
        for (final Contact contact : contacts) {
          if (contact != null) {                          // Paranoiac check.
            return contact;
          }
        }
      }
    }
  }
  return null;
}
origin: org.apache.sis.storage/sis-storage

final DefaultResponsibleParty r = new DefaultResponsibleParty(Role.OWNER);
r.setParties(Collections.singleton(party));
c.setCitedResponsibleParties(Collections.singleton(r));
origin: apache/sis

/**
 * Returns the name or the position of the first individual. If no individual is found in the list of parties,
 * then this method will search in the list of organization members. The later structure is used by our netCDF
 * reader.
 *
 * @param  position {@code true} for returning the position name instead than individual name.
 * @return the name or position of the first individual, or {@code null}.
 *
 * @see #getIndividualName()
 * @see #getPositionName()
 */
private InternationalString getIndividual(final boolean position) {
  final Collection<AbstractParty> parties = getParties();
  InternationalString name = getName(parties, DefaultIndividual.class, position);
  if (name == null && parties != null) {
    for (final AbstractParty party : parties) {
      if (party instanceof DefaultOrganisation) {
        name = getName(((DefaultOrganisation) party).getIndividual(), DefaultIndividual.class, position);
        if (name != null) {
          break;
        }
      }
    }
  }
  return name;
}
origin: org.apache.sis.core/sis-metadata

/**
 * Sets the name of the first party of the given type.
 *
 * @return {@code true} if the name has been set, or {@code false} otherwise.
 */
private boolean setName(final Class<? extends AbstractParty> type, final boolean position, final InternationalString name) {
  checkWritePermission();
  final Iterator<AbstractParty> it = getParties().iterator();
  while (it.hasNext()) {
    final AbstractParty party = it.next();
    if (type.isInstance(party)) {
      if (position) {
        ((DefaultIndividual) party).setPositionName(name);
      } else {
        party.setName(name);
      }
      if (party.isEmpty()) {
        it.remove();
      }
      return true;
    }
  }
  return name == null;                    // If no party and name is null, there is nothing to set.
}
origin: org.apache.sis.core/sis-metadata

/**
 * Returns the address of the responsible party.
 *
 * <p>This implementation returns the first non-null contact found in the collection of
 * {@linkplain #getParties() parties}.</p>
 *
 * @return address of the responsible party, or {@code null}.
 *
 * @deprecated As of ISO 19115:2014, replaced by {@link AbstractParty#getContactInfo()}.
 */
@Override
@Deprecated
@XmlElement(name = "contactInfo")
@Dependencies("getParties")
public Contact getContactInfo() {
  final Collection<AbstractParty> parties = getParties();
  if (parties != null) { // May be null on marshalling.
    for (final AbstractParty party : parties) {
      final Collection<? extends Contact> contacts = party.getContactInfo();
      if (contacts != null) { // May be null on marshalling.
        for (final Contact contact : contacts) {
          if (contact != null) { // Paranoiac check.
            return contact;
          }
        }
      }
    }
  }
  return null;
}
origin: org.apache.sis.core/sis-metadata

if (presentationForm      != null) c.setPresentationForms(singleton(presentationForm));
if (citedResponsibleParty != null) {
  final DefaultResponsibleParty r = new DefaultResponsibleParty(Role.PRINCIPAL_INVESTIGATOR);
  r.setParties(singleton(new DefaultOrganisation(citedResponsibleParty, null, null, null)));
  c.setCitedResponsibleParties(singleton(r));
origin: org.apache.sis.storage/sis-storage

/**
 * Creates the responsibility object if it does not already exists, then returns it.
 *
 * @return the responsibility party (never {@code null}).
 */
private DefaultResponsibleParty responsibility() {
  if (responsibility == null) {
    responsibility = new DefaultResponsibleParty();
  }
  return responsibility;
}
origin: org.apache.sis.core/sis-metadata

/**
 * set the role or position of the responsible person Only one of
 * {@link #getIndividualName() individualName}, {@link #getOrganisationName() organisationName}
 * and {@code positionName} shall be provided.
 *
 * <p>This implementation sets the position name of the first {@code Individual} found in the collection of
 * {@linkplain #getParties() parties}, or create a new individual if no existing instance was found.</p>
 *
 * @param  newValue  the new position name, or {@code null} if none.
 *
 * @deprecated As of ISO 19115:2014, replaced by {@link DefaultIndividual#setPositionName(InternationalString)}.
 */
@Deprecated
public void setPositionName(final InternationalString newValue) {
  if (!setName(DefaultIndividual.class, true, newValue)) {
    getParties().add(new DefaultIndividual(null, newValue, null));
  }
}
origin: org.apache.sis.core/sis-metadata

/**
 * Returns the name of the responsible organization. Only one of
 * {@link #getIndividualName() individualName}, {@code organisationName}
 * and {@link #getPositionName() positionName} shall be provided.
 *
 * <p>This implementation returns the name of the first {@code Organisation}
 * found in the collection of {@linkplain #getParties() parties}.</p>
 *
 * @return name of the responsible organization, or {@code null}.
 *
 * @deprecated As of ISO 19115:2014, replaced by {@code getName()} in {@link DefaultOrganisation}.
 */
@Override
@Deprecated
@XmlElement(name = "organisationName")
@Dependencies("getParties")
public InternationalString getOrganisationName() {
  return getName(getParties(), DefaultOrganisation.class, false);
}
origin: apache/sis

/**
 * Sets the address of the responsible party.
 *
 * <p>This implementation sets the contact info in the first party found in the collection of
 * {@linkplain #getParties() parties}.</p>
 *
 * @param  newValue  the new contact info, or {@code null} if none.
 *
 * @deprecated As of ISO 19115:2014, replaced by {@link AbstractParty#setContactInfo(Collection)}.
 */
@Deprecated
public void setContactInfo(final Contact newValue) {
  checkWritePermission(valueIfDefined(super.getParties()));
  final Iterator<AbstractParty> it = getParties().iterator();
  while (it.hasNext()) {
    final AbstractParty party = it.next();
    party.setContactInfo(newValue != null ? Collections.singleton(newValue) : null);
    if (party.isEmpty()) {
      it.remove();
    }
    return;
  }
  /*
   * If no existing AbstractParty were found, add a new one. However there is no way to know if
   * it should be an individual or an organization. Arbitrarily choose an individual for now.
   */
  if (newValue != null) {
    getParties().add(new DefaultIndividual(null, null, newValue));
  }
}
org.apache.sis.metadata.iso.citationDefaultResponsibleParty

Javadoc

Identification of, and means of communication with, person(s) and organizations associated with the dataset. The following properties are mandatory or conditional (i.e. mandatory under some circumstances) in a well-formed metadata according ISO 19115:
CI_ResponsibleParty ├─role…………………………… Function performed by the responsible party. └─party………………………… Information about the parties. └─name………………… Name of the party.
Upcoming API change — deprecation
As of ISO 19115:2014, the ResponsibleParty type has been replaced by Responsibilityto allow more flexible associations of individuals, organisations, and roles. This ResponsibleParty interface may be deprecated in GeoAPI 4.0.

Most used methods

  • <init>
    Constructs a responsibility party with the given role.
  • setParties
  • getParties
  • setIndividualName
    Sets the name of the responsible person- surname, given name, title separated by a delimiter. Only o
  • setOrganisationName
    Sets the name of the responsible organization. Only one of #getIndividualName(), organisationNameand
  • setRole
    Sets the function performed by the responsible party.
  • castOrCopy
    Returns a SIS metadata implementation with the values of the given arbitrary implementation. This me
  • checkWritePermission
  • getIndividual
    Returns the name or the position of the first individual. If no individual is found in the list of p
  • getName
    Returns the name of the first party of the given type, or null if none.
  • setContactInfo
    Sets the address of the responsible party.This implementation sets the contact info in the first par
  • setExtents
  • setContactInfo,
  • setExtents,
  • setName

Popular in Java

  • Updating database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • scheduleAtFixedRate (Timer)
  • setContentView (Activity)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JList (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now