View Javadoc
1   /*
2    * Copyright (c) 2002-2026 Gargoyle Software Inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * https://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */
15  package org.htmlunit.html;
16  
17  /**
18   * <span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span><br>
19   *
20   * Marker/accessor interface implemented by the two elements the HTML spec defines as
21   * "hyperlink elements" - {@link HtmlAnchor} ({@code a}) and {@link HtmlArea} ({@code area}).
22   * Both share the same click/navigation-related attribute set ({@code href}, {@code target},
23   * {@code rel}, {@code ping}, {@code download}); {@link HyperlinkElementSupport} operates on
24   * this interface to avoid duplicating that logic across the two implementations.
25   *
26   * @see HyperlinkElementSupport
27   *
28   * @author Ronald Brill
29   */
30  public interface HyperlinkElement {
31  
32      /**
33       * Returns the value of the {@code href} attribute, or an empty string if not defined.
34       *
35       * @return the value of the {@code href} attribute, or an empty string if not defined
36       */
37      String getHrefAttribute();
38  
39      /**
40       * Returns the value of the {@code target} attribute, or an empty string if not defined.
41       *
42       * @return the value of the {@code target} attribute, or an empty string if not defined
43       */
44      String getTargetAttribute();
45  
46      /**
47       * Returns the value of the {@code rel} attribute, or an empty string if not defined.
48       *
49       * @return the value of the {@code rel} attribute, or an empty string if not defined
50       */
51      String getRelAttribute();
52  
53      /**
54       * Returns the value of the {@code ping} attribute, or an empty string if not defined.
55       *
56       * @return the value of the {@code ping} attribute, or an empty string if not defined
57       */
58      String getPingAttribute();
59  
60      /**
61       * Returns the value of the {@code download} attribute, or an empty string if not defined.
62       *
63       * @return the value of the {@code download} attribute, or an empty string if not defined
64       */
65      String getDownloadAttribute();
66  }