![JAR search and dependency download from the Maven repository](/logo.png)
org.apache.juneau.rest.beans.Hyperlink Maven / Gradle / Ivy
// ***************************************************************************************************************************
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
// * specific language governing permissions and limitations under the License. *
// ***************************************************************************************************************************
package org.apache.juneau.rest.beans;
import org.apache.juneau.dto.html5.*;
/**
* Defines a simple hyperlink class.
*
* Examples:
*
* @Rest
* public class MyRest extends BasicRestServlet {
*
* // Produces <a href="/foo">bar</a>
* @RestGet
* public Hyperlink a01() {
* return new Hyperlink("foo" , "bar" );
* }
*
* // Produces <ul><li><a href="/foo">bar</a></li></ul>
* @RestGet
* public Hyperlink[] a02() {
* return new Hyperlink[]{a01()};
* }
*
* // Produces <ul><li><a href="/foo">bar</a></li></ul>
* @RestGet
* public Collection<Hyperlink> a03() {
* return Arrays.asList (a02());
* }
* }
*
*
* See Also:
* - Utility Beans
*
*/
public class Hyperlink extends A {
//-----------------------------------------------------------------------------------------------------------------
// Static
//-----------------------------------------------------------------------------------------------------------------
/**
* Static creator.
*
* @param href The {@link A#href(Object)} attribute.
* @param children The {@link A#children(Object[])} nodes.
* @return A new {@link Hyperlink} object.
*/
public static Hyperlink create(Object href, Object...children) {
return new Hyperlink(href, children);
}
//-----------------------------------------------------------------------------------------------------------------
// Implementation
//-----------------------------------------------------------------------------------------------------------------
/**
* Creates an empty {@link A} element.
*/
public Hyperlink() {}
/**
* Creates an {@link A} element with the specified {@link A#href(Object)} attribute and {@link A#children(Object[])}
* nodes.
*
* @param href The {@link A#href(Object)} attribute.
* @param children The {@link A#children(Object[])} nodes.
*/
public Hyperlink(Object href, Object...children) {
super(href, children);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy