01: /*
02: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05: package com.sun.portal.desktop.dp.xml;
06:
07: import org.w3c.dom.Element;
08: import org.w3c.dom.Document;
09:
10: import com.sun.portal.desktop.context.DPContext;
11:
12: import com.sun.portal.desktop.dp.DPException;
13: import com.sun.portal.desktop.dp.DPReference;
14: import com.sun.portal.desktop.dp.DPTypes;
15: import com.sun.portal.desktop.dp.DPRoot;
16:
17: class XMLDPReference extends XMLDPAtomic implements DPReference,
18: DPTypes, XMLDPTags {
19:
20: XMLDPReference(DPContext dpc, DPRoot r, Document d, String value) {
21: super (dpc, r, createElement(dpc, d, value));
22: }
23:
24: XMLDPReference(DPContext dpc, DPRoot r, Element e) {
25: super (dpc, r, e);
26: }
27:
28: public String getTag() {
29: return REFERENCE_TAG;
30: }
31:
32: public short getType() {
33: return REFERENCE_DP;
34: }
35:
36: static Element createElement(DPContext dpc, Document d, String ref) {
37: return createElement(dpc, d, REFERENCE_TAG, null, ref);
38: }
39:
40: public void toXML(StringBuffer b, int indent) {
41: if (isDummy()) {
42: return;
43: }
44:
45: indentBuffer(b, indent);
46:
47: appendStartTag(b);
48:
49: b.append(" " + VALUE_KEY + "=\"").append(getValueFromThis())
50: .append("\"");
51:
52: appendMergeAttr(b);
53: appendLockAttr(b);
54: appendAdvancedAttr(b);
55: appendPropagateAttr(b);
56:
57: b.append("/>\n");
58: }
59: }
|