1 28 package net.sf.jasperreports.engine.xml; 29 30 import net.sf.jasperreports.engine.JRHyperlink; 31 import net.sf.jasperreports.engine.design.JRDesignHyperlink; 32 33 import org.xml.sax.Attributes ; 34 35 36 42 public class JRHyperlinkFactory extends JRBaseFactory 43 { 44 public static final String ELEMENT_hyperlinkTooltipExpression = "hyperlinkTooltipExpression"; 45 public static final String ELEMENT_sectionHyperlink = "sectionHyperlink"; 46 public static final String ELEMENT_itemHyperlink = "itemHyperlink"; 47 48 public static final String ATTRIBUTE_hyperlinkType = "hyperlinkType"; 49 public static final String ATTRIBUTE_hyperlinkTarget = "hyperlinkTarget"; 50 51 public Object createObject(Attributes atts) throws Exception 52 { 53 JRDesignHyperlink link = new JRDesignHyperlink(); 54 55 String hyperlinkType = atts.getValue(ATTRIBUTE_hyperlinkType); 56 if (hyperlinkType != null) 57 { 58 link.setLinkType(hyperlinkType); 59 } 60 61 Byte hyperlinkTarget = (Byte )JRXmlConstants.getHyperlinkTargetMap().get(atts.getValue(ATTRIBUTE_hyperlinkTarget)); 62 if (hyperlinkTarget != null) 63 { 64 link.setHyperlinkTarget(hyperlinkTarget.byteValue()); 65 } 66 67 return link; 68 } 69 70 } 71 | Popular Tags |