/** * */ public String getProperty(String propName) { return propertiesMap.getProperty(propName); }
/** * Clones a properties map. * * @param propertiesMap the original properties map */ public JRPropertiesMap(JRPropertiesMap propertiesMap) { this(); this.base = propertiesMap.base; String[] propertyNames = propertiesMap.getPropertyNames(); if (propertyNames != null && propertyNames.length > 0) { for(int i = 0; i < propertyNames.length; i++) { setProperty(propertyNames[i], propertiesMap.getProperty(propertyNames[i])); } } }
/** * Returns the value of a property, looking first in the supplied properties map * and then in the system properties. * * @param propertiesMap the properties map * @param key the key * @return the property value */ public static String getProperty (JRPropertiesMap propertiesMap, String key) { String value = null; if (propertiesMap != null) { value = propertiesMap.getProperty(key); } if (value == null) { value = props.getProperty(key); } return value; }
private void writeProperties(JRPropertiesHolder propertiesHolder) throws IOException { if (propertiesHolder.hasProperties()) { JRPropertiesMap propertiesMap = propertiesHolder.getPropertiesMap(); String[] propertyNames = propertiesMap.getPropertyNames(); if (propertyNames != null && propertyNames.length > 0) { for(int i = 0; i < propertyNames.length; i++) { writer.startElement(JRXmlConstants.ELEMENT_property); writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_name, propertyNames[i]); String value = propertiesMap.getProperty(propertyNames[i]); if (value != null) { writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_value, value); } writer.closeElement(); } } } }
/** * */ public boolean isBreakAfterRow(JRPrintElement element) { return Boolean.valueOf(element.getPropertiesMap().getProperty(PROPERTY_BREAK_AFTER_ROW)).booleanValue(); }
protected void exportProperties(JRPropertiesHolder propertiesHolder) throws IOException { if (propertiesHolder.hasProperties()) { JRPropertiesMap propertiesMap = propertiesHolder.getPropertiesMap(); String[] propertyNames = propertiesMap.getPropertyNames(); if (propertyNames != null && propertyNames.length > 0) { for(int i = 0; i < propertyNames.length; i++) { xmlWriter.startElement(JRXmlConstants.ELEMENT_property); xmlWriter.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_name, propertyNames[i]); String value = propertiesMap.getProperty(propertyNames[i]); if (value != null) { xmlWriter.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_value, value); } xmlWriter.closeElement(); } } } }
/** * */ public boolean isBreakBeforeRow(JRPrintElement element) { return Boolean.valueOf(element.getPropertiesMap().getProperty(PROPERTY_BREAK_BEFORE_ROW)).booleanValue(); }
/** * */ public boolean isBreakAfterRow(JRPrintElement element) { return Boolean.valueOf(element.getPropertiesMap().getProperty(PROPERTY_BREAK_AFTER_ROW)).booleanValue(); }
/** * */ public boolean isBreakBeforeRow(JRPrintElement element) { return Boolean.valueOf(element.getPropertiesMap().getProperty(PROPERTY_BREAK_BEFORE_ROW)).booleanValue(); }
/** * */ public String getProperty(String propName) { return mainDataset.getPropertiesMap().getProperty(propName); }
/** * Returns the value of a property. * * @param propName the name of the property * @return the value */ public String getProperty(String propName) { String val; if (hasOwnProperty(propName)) { val = getOwnProperty(propName); } else if (base != null) { val = base.getProperty(propName); } else { val = null; } return val; }
protected boolean isAllowedToOverlap(JRElement element) { // check whether the element has been marked to allow to overwrite return element.hasProperties() && JRProperties.asBoolean(element.getPropertiesMap().getProperty( PROPERTY_ALLOW_ELEMENT_OVERLAP)); }
public String getStringParameterOrDefault(JRExporterParameter parameter, String property) { String value; JRPropertiesMap hintsMap = jasperPrint.getPropertiesMap(); if (hintsMap != null && hintsMap.containsProperty(property)) { value = hintsMap.getProperty(property); } else { value = (String) parameters.get(parameter); } if (value == null) { value = JRProperties.getProperty(property); } return value; }
public String getStringParameter(JRExporterParameter parameter, String property) { String value; JRPropertiesMap hintsMap = jasperPrint.getPropertiesMap(); if (hintsMap != null && hintsMap.containsProperty(property)) { value = hintsMap.getProperty(property); } else { value = (String) parameters.get(parameter); if (value == null) { value = JRProperties.getProperty(property); } } return value; }
/** * Returns the value of a property, looking first in the supplied properties holder * and then in the system properties. * * @param propertiesHolder the properties holder * @param key the key * @return the property value */ public static String getProperty (JRPropertiesHolder propertiesHolder, String key) { String value = null; while (propertiesHolder != null && value == null) { if (propertiesHolder.hasProperties()) { value = propertiesHolder.getPropertiesMap().getProperty(key); } propertiesHolder = propertiesHolder.getParentProperties(); } if (value == null) { value = props.getProperty(key); } return value; }
public Character getCharacterParameter(JRExporterParameter parameter, String property) { Character value; JRPropertiesMap hintsMap = jasperPrint.getPropertiesMap(); if (hintsMap != null && hintsMap.containsProperty(property)) { String prop = hintsMap.getProperty(property); value = JRProperties.asCharacter(prop); } else { value = (Character) parameters.get(parameter); if (value == null) { value = JRProperties.getCharacterProperty(property); } } return value; }
int rowSpan = 0; try { colSpan = Integer.valueOf(element.getPropertiesMap().getProperty(PROPERTY_TAG_COLSPAN)).intValue(); } catch (NumberFormatException e) { try { colSpan = Integer.valueOf(element.getPropertiesMap().getProperty(JRCellContents.PROPERTY_COLUMN_SPAN)).intValue(); } catch (NumberFormatException ex) {} rowSpan = Integer.valueOf(element.getPropertiesMap().getProperty(PROPERTY_TAG_ROWSPAN)).intValue(); } catch (NumberFormatException e) { try { rowSpan = Integer.valueOf(element.getPropertiesMap().getProperty(JRCellContents.PROPERTY_ROW_SPAN)).intValue(); } catch (NumberFormatException ex) {}
public boolean getBooleanParameter(JRExporterParameter parameter, String property, boolean defaultValue) { boolean value; JRPropertiesMap hintsMap = jasperPrint.getPropertiesMap(); if (hintsMap != null && hintsMap.containsProperty(property)) { String prop = hintsMap.getProperty(property); if (prop == null) { value = JRProperties.getBooleanProperty(property); } else { value = JRProperties.asBoolean(prop); } } else { Boolean param = (Boolean) parameters.get(parameter); if (param == null) { value = JRProperties.getBooleanProperty(property); } else { value = param.booleanValue(); } } return value; }
if (hintsMap != null && hintsMap.containsProperty(property)) String prop = hintsMap.getProperty(property); if (prop == null)
protected ListableBeanFactory getBeanFactory(String registryId, JRPropertiesMap properties) { String resourceProp = DefaultExtensionsRegistry.PROPERTY_REGISTRY_PREFIX + registryId + PROPERTY_SUFFIX_SPRING_BEANS_RESOURCE; String resource = properties.getProperty(resourceProp); if (resource == null) { throw new JRRuntimeException("No Spring resource property set"); } URL resourceLocation = JRLoader.getResource(resource); if (resourceLocation == null) { throw new JRRuntimeException("Could not find Spring resource " + resource + " for extensions registry " + registryId); } if (log.isDebugEnabled()) { log.debug("Creating Spring beans factory for extensions registry " + registryId + " using "+ resourceLocation); } XmlBeanFactory beanFactory = new XmlBeanFactory( new UrlResource(resourceLocation)); return beanFactory; }