Tabnine Logo
XLink.getHRef
Code IndexAdd Tabnine to your IDE (free)

How to use
getHRef
method
in
org.apache.sis.xml.XLink

Best Java code snippets using org.apache.sis.xml.XLink.getHRef (Showing top 13 results out of 315)

origin: apache/sis

/**
 * Extracts the {@code xlink:href} value from the {@link XLink} if presents.
 * This method does not test if an explicit {@code xlink:href} identifier exists;
 * this check must be done by the caller <strong>before</strong> to invoke this method.
 *
 * @see ModifiableIdentifierMap#setHRef(URI)
 */
private URI getHRef() {
  final Identifier identifier = getIdentifier(IdentifierSpace.XLINK);
  if (identifier instanceof SpecializedIdentifier<?>) {
    final Object link = ((SpecializedIdentifier<?>) identifier).value;
    if (link instanceof XLink) {
      return ((XLink) link).getHRef();
    }
  }
  return null;
}
origin: org.apache.sis.core/sis-utility

/**
 * Extracts the {@code xlink:href} value from the {@link XLink} if presents.
 * This method does not test if an explicit {@code xlink:href} identifier exists;
 * this check must be done by the caller <strong>before</strong> to invoke this method.
 *
 * @see ModifiableIdentifierMap#setHRef(URI)
 */
private URI getHRef() {
  final Identifier identifier = getIdentifier(IdentifierSpace.XLINK);
  if (identifier instanceof SpecializedIdentifier<?>) {
    final Object link = ((SpecializedIdentifier<?>) identifier).value;
    if (link instanceof XLink) {
      return ((XLink) link).getHRef();
    }
  }
  return null;
}
origin: org.apache.sis.core/sis-utility

/**
 * A URN to an external resources, or to an other part of a XML document, or an identifier.
 * The {@code xlink:href} attribute allows an XML element to refer to another XML element
 * that has a corresponding {@code id} attribute.
 *
 * @return the current value, or {@code null} if none.
 * @category xlink
 */
@XmlSchemaType(name = "anyURI")
@XmlAttribute(name = "href", namespace = Namespaces.XLINK)
public final String getHRef() {
  final XLink link = xlink(false);
  return (link != null) ? toString(link.getHRef()) : null;
}
origin: apache/sis

/**
 * A URN to an external resources, or to an other part of a XML document, or an identifier.
 * The {@code xlink:href} attribute allows an XML element to refer to another XML element
 * that has a corresponding {@code id} attribute.
 *
 * @return the current value, or {@code null} if none.
 * @category xlink
 */
@XmlSchemaType(name = "anyURI")
@XmlAttribute(name = "href", namespace = Namespaces.XLINK)
public final String getHRef() {
  final XLink link = xlink(false);
  return (link != null) ? toString(link.getHRef()) : null;
}
origin: apache/sis

ensureNonNull("type",  type);
ensureNonNull("xlink", link);
final URI href = link.getHRef();
if (href != null && href.toString().startsWith("#")) {
  final String id = href.getFragment();
origin: org.apache.sis.core/sis-utility

ensureNonNull("type",  type);
ensureNonNull("xlink", link);
final URI href = link.getHRef();
if (href != null && href.toString().startsWith("#")) {
  final String id = href.getFragment();
origin: org.apache.sis.core/sis-utility

/**
 * Returns a string representation of this object. The default implementation returns the
 * simple class name followed by non-null attributes, as in the example below:
 *
 * {@preformat text
 *     XLink[type="locator", href="urn:ogc:def:method:EPSG::4326"]
 * }
 */
@Override
public String toString() {
  final StringBuilder buffer = new StringBuilder(64);
  buffer.append(Classes.getShortClassName(this)).append('[');
  append(buffer, "type",    getType());
  append(buffer, "href",    getHRef());
  append(buffer, "role",    getRole());
  append(buffer, "arcrole", getArcRole());
  append(buffer, "title",   getTitle());
  append(buffer, "show",    getShow());
  append(buffer, "actuate", getActuate());
  append(buffer, "label",   getLabel());
  append(buffer, "from",    getFrom());
  append(buffer, "to",      getTo());
  return buffer.append(']').toString();
}
origin: apache/sis

/**
 * Returns a string representation of this object. The default implementation returns the
 * simple class name followed by non-null attributes, as in the example below:
 *
 * {@preformat text
 *     XLink[type="locator", href="urn:ogc:def:method:EPSG::4326"]
 * }
 */
@Override
public String toString() {
  final StringBuilder buffer = new StringBuilder(64);
  buffer.append(Classes.getShortClassName(this)).append('[');
  append(buffer, "type",    getType());
  append(buffer, "href",    getHRef());
  append(buffer, "role",    getRole());
  append(buffer, "arcrole", getArcRole());
  append(buffer, "title",   getTitle());
  append(buffer, "show",    getShow());
  append(buffer, "actuate", getActuate());
  append(buffer, "label",   getLabel());
  append(buffer, "from",    getFrom());
  append(buffer, "to",      getTo());
  return buffer.append(']').toString();
}
origin: org.apache.sis.core/sis-utility

if (link instanceof XLink) {
  if (old == null) {
    old = ((XLink) link).getHRef();
origin: apache/sis

if (link instanceof XLink) {
  if (old == null) {
    old = ((XLink) link).getHRef();
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 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

assertEquals("SDN:C320:2:FR", anchor.getHRef().toString());
assertNull(anchor.getType());
org.apache.sis.xmlXLinkgetHRef

Javadoc

Returns a URN to an external resources, or to an other part of a XML document, or an identifier.

Popular methods of XLink

  • <init>
    Creates a new link as a copy of the given link.
  • setHRef
    Sets the URN to a resources.
  • equals
    Compares this XLink with the given object for equality.
  • getType
    Returns the type of link. May have one of the following values: * simple: a simple link * extended:
  • hashCode
    Returns a hash code value for this XLink.
  • setActuate
    Sets the desired timing of traversal from the starting resource to the ending resource.
  • setRole
    Sets the URI reference for some description of the arc role.
  • setShow
    Sets the desired presentation of the ending resource on traversal from the starting resource.
  • setTitle
    Sets a human-readable string with a short description for the arc.
  • setType
    Sets the type of link. Any value different than org.apache.sis.xml.XLink.Type#AUTO (including null)
  • append
    Appends the given attribute in the given buffer if the attribute value is not null. If the given val
  • canWrite
    Checks if the given attribute can be set.
  • append,
  • canWrite,
  • fieldMask,
  • getActuate,
  • getArcRole,
  • getFrom,
  • getLabel,
  • getRole,
  • getShow

Popular in Java

  • Reading from database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • putExtra (Intent)
  • scheduleAtFixedRate (Timer)
  • Kernel (java.awt.image)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Path (java.nio.file)
  • Join (org.hibernate.mapping)
  • 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