package contrib; import org.jdom.Element; /** * @author Phill Perryman * * Example descriptor based on the id attribute */ public class IdElementDescriptor implements ElementDescriptor { public String getDescription(Element e) { org.jdom.Attribute a = e.getAttribute("id"); if (a == null) { return "<" + e.getName() + ">"; } else { return "<" + e.getName() + " id='" + a.getValue() + "'>"; } } }