/**
 * Copyright (C) 2010 Asterios Raptis
 *
 * 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.
 */
package de.alpharogroup.wicket.behaviors;

import org.apache.wicket.Component;
import org.apache.wicket.behavior.Behavior;

import de.alpharogroup.wicket.behaviors.models.MailtoModel;

/**
 * The Class MailtoBehavior adds the email address to the a-tag.
 *
 * @param <T>
 *            the generic type
 * @author Asterios Raptis
 */
public class MailtoBehavior<T extends MailtoModel> extends Behavior
{

	/**
	 * The serialVersionUID.
	 */
	private static final long serialVersionUID = 1L;

	/** The mailto model. */
	private final T mailtoModel;

	/**
	 * Instantiates a new mailto behavior.
	 * 
	 * @param mailtoModel
	 *            The mailto model.
	 */
	public MailtoBehavior(final T mailtoModel)
	{
		this.mailtoModel = mailtoModel;
	}

	/**
	 * On rendered.
	 *
	 * @param component
	 *            the component
	 */
	@Override
	public void afterRender(final Component component)
	{
		super.afterRender(component);
		component.getResponse().write("</a>");
	}

	/**
	 * Before render.
	 *
	 * @param component
	 *            the component
	 */
	@Override
	public void beforeRender(final Component component)
	{
		super.beforeRender(component);
		component.getResponse()
			.write("<a href=\"mailto:" + mailtoModel.getMailtoAddresModel().getObject() + "\">");
	}

	/**
	 * Gets the mailto model.
	 *
	 * @return the mailto model
	 */
	public T getMailtoModel()
	{
		return mailtoModel;
	}

}
@@ -672,142 +672,140 @@
 ort 
-org.apache.wicket.Component;%0D%0Aimport org.apache.wicket.behavior.Behavi
+de.alpharogroup.wicket.behaviors.models.MailtoModel;%0D%0Aimport lombok.AllArgsConstruct
 or;%0D%0A
-%0D%0A
 import 
-de.alpharogroup.wicket.behaviors.models.MailtoMode
+lombok.Getter;%0D%0Aimport lombok.NonNul
 l;%0D%0A
@@ -822,14 +822,21 @@
 The 
-C
+c
 lass 
+%7B@link 
 Mail
@@ -845,16 +845,17 @@
 Behavior
+%7D
  adds th
@@ -870,16 +870,48 @@
 address 
+and optional a subject and body 
 to the a
@@ -1001,16 +1001,37 @@
 s%0D%0A */%0D%0A
+@AllArgsConstructor%0D%0A
 public c
@@ -1081,16 +1081,34 @@
 extends 
+ComponentDecorator
 Behavior
@@ -1229,24 +1229,43 @@
  model. */%0D%0A
+%09@Getter @NonNull%0D%0A
 %09private fin
@@ -1299,433 +1299,99 @@
 %09 * 
-Instantiates a new mailto behavior.%0D%0A%09 * %0D%0A%09 * @param mailtoModel%0D%0A%09 *            The mailto model.%0D%0A%09 */%0D%0A%09public MailtoBehavior(final T mailtoModel)%0D%0A%09%7B%0D%0A%09%09this.mailtoModel = mailtoModel;%0D%0A%09%7D%0D%0A%0D%0A%09/**%0D%0A%09 * On rendered.%0D%0A%09 *%0D%0A%09 * @param component%0D%0A%09 *            the component%0D%0A%09 */%0D%0A%09@Override%0D%0A%09public void afterRender(final Component component)%0D%0A%09%7B%0D%0A%09%09super.afterRender(component);%0D%0A%09%09component.getResponse().write(
+%7B@inheritDoc%7D%0D%0A%09 */%0D%0A%09@Override%0D%0A%09protected String onWriteBeforeRender() %7B%0D%0A%09%09return 
 %22%3C/a%3E%22
-)
 ;%0D%0A%09
@@ -1409,228 +1409,92 @@
 %09 * 
-Before render.%0D%0A%09 *%0D%0A%09 * @param component%0D%0A%09 *            the component%0D%0A%09 */%0D%0A%09@Override%0D%0A%09public void beforeRender(final Component component)%0D%0A%09%7B%0D%0A%09%09super.beforeRender(component);%0D%0A%09%09component.getResponse()%0D%0A%09%09%09.write(
+%7B@inheritDoc%7D%0D%0A%09 */%0D%0A%09@Override%0D%0A%09protected String onWriteAfterRender() %7B%0D%0A%09%09return 
 %22%3Ca 
@@ -1565,17 +1565,16 @@
  + %22%5C%22%3E%22
-)
 ;%0D%0A%09%7D%0D%0A%0D
@@ -1578,141 +1578,7 @@
 %0D%0A%0D%0A
-%09/**%0D%0A%09 * Gets the mailto model.%0D%0A%09 *%0D%0A%09 * @return the mailto model%0D%0A%09 */%0D%0A%09public T getMailtoModel()%0D%0A%09%7B%0D%0A%09%09return mailtoModel;%0D%0A%09%7D%0D%0A%0D%0A%7D
+%7D%0D%0A

Update MailtoBehavior.java