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

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

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

origin: org.apache.sis.core/sis-metadata

String id = Context.getObjectID(context, object);
if (id == null) {
  id = object.getIdentifierMap().getSpecialized(IdentifierSpace.ID);
  if (id != null) {
    final StringBuilder buffer = new StringBuilder();
origin: apache/sis

String id = Context.getObjectID(context, object);
if (id == null) {
  id = object.getIdentifierMap().getSpecialized(IdentifierSpace.ID);
  if (id != null) {
    final StringBuilder buffer = new StringBuilder();
origin: org.apache.sis.core/sis-utility

XLink link = map.getSpecialized(IdentifierSpace.XLINK);
UUID  uuid = map.getSpecialized(IdentifierSpace.UUID);
if (uuid != null || link != null) {
origin: apache/sis

XLink link = map.getSpecialized(IdentifierSpace.XLINK);
UUID  uuid = map.getSpecialized(IdentifierSpace.UUID);
if (uuid != null || link != null) {
origin: apache/sis

/**
 * Verifies if the given metadata contains the expected {@code xlink:href} attribute value.
 *
 * @param  isNilExpected  {@code true} if the identification info is expected to be a {@link NilObject} instance.
 * @param  metadata       the metadata to verify.
 */
private static void verify(final boolean isNilExpected, final DefaultMetadata metadata) {
  final Identification identification = getSingleton(metadata.getIdentificationInfo());
  assertEquals("NilObject", isNilExpected, identification instanceof NilObject);
  assertInstanceOf("Identification", IdentifiedObject.class, identification);
  final XLink xlink = ((IdentifiedObject) identification).getIdentifierMap().getSpecialized(IdentifierSpace.XLINK);
  assertEquals("xlink:href", "http://test.net", xlink.getHRef().toString());
}
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 write operations on an {@link IdentifierMap} using specific API.
 */
@Test
public void testPutSpecialized() {
  final List<Identifier> identifiers = new ArrayList<>();
  final IdentifierMap map = new ModifiableIdentifierMap(identifiers);
  final String myID = "myID";
  final java.util.UUID myUUID = fromString("a1eb6e53-93db-4942-84a6-d9e7fb9db2c7");
  final URI myURI = URI.create("http://mylink");
  assertNull(map.putSpecialized(ID,   myID));
  assertNull(map.putSpecialized(UUID, myUUID));
  assertNull(map.putSpecialized(HREF, myURI));
  assertMapEquals("{gml:id=“myID”,"
      + " gco:uuid=“a1eb6e53-93db-4942-84a6-d9e7fb9db2c7”,"
      + " xlink:href=“http://mylink”}", map);
  assertSame(myID,   map.getSpecialized(ID));
  assertSame(myUUID, map.getSpecialized(UUID));
  assertSame(myURI,  map.getSpecialized(HREF));
  assertEquals("myID",                                 map.get(ID));
  assertEquals("a1eb6e53-93db-4942-84a6-d9e7fb9db2c7", map.get(UUID));
  assertEquals("http://mylink",                        map.get(HREF));
}
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));
}
org.apache.sis.xmlIdentifierMapgetSpecialized

Javadoc

Returns the identifier associated to the given namespace, or null if this map contains no mapping of the specialized type for the namespace.

Popular methods of IdentifierMap

  • putSpecialized
    Associates the given identifier with the given namespace in this map (optional operation). If the ma
  • get
  • put
  • keySet
  • size

Popular in Java

  • Finding current android device location
  • getSharedPreferences (Context)
  • runOnUiThread (Activity)
  • startActivity (Activity)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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