Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/ContentHandlerWrapper.java')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/ContentHandlerWrapper.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/ContentHandlerWrapper.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/ContentHandlerWrapper.java
new file mode 100644
index 000000000..5b35c0b66
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/externalization/ContentHandlerWrapper.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.tasks.core.externalization;
+
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+
+public class ContentHandlerWrapper {
+
+ private final ContentHandler handler;
+
+ public ContentHandlerWrapper(ContentHandler handler) {
+ this.handler = handler;
+ }
+
+ public void startElement(String elementName, AttributesWrapper attributes) throws SAXException {
+ handler.startElement("", elementName, elementName, attributes.getAttributes()); //$NON-NLS-1$
+ }
+
+ public void endElement(String elementName) throws SAXException {
+ handler.endElement("", elementName, elementName);//$NON-NLS-1$
+ }
+
+ public void characters(String value) throws SAXException {
+ char[] chars = value.toCharArray();
+ handler.characters(chars, 0, chars.length);
+ }
+
+ public ContentHandler getHandler() {
+ return handler;
+ }
+
+}

Back to the top