001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.juneau.marshall.html;
018
019import static java.lang.annotation.ElementType.*;
020import static java.lang.annotation.RetentionPolicy.*;
021
022import java.lang.annotation.*;
023
024/**
025 * Used in conjunction with the {@link HtmlSerializer} class to define hyperlinks.
026 *
027 * <p>
028 * Can be used in the following locations:
029 * <ul>
030 *    <li>Classes.
031 *    <li><ja>@Rest</ja>-annotated classes and <ja>@RestOp</ja>-annotated methods when used with {@link HtmlLinkApply @HtmlLinkApply}.
032 * </ul>
033 *
034 * <p>
035 * Annotation that can be used to specify that a class has a URL associated with it.
036 *
037 * <p>
038 * When rendered using the {@link HtmlSerializer HtmlSerializer} class, this class will get
039 * rendered as a hyperlink like so...
040 * <p class='code'>
041 *    <xt>&lt;a</xt> <xa>href</xa>=<xs>'hrefProperty'</xs><xt>&gt;</xt>nameProperty<xt>&lt;/a&gt;</xt>
042 * </p>
043 *
044 * <h5 class='section'>See Also:</h5><ul>
045 *    <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/HtmlSupport">HTML</a>
046
047 * </ul>
048 */
049@Documented
050@Target({ TYPE })
051@Retention(RUNTIME)
052@Inherited
053public @interface HtmlLink {
054
055   /**
056    * Optional description for the exposed API.
057    *
058    * @return The annotation value.
059    * @since 9.2.0
060    */
061   String[] description() default {};
062
063   /**
064    * The bean property whose value becomes the name in the hyperlink.
065    *
066    * @return The annotation value.
067    */
068   String nameProperty() default "name";
069
070   /**
071    * The bean property whose value becomes the url in the hyperlink.
072    *
073    * @return The annotation value.
074    */
075   String uriProperty() default "uri";
076}