congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
XLink.setHRef
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: Geomatys/geotoolkit

  @Override
  public XLink anchor(final MarshalContext context, final Object value, final CharSequence text) {
    final URI linkage;
    synchronized (anchors) {
      linkage = anchors.get(value);
    }
    if (linkage != null) {
      final XLink xlink = new XLink();
      xlink.setHRef(linkage);
      return xlink;
    }
    return super.anchor(context, value, text);
  }
});
origin: apache/sis

/**
 * Sets the {@code href} attribute value.
 *
 * @param  href  the new attribute value.
 * @throws URISyntaxException if the given string can not be parsed as a URI.
 * @category xlink
 */
public final void setHRef(final String href) throws URISyntaxException {
  xlink(true).setHRef(toURI(href));
}
origin: org.apache.sis.core/sis-utility

/**
 * Sets the {@code href} attribute value.
 *
 * @param  href  the new attribute value.
 * @throws URISyntaxException if the given string can not be parsed as a URI.
 * @category xlink
 */
public final void setHRef(final String href) throws URISyntaxException {
  xlink(true).setHRef(toURI(href));
}
origin: org.apache.sis.core/sis-utility

    old = ((XLink) link).getHRef();
  ((XLink) link).setHRef(href);
  return old;
link.setHRef(href);
store(IdentifierSpace.XLINK, link);
origin: apache/sis

    old = ((XLink) link).getHRef();
  ((XLink) link).setHRef(href);
  return old;
link.setHRef(href);
store(IdentifierSpace.XLINK, link);
origin: apache/sis

final XLink link = new XLink();
link.setType(XLink.Type.SIMPLE);
link.setHRef(new URI("org:apache:sis:href"));
assertEquals("XLink[type=\"simple\", href=\"org:apache:sis:href\"]", link.toString());
try {
  link.setHRef(null);
  fail("The XLink should be unmodifiable.");
} catch (UnsupportedOperationException e) {
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: org.apache.sis.core/sis-utility

if (id != null && resolver.canSubstituteByReference(context, type, value, id)) try {
  final XLink link = new XLink();
  link.setHRef(new URI(null, null, id));
  reference = new ObjectReference(null, link);
  return;
origin: apache/sis

if (id != null && resolver.canSubstituteByReference(context, type, value, id)) try {
  final XLink link = new XLink();
  link.setHRef(new URI(null, null, id));
  reference = new ObjectReference(null, link);
  return;
origin: apache/sis

/**
 * Tests (un)marshalling of an object with a {@code xlink:href} attribute without element definition.
 * The XML fragment is:
 *
 * {@preformat xml
 *   <mdb:MD_Metadata>
 *     <mdb:identificationInfo xlink:href="http://test.net"/>
 *   </mdb:MD_Metadata>
 * }
 *
 * @throws JAXBException if an error occurred during (un)marshalling.
 * @throws URISyntaxException if the URI used in this test is malformed.
 */
@Test
public void testLinkOnly() throws JAXBException, URISyntaxException {
  final XLink xlink = new XLink();
  xlink.setHRef(new URI("http://test.net"));
  final DefaultDataIdentification identification = new DefaultDataIdentification();
  identification.getIdentifierMap().putSpecialized(IdentifierSpace.XLINK, xlink);
  final DefaultMetadata metadata = new DefaultMetadata();
  metadata.setIdentificationInfo(Collections.singleton(identification));
  assertXmlEquals(LINK_ONLY_XML, marshal(metadata), "xmlns:*");
  verify(true, unmarshal(DefaultMetadata.class, LINK_ONLY_XML));
}
origin: org.apache.sis.core/sis-utility

xlink.setHRef(href);
return new SpecializedIdentifier<>(IdentifierSpace.XLINK, xlink);
origin: apache/sis

xlink.setHRef(href);
return new SpecializedIdentifier<>(IdentifierSpace.XLINK, xlink);
origin: apache/sis

public void testWithElement() throws JAXBException, URISyntaxException {
  final XLink xlink = new XLink();
  xlink.setHRef(new URI("http://test.net"));
  final DefaultDataIdentification identification = new DefaultDataIdentification();
  identification.getIdentifierMap().putSpecialized(IdentifierSpace.XLINK, xlink);
origin: apache/sis

assertFalse("Hash code can not be zero.", hashCode == 0);
link.setHRef(new URI("org:apache:sis:href"));
assertEquals(XLink.Type.LOCATOR, link.getType());
assertEquals("XLink[type=\"locator\", href=\"org:apache:sis:href\", role=\"org:apache:sis:role\", title=\"Some title\", label=\"SomeLabel\"]", link.toString());
org.apache.sis.xmlXLinksetHRef

Javadoc

Sets the URN to a resources.

Popular methods of XLink

  • <init>
    Creates a new link as a copy of the given link.
  • equals
    Compares this XLink with the given object for equality.
  • getHRef
    Returns a URN to an external resources, or to an other part of a XML document, or an identifier.
  • 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

  • Start an intent from android
  • scheduleAtFixedRate (Timer)
  • getExternalFilesDir (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Kernel (java.awt.image)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top Vim plugins
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