1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package com.bea.xml.stream.events;
17 import javax.xml.stream.events.XMLEvent;
18 import javax.xml.stream.events.ProcessingInstruction;
19 import javax.xml.namespace.QName;
20 public class ProcessingInstructionEvent
21 extends BaseEvent
22 implements ProcessingInstruction
23 {
24 String name;
25 String content;
26 public ProcessingInstructionEvent() {super();init();}
27 public ProcessingInstructionEvent(String name, String content) {
28 super(); init();
29 this.name = name;
30 this.content=content;
31 }
32 protected void init() {setEventType(XMLEvent.PROCESSING_INSTRUCTION); }
33 public String getTarget() {
34 return name;
35 }
36 public void setTarget(String target) {
37 name= target;
38 }
39 public void setData(String data) {
40 this.content = data;
41 }
42 public String getData() {
43 return content;
44 }
45 public String toString() {
46 if (content != null &&
47 name != null)
48 return("<?"+name+content+"?>");
49 else if (name != null)
50 return("<?"+name+"?>");
51 else if (content != null)
52 return("<?"+content+"?>");
53 return("<??>");
54 }
55 }