Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.revolsys.ui.html.serializer.key;
 
 
Serialize an email address as a mailto:link.

Author(s):
Paul Austin
public class EmailKeySerializer implements KeySerializer {

  
Serialize the value to the XML writer using the settings from the Locale.

Parameters:
out The XML writer to serialize to.
object The object to get the value from.
key The key of the property on the object to serialize.
locale The locale.
  public void serialize(final XmlWriter outfinal Object object,
    final String keyfinal Locale locale) {
    Object email = JavaBeanUtil.getProperty(objectkey);
    if (email != null) {
      out.startTag(.);
      out.attribute(."mailto:" + email);
      out.text(email);
      out.endTag(.);
    } else {
      out.text("-");
    }
  }
New to GrepCode? Check out our FAQ X