Tabnine Logo
IdentifierMap.put
Code IndexAdd Tabnine to your IDE (free)

How to use
put
method
in
org.apache.sis.xml.IdentifierMap

Best Java code snippets using org.apache.sis.xml.IdentifierMap.put (Showing top 9 results out of 315)

origin: apache/sis

  /**
   * Invoked by JAXB for specifying the unique identifier.
   *
   * @see org.apache.sis.metadata.iso.ISOMetadata#setUUID(String)
   */
  @SuppressWarnings("unused")
  private void setUUID(final String id) {
    getIdentifierMap().put(IdentifierSpace.UUID, id);
  }
}
origin: org.apache.sis.core/sis-metadata

  /**
   * Invoked by JAXB for specifying the unique identifier.
   *
   * @see org.apache.sis.metadata.iso.ISOMetadata#setUUID(String)
   */
  private void setUUID(final String id) {
    getIdentifierMap().put(IdentifierSpace.UUID, id);
  }
}
origin: apache/sis

  /**
   * Sets an unique identifier.
   * This method is invoked automatically by JAXB and should never be invoked explicitly.
   */
  private void setUUID(final String id) {
    /*
     * IdentifierMapAdapter will take care of converting the String to UUID if possible, or
     * will store the value as a plain String if it can not be converted. In the later case,
     * a warning will be emitted (logged or processed by listeners).
     */
    getIdentifierMap().put(IdentifierSpace.UUID, id);
  }
}
origin: org.apache.sis.core/sis-metadata

  /**
   * Sets an unique identifier.
   * This method is invoked automatically by JAXB and should never be invoked explicitely.
   */
  private void setUUID(final String id) {
    /*
     * IdentifierMapAdapter will take care of converting the String to UUID if possible, or
     * will store the value as a plain String if it can not be converted. In the later case,
     * a warning will be emitted (logged or processed by listeners).
     */
    getIdentifierMap().put(IdentifierSpace.UUID, id);
  }
}
origin: apache/sis

  /**
   * Assigns the {@link #id} value (if non-null) to the given object. This method
   * is typically invoked at unmarshalling time in order to assign the ID of this
   * temporary wrapper to the "real" GeoAPI implementation instance.
   *
   * @param  wrapped  the GeoAPI implementation for which to assign the ID.
   */
  public final void copyIdTo(final Object wrapped) {
    if (id != null && wrapped instanceof IdentifiedObject) {
      final IdentifierMap map = ((IdentifiedObject) wrapped).getIdentifierMap();
      if (map != null) {                                  // Should not be null, but let be safe.
        map.put(IdentifierSpace.ID, id);
      }
    }
  }
}
origin: org.apache.sis.core/sis-utility

  /**
   * Assigns the {@link #id} value (if non-null) to the given object. This method
   * is typically invoked at unmarshalling time in order to assign the ID of this
   * temporary wrapper to the "real" GeoAPI implementation instance.
   *
   * @param  wrapped  the GeoAPI implementation for which to assign the ID.
   */
  public final void copyIdTo(final Object wrapped) {
    if (id != null && wrapped instanceof IdentifiedObject) {
      final IdentifierMap map = ((IdentifiedObject) wrapped).getIdentifierMap();
      if (map != null) {                                  // Should not be null, but let be safe.
        map.put(IdentifierSpace.ID, id);
      }
    }
  }
}
origin: apache/sis

/**
 * Tests read operations on an {@link IdentifierMap} using specific API.
 */
@Test
public void testGetSpecialized() {
  final List<Identifier> identifiers = new ArrayList<>();
  final IdentifierMap map = new ModifiableIdentifierMap(identifiers);
  assertNull(map.put(ID,   "myID"));
  assertNull(map.put(UUID, "a1eb6e53-93db-4942-84a6-d9e7fb9db2c7"));
  assertNull(map.put(HREF, "http://mylink"));
  assertMapEquals("{gml:id=“myID”,"
      + " gco:uuid=“a1eb6e53-93db-4942-84a6-d9e7fb9db2c7”,"
      + " xlink:href=“http://mylink”}", map);
  assertEquals("myID",                                             map.get           (ID));
  assertEquals("a1eb6e53-93db-4942-84a6-d9e7fb9db2c7",             map.get           (UUID));
  assertEquals("http://mylink",                                    map.get           (HREF));
  assertEquals("myID",                                             map.getSpecialized(ID));
  assertEquals(URI.create("http://mylink"),                        map.getSpecialized(HREF));
  assertEquals(fromString("a1eb6e53-93db-4942-84a6-d9e7fb9db2c7"), map.getSpecialized(UUID));
}
origin: apache/sis

/**
 * Tests explicitly the special handling of {@code href} values.
 */
@Test
public void testHRefSubstitution() {
  final List<Identifier> identifiers = new ArrayList<>();
  final IdentifierMap map = new ModifiableIdentifierMap(identifiers);
  assertNull(map.put(HREF, "myHREF"));
  assertEquals("Shall contain the entry we added.", "myHREF", map.get(HREF));
  // Check the XLink object
  final XLink link = map.getSpecialized(XLINK);
  assertEquals("Added href shall be stored as XLink attribute.", "myHREF", String.valueOf(link.getHRef()));
  assertEquals("Identifier list shall contain the XLink.", link.toString(), getSingleton(identifiers).getCode());
  // Modidfy the XLink object directly
  link.setHRef(URI.create("myNewHREF"));
  assertEquals("Change in XLink shall be reflected in href.", "myNewHREF", map.get(HREF));
}
origin: apache/sis

/**
 * Compares the marshalling and unmarshalling of a {@link DefaultExtent} with XML in the given file.
 */
private void roundtrip(final String filename, final Version version) throws JAXBException {
  final DefaultGeographicBoundingBox bbox = new DefaultGeographicBoundingBox(-99, -79, 14.9844, 31);
  bbox.getIdentifierMap().put(IdentifierSpace.ID, "bbox");
  final DefaultTemporalExtent temporal = new DefaultTemporalExtent();
  if (PENDING_FUTURE_SIS_VERSION) {
    // This block needs sis-temporal module.
    temporal.setBounds(date("2010-01-27 13:26:10"), date("2010-08-27 13:26:10"));
  }
  final DefaultExtent extent = new DefaultExtent(null, bbox, null, temporal);
  assertMarshalEqualsFile(filename, extent, version, "xmlns:*", "xsi:schemaLocation");
  assertEquals(extent, unmarshalFile(DefaultExtent.class, filename));
}
org.apache.sis.xmlIdentifierMapput

Javadoc

Associates the given identifier with the given namespace in this map (optional operation). If the map previously contained a mapping for the namespace, then the old value is replaced by the specified value.

Popular methods of IdentifierMap

  • putSpecialized
    Associates the given identifier with the given namespace in this map (optional operation). If the ma
  • get
  • getSpecialized
    Returns the identifier associated to the given namespace, or null if this map contains no mapping of
  • keySet
  • size

Popular in Java

  • Creating JSON documents from java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • getSystemService (Context)
  • onCreateOptionsMenu (Activity)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Github Copilot alternatives
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