diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2010-01-27 13:51:16 +0100 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2010-01-27 13:51:16 +0100 |
commit | 6163dce52f006f6f5a390eebd000caeaa1c70854 (patch) | |
tree | d789b8d74ace47cf1dbeecd505c268be107c6864 /reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapper.java | |
parent | CWS-TOOLING: integrate CWS vcl108 (diff) | |
parent | Automated merge with ssh://hg@hg.services.openoffice.org/cws/dba33b (diff) | |
download | core-6163dce52f006f6f5a390eebd000caeaa1c70854.tar.gz core-6163dce52f006f6f5a390eebd000caeaa1c70854.zip |
CWS-TOOLING: integrate CWS dba33d
Diffstat (limited to 'reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapper.java')
-rw-r--r-- | reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapper.java | 76 |
1 files changed, 34 insertions, 42 deletions
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapper.java index 1424d0becad6..6cb6add68697 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapper.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.styles; import java.util.HashMap; @@ -54,53 +52,47 @@ import org.pentaho.reporting.libraries.resourceloader.ResourceManager; */ public class StyleMapper { - private final Map backend; - public StyleMapper() - { - this.backend = new HashMap(); - } + private final Map backend; - public void addMapping(final StyleMappingRule rule) - { - backend.put(rule.getKey(), rule); - } + public StyleMapper() + { + this.backend = new HashMap(); + } - public boolean isListOfStyles(final String elementNamespace, - final String elementTagName, - final String attributeNamespace, - final String attributeName) - { - final StyleMapperKey key = new StyleMapperKey - (elementNamespace, elementTagName, attributeNamespace, attributeName); - final StyleMappingRule rule = (StyleMappingRule) backend.get(key); - if (rule == null) + public void addMapping(final StyleMappingRule rule) { - return false; + backend.put(rule.getKey(), rule); } - return rule.isListOfValues(); - } - public String getStyleFamilyFor(final String elementNamespace, - final String elementTagName, - final String attributeNamespace, - final String attributeName) - { - final StyleMapperKey key = new StyleMapperKey - (elementNamespace, elementTagName, attributeNamespace, attributeName); - final StyleMappingRule rule = (StyleMappingRule) backend.get(key); - if (rule == null) + public boolean isListOfStyles(final String elementNamespace, + final String elementTagName, + final String attributeNamespace, + final String attributeName) { - return null; + final StyleMapperKey key = new StyleMapperKey(elementNamespace, elementTagName, attributeNamespace, attributeName); + final StyleMappingRule rule = (StyleMappingRule) backend.get(key); + return rule != null && rule.isListOfValues(); } - return rule.getFamily(); - } - public static StyleMapper loadInstance (final ResourceManager resourceManager) - throws ResourceException - { - final Resource resource = resourceManager.createDirectly - ("res://com/sun/star/report/pentaho/styles/stylemapper.xml", StyleMapper.class); - return (StyleMapper) resource.getResource(); - } + public String getStyleFamilyFor(final String elementNamespace, + final String elementTagName, + final String attributeNamespace, + final String attributeName) + { + final StyleMapperKey key = new StyleMapperKey(elementNamespace, elementTagName, attributeNamespace, attributeName); + final StyleMappingRule rule = (StyleMappingRule) backend.get(key); + if (rule == null) + { + return null; + } + return rule.getFamily(); + } + + public static StyleMapper loadInstance(final ResourceManager resourceManager) + throws ResourceException + { + final Resource resource = resourceManager.createDirectly("res://com/sun/star/report/pentaho/styles/stylemapper.xml", StyleMapper.class); + return (StyleMapper) resource.getResource(); + } } |