Project

General

Profile

Revision 4486

Added by daigle over 12 years ago

Separate access control info into it's own list. Add getters and setters.

View differences:

src/edu/ucsb/nceas/metacat/DocInfoHandler.java
26 26

  
27 27
package edu.ucsb.nceas.metacat;
28 28

  
29
import java.sql.*;
30
import java.util.Stack;
31 29
import java.util.Vector;
32
import java.util.Enumeration;
33
import java.util.EmptyStackException;
34 30
import java.util.Hashtable;
35 31

  
36 32
import org.xml.sax.Attributes;
37 33
import org.xml.sax.SAXException;
38
import org.xml.sax.SAXParseException;
39
import org.xml.sax.ext.DeclHandler;
40
import org.xml.sax.ext.LexicalHandler;
41 34
import org.xml.sax.helpers.DefaultHandler;
42 35

  
43 36
/** 
......
46 39
 */
47 40
public class DocInfoHandler extends DefaultHandler 
48 41
{
49
  private Hashtable docinfo = new Hashtable();
42
  private Hashtable<String,String> docinfo = new Hashtable<String,String>();
43
//  private Hashtable<String, Vector<AccessControlForSingleFile>> accessControlInfo =
44
//	  new Hashtable<String, Vector<AccessControlForSingleFile>>();
50 45
  private String currentTag = null;
51 46
  
52
  private Vector accessControlList = new Vector();
47
  private Vector<AccessControlForSingleFile> accessControlList = new Vector<AccessControlForSingleFile>();
53 48
  
54 49
  public DocInfoHandler()
55 50
  {
......
63 58
  {
64 59
    currentTag = localName;
65 60
  }
66
  
61

  
67 62
  public void endElement (String uri, String localName, String qName)
68 63
	throws SAXException
69 64
  {
......
83 78
		}	
84 79
		accessControlList.add(acfsf);
85 80
	  }
86
	  //save the list when we are done
87
	  if (localName.equals("accessControl")) {
88
		  docinfo.put("accessControl", accessControlList);
89
	  }
81
//	  //save the list when we are done
82
//	  if (localName.equals("accessControl")) {
83
//		  accessControlInfo.put("accessControl", accessControlList);
84
//	  }
90 85
  }
91 86
  
92 87
  /**
......
98 93
    docinfo.put(currentTag, new String(ch, start, length));
99 94
  }
100 95
  
101
  public Hashtable getDocInfo()
96
  public Hashtable<String,String> getDocInfo()
102 97
  {
103 98
    return docinfo;
104 99
  }
100
  
101
  public Vector<AccessControlForSingleFile> getAccessControlList() {
102
	  return accessControlList;
103
  }
105 104
}

Also available in: Unified diff