summaryrefslogtreecommitdiffstats
path: root/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingReadHandler.java
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2010-01-27 13:51:16 +0100
committerIvo Hinkelmann <ihi@openoffice.org>2010-01-27 13:51:16 +0100
commit6163dce52f006f6f5a390eebd000caeaa1c70854 (patch)
treed789b8d74ace47cf1dbeecd505c268be107c6864 /reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingReadHandler.java
parentCWS-TOOLING: integrate CWS vcl108 (diff)
parentAutomated merge with ssh://hg@hg.services.openoffice.org/cws/dba33b (diff)
downloadcore-6163dce52f006f6f5a390eebd000caeaa1c70854.tar.gz
core-6163dce52f006f6f5a390eebd000caeaa1c70854.zip
CWS-TOOLING: integrate CWS dba33d
Diffstat (limited to 'reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingReadHandler.java')
-rw-r--r--reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingReadHandler.java98
1 files changed, 46 insertions, 52 deletions
diff --git a/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingReadHandler.java
index 21101d847e44..7db04ffc5d93 100644
--- a/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingReadHandler.java
+++ b/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingReadHandler.java
@@ -27,8 +27,6 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-
-
package com.sun.star.report.pentaho.styles;
import org.pentaho.reporting.libraries.xmlns.parser.AbstractXmlReadHandler;
@@ -44,66 +42,62 @@ import org.xml.sax.SAXException;
*/
public class StyleMappingReadHandler extends AbstractXmlReadHandler
{
- private StyleMappingRule rule;
-
- public StyleMappingReadHandler()
- {
- }
+ private StyleMappingRule rule;
- /**
- * Starts parsing.
- *
- * @param attrs the attributes.
- * @throws org.xml.sax.SAXException if there is a parsing error.
- */
- protected void startParsing(final Attributes attrs)
- throws SAXException
- {
- final String elementNamespace = attrs.getValue(getUri(),
- "element-namespace");
- if (elementNamespace == null)
+ public StyleMappingReadHandler()
{
- throw new ParseException
- ("Required attribute 'element-namespace' is missing", getLocator());
}
- final String elementName = attrs.getValue(getUri(), "element-name");
-
- if (elementName == null)
+ /**
+ * Starts parsing.
+ *
+ * @param attrs the attributes.
+ * @throws org.xml.sax.SAXException if there is a parsing error.
+ */
+ protected void startParsing(final Attributes attrs)
+ throws SAXException
{
- throw new ParseException
- ("Required attribute 'element-name' is missing", getLocator());
- }
+ final String elementNamespace = attrs.getValue(getUri(),
+ "element-namespace");
+ if (elementNamespace == null)
+ {
+ throw new ParseException("Required attribute 'element-namespace' is missing", getLocator());
+ }
- final String attributeNamespace = attrs.getValue(getUri(),
- "attribute-namespace");
- final String attributeName = attrs.getValue(getUri(), "attribute-name");
+ final String elementName = attrs.getValue(getUri(), "element-name");
- final boolean listOfValues =
- "styleNameRefs".equals(attrs.getValue(getUri(), "type"));
+ if (elementName == null)
+ {
+ throw new ParseException("Required attribute 'element-name' is missing", getLocator());
+ }
- final String family = attrs.getValue(getUri(), "style-family");
- final StyleMapperKey key = new StyleMapperKey
- (elementNamespace, elementName, attributeNamespace, attributeName);
- rule = new StyleMappingRule(key, family, listOfValues);
- }
+ final String attributeNamespace = attrs.getValue(getUri(),
+ "attribute-namespace");
+ final String attributeName = attrs.getValue(getUri(), "attribute-name");
+ final boolean listOfValues =
+ "styleNameRefs".equals(attrs.getValue(getUri(), "type"));
- public StyleMappingRule getRule()
- {
- return rule;
- }
+ final String family = attrs.getValue(getUri(), "style-family");
+ final StyleMapperKey key = new StyleMapperKey(elementNamespace, elementName, attributeNamespace, attributeName);
+ rule = new StyleMappingRule(key, family, listOfValues);
+ }
- /**
- * Returns the object for this element or null, if this element does not
- * create an object.
- *
- * @return the object.
- */
- public Object getObject()
- throws SAXException
- {
- return rule;
- }
+ public StyleMappingRule getRule()
+ {
+ return rule;
+ }
+
+ /**
+ * Returns the object for this element or null, if this element does not
+ * create an object.
+ *
+ * @return the object.
+ */
+ public Object getObject()
+ throws SAXException
+ {
+ return rule;
+ }
}