1 28 package net.sf.jasperreports.engine.xml; 29 30 import net.sf.jasperreports.engine.design.JRDesignBand; 31 32 import org.xml.sax.Attributes ; 33 34 35 39 public class JRBandFactory extends JRBaseFactory 40 { 41 42 43 46 private static final String ATTRIBUTE_height = "height"; 47 private static final String ATTRIBUTE_isSplitAllowed = "isSplitAllowed"; 48 49 50 53 public Object createObject(Attributes atts) 54 { 55 JRDesignBand band = new JRDesignBand(); 56 57 String height = atts.getValue(ATTRIBUTE_height); 58 if (height != null && height.length() > 0) 59 { 60 band.setHeight(Integer.parseInt(height)); 61 } 62 63 String isSplitAllowed = atts.getValue(ATTRIBUTE_isSplitAllowed); 64 if (isSplitAllowed != null && isSplitAllowed.length() > 0) 65 { 66 band.setSplitAllowed(Boolean.valueOf(isSplitAllowed).booleanValue()); 67 } 68 69 return band; 70 } 71 72 73 } 74 | Popular Tags |