40 Location location = null; |
49 Location location = null; |
41 /** Creates a new instance of XMLEventFactory */ |
50 /** Creates a new instance of XMLEventFactory */ |
42 public XMLEventFactoryImpl() { |
51 public XMLEventFactoryImpl() { |
43 } |
52 } |
44 |
53 |
45 public javax.xml.stream.events.Attribute createAttribute(String localName, String value) { |
54 @Override |
|
55 public Attribute createAttribute(String localName, String value) { |
46 AttributeImpl attr = new AttributeImpl(localName, value); |
56 AttributeImpl attr = new AttributeImpl(localName, value); |
47 if(location != null)attr.setLocation(location); |
57 if(location != null)attr.setLocation(location); |
48 return attr; |
58 return attr; |
49 } |
59 } |
50 |
60 |
51 public javax.xml.stream.events.Attribute createAttribute(javax.xml.namespace.QName name, String value) { |
61 @Override |
|
62 public Attribute createAttribute(QName name, String value) { |
52 return createAttribute(name.getPrefix(), name.getNamespaceURI(), name.getLocalPart(), value); |
63 return createAttribute(name.getPrefix(), name.getNamespaceURI(), name.getLocalPart(), value); |
53 } |
64 } |
54 |
65 |
55 public javax.xml.stream.events.Attribute createAttribute(String prefix, String namespaceURI, String localName, String value) { |
66 @Override |
|
67 public Attribute createAttribute(String prefix, String namespaceURI, String localName, String value) { |
56 AttributeImpl attr = new AttributeImpl(prefix, namespaceURI, localName, value, null); |
68 AttributeImpl attr = new AttributeImpl(prefix, namespaceURI, localName, value, null); |
57 if(location != null)attr.setLocation(location); |
69 if(location != null)attr.setLocation(location); |
58 return attr; |
70 return attr; |
59 } |
71 } |
60 |
72 |
61 public javax.xml.stream.events.Characters createCData(String content) { |
73 @Override |
|
74 public Characters createCData(String content) { |
62 //stax doesn't have separate CDATA event. This is taken care by |
75 //stax doesn't have separate CDATA event. This is taken care by |
63 //CHRACTERS event setting the cdata flag to true. |
76 //CHRACTERS event setting the cdata flag to true. |
64 CharacterEvent charEvent = new CharacterEvent(content, true); |
77 CharacterEvent charEvent = new CharacterEvent(content, true); |
65 if(location != null)charEvent.setLocation(location); |
78 if(location != null)charEvent.setLocation(location); |
66 return charEvent; |
79 return charEvent; |
67 } |
80 } |
68 |
81 |
69 public javax.xml.stream.events.Characters createCharacters(String content) { |
82 @Override |
|
83 public Characters createCharacters(String content) { |
70 CharacterEvent charEvent = new CharacterEvent(content); |
84 CharacterEvent charEvent = new CharacterEvent(content); |
71 if(location != null)charEvent.setLocation(location); |
85 if(location != null)charEvent.setLocation(location); |
72 return charEvent; |
86 return charEvent; |
73 } |
87 } |
74 |
88 |
|
89 @Override |
75 public javax.xml.stream.events.Comment createComment(String text) { |
90 public javax.xml.stream.events.Comment createComment(String text) { |
76 CommentEvent charEvent = new CommentEvent(text); |
91 CommentEvent charEvent = new CommentEvent(text); |
77 if(location != null)charEvent.setLocation(location); |
92 if(location != null)charEvent.setLocation(location); |
78 return charEvent; |
93 return charEvent; |
79 } |
94 } |
80 |
95 |
|
96 @Override |
81 public javax.xml.stream.events.DTD createDTD(String dtd) { |
97 public javax.xml.stream.events.DTD createDTD(String dtd) { |
82 DTDEvent dtdEvent = new DTDEvent(dtd); |
98 DTDEvent dtdEvent = new DTDEvent(dtd); |
83 if(location != null)dtdEvent.setLocation(location); |
99 if(location != null)dtdEvent.setLocation(location); |
84 return dtdEvent; |
100 return dtdEvent; |
85 } |
101 } |
86 |
102 |
|
103 @Override |
87 public javax.xml.stream.events.EndDocument createEndDocument() { |
104 public javax.xml.stream.events.EndDocument createEndDocument() { |
88 EndDocumentEvent event =new EndDocumentEvent(); |
105 EndDocumentEvent event =new EndDocumentEvent(); |
89 if(location != null)event.setLocation(location); |
106 if(location != null)event.setLocation(location); |
90 return event; |
107 return event; |
91 } |
108 } |
92 |
109 |
93 public javax.xml.stream.events.EndElement createEndElement(javax.xml.namespace.QName name, java.util.Iterator namespaces) { |
110 @Override |
|
111 public javax.xml.stream.events.EndElement createEndElement(QName name, |
|
112 Iterator<? extends Namespace> namespaces) { |
94 return createEndElement(name.getPrefix(), name.getNamespaceURI(), name.getLocalPart()); |
113 return createEndElement(name.getPrefix(), name.getNamespaceURI(), name.getLocalPart()); |
95 } |
114 } |
96 |
115 |
97 public javax.xml.stream.events.EndElement createEndElement(String prefix, String namespaceUri, String localName) { |
116 @Override |
|
117 public javax.xml.stream.events.EndElement createEndElement( |
|
118 String prefix, String namespaceUri, String localName) { |
98 EndElementEvent event = new EndElementEvent(prefix, namespaceUri, localName); |
119 EndElementEvent event = new EndElementEvent(prefix, namespaceUri, localName); |
99 if(location != null)event.setLocation(location); |
120 if(location != null)event.setLocation(location); |
100 return event; |
121 return event; |
101 } |
122 } |
102 |
123 |
103 public javax.xml.stream.events.EndElement createEndElement(String prefix, String namespaceUri, String localName, java.util.Iterator namespaces) { |
124 @Override |
|
125 public javax.xml.stream.events.EndElement createEndElement(String prefix, String namespaceUri, |
|
126 String localName, Iterator<? extends Namespace> namespaces) { |
104 |
127 |
105 EndElementEvent event = new EndElementEvent(prefix, namespaceUri, localName); |
128 EndElementEvent event = new EndElementEvent(prefix, namespaceUri, localName); |
106 if(namespaces!=null){ |
129 if(namespaces!=null){ |
107 while(namespaces.hasNext()) |
130 while(namespaces.hasNext()) |
108 event.addNamespace((Namespace)namespaces.next()); |
131 event.addNamespace(namespaces.next()); |
109 } |
132 } |
110 if(location != null)event.setLocation(location); |
133 if(location != null)event.setLocation(location); |
111 return event; |
134 return event; |
112 } |
135 } |
113 |
136 |
114 public javax.xml.stream.events.EntityReference createEntityReference(String name, EntityDeclaration entityDeclaration) { |
137 @Override |
|
138 public EntityReference createEntityReference(String name, EntityDeclaration entityDeclaration) { |
115 EntityReferenceEvent event = new EntityReferenceEvent(name, entityDeclaration); |
139 EntityReferenceEvent event = new EntityReferenceEvent(name, entityDeclaration); |
116 if(location != null)event.setLocation(location); |
140 if(location != null)event.setLocation(location); |
117 return event; |
141 return event; |
118 } |
142 } |
119 |
143 |
120 public javax.xml.stream.events.Characters createIgnorableSpace(String content) { |
144 @Override |
|
145 public Characters createIgnorableSpace(String content) { |
121 CharacterEvent event = new CharacterEvent(content, false, true); |
146 CharacterEvent event = new CharacterEvent(content, false, true); |
122 if(location != null)event.setLocation(location); |
147 if(location != null)event.setLocation(location); |
123 return event; |
148 return event; |
124 } |
149 } |
125 |
150 |
126 public javax.xml.stream.events.Namespace createNamespace(String namespaceURI) { |
151 @Override |
|
152 public Namespace createNamespace(String namespaceURI) { |
127 NamespaceImpl event = new NamespaceImpl(namespaceURI); |
153 NamespaceImpl event = new NamespaceImpl(namespaceURI); |
128 if(location != null)event.setLocation(location); |
154 if(location != null)event.setLocation(location); |
129 return event; |
155 return event; |
130 } |
156 } |
131 |
157 |
132 public javax.xml.stream.events.Namespace createNamespace(String prefix, String namespaceURI) { |
158 @Override |
|
159 public Namespace createNamespace(String prefix, String namespaceURI) { |
133 NamespaceImpl event = new NamespaceImpl(prefix, namespaceURI); |
160 NamespaceImpl event = new NamespaceImpl(prefix, namespaceURI); |
134 if(location != null)event.setLocation(location); |
161 if(location != null)event.setLocation(location); |
135 return event; |
162 return event; |
136 } |
163 } |
137 |
164 |
138 public javax.xml.stream.events.ProcessingInstruction createProcessingInstruction(String target, String data) { |
165 @Override |
|
166 public ProcessingInstruction createProcessingInstruction(String target, String data) { |
139 ProcessingInstructionEvent event = new ProcessingInstructionEvent(target, data); |
167 ProcessingInstructionEvent event = new ProcessingInstructionEvent(target, data); |
140 if(location != null)event.setLocation(location); |
168 if(location != null)event.setLocation(location); |
141 return event; |
169 return event; |
142 } |
170 } |
143 |
171 |
144 public javax.xml.stream.events.Characters createSpace(String content) { |
172 @Override |
|
173 public Characters createSpace(String content) { |
145 CharacterEvent event = new CharacterEvent(content); |
174 CharacterEvent event = new CharacterEvent(content); |
146 if(location != null)event.setLocation(location); |
175 if(location != null)event.setLocation(location); |
147 return event; |
176 return event; |
148 } |
177 } |
149 |
178 |
150 public javax.xml.stream.events.StartDocument createStartDocument() { |
179 @Override |
|
180 public StartDocument createStartDocument() { |
151 StartDocumentEvent event = new StartDocumentEvent(); |
181 StartDocumentEvent event = new StartDocumentEvent(); |
152 if(location != null)event.setLocation(location); |
182 if(location != null)event.setLocation(location); |
153 return event; |
183 return event; |
154 } |
184 } |
155 |
185 |
156 public javax.xml.stream.events.StartDocument createStartDocument(String encoding) { |
186 @Override |
|
187 public StartDocument createStartDocument(String encoding) { |
157 StartDocumentEvent event = new StartDocumentEvent(encoding); |
188 StartDocumentEvent event = new StartDocumentEvent(encoding); |
158 if(location != null)event.setLocation(location); |
189 if(location != null)event.setLocation(location); |
159 return event; |
190 return event; |
160 } |
191 } |
161 |
192 |
162 public javax.xml.stream.events.StartDocument createStartDocument(String encoding, String version) { |
193 @Override |
|
194 public StartDocument createStartDocument(String encoding, String version) { |
163 StartDocumentEvent event = new StartDocumentEvent(encoding, version); |
195 StartDocumentEvent event = new StartDocumentEvent(encoding, version); |
164 if(location != null)event.setLocation(location); |
196 if(location != null)event.setLocation(location); |
165 return event; |
197 return event; |
166 } |
198 } |
167 |
199 |
168 public javax.xml.stream.events.StartDocument createStartDocument(String encoding, String version, boolean standalone) { |
200 @Override |
|
201 public StartDocument createStartDocument(String encoding, String version, boolean standalone) { |
169 StartDocumentEvent event = new StartDocumentEvent(encoding, version, standalone); |
202 StartDocumentEvent event = new StartDocumentEvent(encoding, version, standalone); |
170 if(location != null)event.setLocation(location); |
203 if(location != null)event.setLocation(location); |
171 return event; |
204 return event; |
172 } |
205 } |
173 |
206 |
174 public javax.xml.stream.events.StartElement createStartElement(javax.xml.namespace.QName name, java.util.Iterator attributes, java.util.Iterator namespaces) { |
207 @Override |
175 return createStartElement(name.getPrefix(), name.getNamespaceURI(), name.getLocalPart(), attributes, namespaces); |
208 public StartElement createStartElement(QName name, Iterator<? extends Attribute> attributes, |
176 } |
209 Iterator<? extends Namespace> namespaces) { |
177 |
210 return createStartElement(name.getPrefix(), name.getNamespaceURI(), |
178 public javax.xml.stream.events.StartElement createStartElement(String prefix, String namespaceUri, String localName) { |
211 name.getLocalPart(), attributes, namespaces); |
|
212 } |
|
213 |
|
214 @Override |
|
215 public StartElement createStartElement(String prefix, String namespaceUri, String localName) { |
179 StartElementEvent event = new StartElementEvent(prefix, namespaceUri, localName); |
216 StartElementEvent event = new StartElementEvent(prefix, namespaceUri, localName); |
180 if(location != null)event.setLocation(location); |
217 if(location != null)event.setLocation(location); |
181 return event; |
218 return event; |
182 } |
219 } |
183 |
220 |
184 public javax.xml.stream.events.StartElement createStartElement(String prefix, String namespaceUri, String localName, java.util.Iterator attributes, java.util.Iterator namespaces) { |
221 @Override |
|
222 public StartElement createStartElement(String prefix, String namespaceUri, |
|
223 String localName, Iterator<? extends Attribute> attributes, |
|
224 Iterator<? extends Namespace> namespaces) { |
185 return createStartElement(prefix, namespaceUri, localName, attributes, namespaces, null); |
225 return createStartElement(prefix, namespaceUri, localName, attributes, namespaces, null); |
186 } |
226 } |
187 |
227 |
188 public javax.xml.stream.events.StartElement createStartElement(String prefix, String namespaceUri, String localName, java.util.Iterator attributes, java.util.Iterator namespaces, javax.xml.namespace.NamespaceContext context) { |
228 @Override |
|
229 public StartElement createStartElement(String prefix, String namespaceUri, |
|
230 String localName, Iterator<? extends Attribute> attributes, |
|
231 Iterator<? extends Namespace> namespaces, NamespaceContext context) { |
189 StartElementEvent elem = new StartElementEvent(prefix, namespaceUri, localName); |
232 StartElementEvent elem = new StartElementEvent(prefix, namespaceUri, localName); |
190 elem.addAttributes(attributes); |
233 elem.addAttributes(attributes); |
191 elem.addNamespaceAttributes(namespaces); |
234 elem.addNamespaceAttributes(namespaces); |
192 elem.setNamespaceContext(context); |
235 elem.setNamespaceContext(context); |
193 if(location != null)elem.setLocation(location); |
236 if(location != null)elem.setLocation(location); |
194 return elem; |
237 return elem; |
195 } |
238 } |
196 |
239 |
|
240 @Override |
197 public void setLocation(javax.xml.stream.Location location) { |
241 public void setLocation(javax.xml.stream.Location location) { |
198 this.location = location; |
242 this.location = location; |
199 } |
243 } |
200 |
244 |
201 } |
245 } |