org.magicwerk.brownies.html.HtmlImage Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2010 by Thomas Mauch
*
* Licensed 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.
*
* $Id: HtmlDiv.java 3298 2016-09-26 23:42:02Z origo $
*/
package org.magicwerk.brownies.html;
import static org.magicwerk.brownies.html.HtmlConst.*;
import org.jdom2.Element;
/**
* A HTML {@literal } element.
*
* @author Thomas Mauch
* @version $Id: HtmlDiv.java 3298 2016-09-26 23:42:02Z origo $
*/
public class HtmlImage extends HtmlInline {
public HtmlImage() {
super(new Element(HtmlConst.ELEM_IMG));
}
public HtmlImage(String src) {
this();
setSrc(src);
}
public HtmlElement setSrc(String src) {
setAttribute(ATTR_SRC, src);
return this;
}
public HtmlElement setAlt(String alt) {
setAttribute(ATTR_ALT, alt);
return this;
}
}