diff options
author | rbrooks | 2010-08-29 08:19:34 +0000 |
---|---|---|
committer | rbrooks | 2010-08-29 08:19:34 +0000 |
commit | 59f9aeec1800ce305d6075446f99269385af9c9b (patch) | |
tree | 2f1a2b4b28561e7afc90fd9501e056a4edf43cd8 /plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ExtractReqPriority.java | |
parent | d8dfd93647951a8fd2dfe74bf6fadb2697f08543 (diff) | |
parent | 9279bf9b85bf1ceb07098e922625e00996c085de (diff) | |
download | org.eclipse.osee-3a10f0673e85566766647d2b18ea2307d3c878fc.tar.gz org.eclipse.osee-3a10f0673e85566766647d2b18ea2307d3c878fc.tar.xz org.eclipse.osee-3a10f0673e85566766647d2b18ea2307d3c878fc.zip |
0.9.5 Branch Creation0.9.5.v201008280938
Diffstat (limited to 'plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ExtractReqPriority.java')
-rw-r--r-- | plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ExtractReqPriority.java | 178 |
1 files changed, 89 insertions, 89 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ExtractReqPriority.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ExtractReqPriority.java index 633ee622d07..e64ec4c457b 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ExtractReqPriority.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ExtractReqPriority.java @@ -1,90 +1,90 @@ -/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * 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:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.framework.ui.skynet.blam.operation;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-import java.util.HashMap;
-import org.eclipse.osee.framework.jdk.core.util.io.xml.ExcelSaxHandler;
-import org.eclipse.osee.framework.jdk.core.util.io.xml.RowProcessor;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-/**
- * @author Ryan D. Brooks
- */
-public class ExtractReqPriority implements RowProcessor {
- private final HashMap<String, String> reqPriorities;
-
- public ExtractReqPriority(String excelMlPath) throws UnsupportedEncodingException, FileNotFoundException, IOException, SAXException {
- this.reqPriorities = new HashMap<String, String>();
-
- File file = new File(excelMlPath);
-
- XMLReader xmlReader = XMLReaderFactory.createXMLReader();
- xmlReader.setContentHandler(new ExcelSaxHandler(this, true));
- xmlReader.parse(new InputSource(new InputStreamReader(new FileInputStream(file), "UTF-8")));
- }
-
- public HashMap<String, String> getReqPriorities() {
- return reqPriorities;
- }
-
- @Override
- public void detectedRowAndColumnCounts(int rowCount, int columnCount) {
- // do nothing
- }
-
- @Override
- public void foundStartOfWorksheet(String sheetName) {
- // do nothing
- }
-
- @Override
- public void processCommentRow(String[] row) {
- // do nothing
- }
-
- @Override
- public void processEmptyRow() {
- // do nothing
- }
-
- @Override
- public void processHeaderRow(String[] row) {
- // do nothing
- }
-
- @Override
- public void processRow(String[] row) {
- // pick the highest priority specified in the workbook (in case there are multiple priorities for the same item)
- if (row[1] != null) {
- String priority = reqPriorities.get(row[1]);
- if (priority != null) {
- if (priority.compareTo(row[0]) > 0) {
- return;
- }
- }
- reqPriorities.put(row[1], row[0]);
- }
- }
-
- @Override
- public void reachedEndOfWorksheet() {
- // do nothing
- }
+/******************************************************************************* + * Copyright (c) 2004, 2007 Boeing. + * 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: + * Boeing - initial API and implementation + *******************************************************************************/ +package org.eclipse.osee.framework.ui.skynet.blam.operation; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.util.HashMap; +import org.eclipse.osee.framework.jdk.core.util.io.xml.ExcelSaxHandler; +import org.eclipse.osee.framework.jdk.core.util.io.xml.RowProcessor; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.XMLReaderFactory; + +/** + * @author Ryan D. Brooks + */ +public class ExtractReqPriority implements RowProcessor { + private final HashMap<String, String> reqPriorities; + + public ExtractReqPriority(String excelMlPath) throws UnsupportedEncodingException, FileNotFoundException, IOException, SAXException { + this.reqPriorities = new HashMap<String, String>(); + + File file = new File(excelMlPath); + + XMLReader xmlReader = XMLReaderFactory.createXMLReader(); + xmlReader.setContentHandler(new ExcelSaxHandler(this, true)); + xmlReader.parse(new InputSource(new InputStreamReader(new FileInputStream(file), "UTF-8"))); + } + + public HashMap<String, String> getReqPriorities() { + return reqPriorities; + } + + @Override + public void detectedRowAndColumnCounts(int rowCount, int columnCount) { + // do nothing + } + + @Override + public void foundStartOfWorksheet(String sheetName) { + // do nothing + } + + @Override + public void processCommentRow(String[] row) { + // do nothing + } + + @Override + public void processEmptyRow() { + // do nothing + } + + @Override + public void processHeaderRow(String[] row) { + // do nothing + } + + @Override + public void processRow(String[] row) { + // pick the highest priority specified in the workbook (in case there are multiple priorities for the same item) + if (row[1] != null) { + String priority = reqPriorities.get(row[1]); + if (priority != null) { + if (priority.compareTo(row[0]) > 0) { + return; + } + } + reqPriorities.put(row[1], row[0]); + } + } + + @Override + public void reachedEndOfWorksheet() { + // do nothing + } }
\ No newline at end of file |