01: /*
02: * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05:
06: //
07: package com.sun.portal.ffj.cookies;
08:
09: //
10: import java.io.IOException;
11:
12: import org.openide.TopManager;
13: import org.openide.cookies.InstanceCookie;
14: import org.openide.loaders.XMLDataObject;
15:
16: import org.w3c.dom.DOMException;
17: import org.w3c.dom.Document;
18: import org.w3c.dom.Element;
19: import org.w3c.dom.NamedNodeMap;
20: import org.w3c.dom.Node;
21: import org.w3c.dom.NodeList;
22: import org.xml.sax.SAXException;
23:
24: import com.sun.portal.ffj.util.ParEntry;
25: import com.sun.portal.ffj.util.ParEntryScanner;
26:
27: //
28: public class ParEntryInstance implements XMLDataObject.Processor,
29: InstanceCookie {
30: //
31: private XMLDataObject xml = null;
32:
33: public void attachTo(XMLDataObject xml) {
34: this .xml = xml;
35: }
36:
37: public Class instanceClass() {
38: return com.sun.portal.ffj.util.ParEntry.class;
39: }
40:
41: public String instanceName() {
42: return instanceClass().getName();
43: }
44:
45: public Object instanceCreate() throws IOException {
46: //
47: String method = "instanceCreate: ";
48:
49: //
50: try {
51: ParEntry pe = new ParEntry(xml);
52: Document doc = xml.getDocument();
53: ParEntryScanner peScanner = new ParEntryScanner(doc, pe);
54: peScanner.visitDocument();
55: return pe;
56: } catch (SAXException saxe) {
57: IOException ioe = new IOException(saxe.toString());
58: TopManager.getDefault().getErrorManager().annotate(ioe,
59: saxe);
60: throw ioe;
61: }
62: }
63: }
|