MCPcopy Create free account
hub / github.com/dumbledore/AlbiteREADER / parse

Method parse

src/org/kxml2/kdom/Element.java:196–233  ·  view source on GitHub ↗

Builds the child elements from the given Parser. By overwriting parse, an element can take complete control over parsing its subtree.

(XmlPullParser parser)

Source from the content-addressed store, hash-verified

194 * subtree. */
195
196 public void parse(XmlPullParser parser)
197 throws IOException, XmlPullParserException {
198
199 for (int i = parser.getNamespaceCount (parser.getDepth () - 1);
200 i < parser.getNamespaceCount (parser.getDepth ()); i++) {
201 setPrefix (parser.getNamespacePrefix (i), parser.getNamespaceUri(i));
202 }
203
204
205 for (int i = 0; i < parser.getAttributeCount (); i++)
206 setAttribute (parser.getAttributeNamespace (i),
207// parser.getAttributePrefix (i),
208 parser.getAttributeName (i),
209 parser.getAttributeValue (i));
210
211
212 // if (prefixMap == null) throw new RuntimeException ("!!");
213
214 init();
215
216
217 if (parser.isEmptyElementTag())
218 parser.nextToken ();
219 else {
220 parser.nextToken ();
221 super.parse(parser);
222
223 if (getChildCount() == 0)
224 addChild(IGNORABLE_WHITESPACE, "");
225 }
226
227 parser.require(
228 XmlPullParser.END_TAG,
229 getNamespace(),
230 getName());
231
232 parser.nextToken ();
233 }
234
235
236 /**

Callers 1

parseMethod · 0.95

Calls 15

setPrefixMethod · 0.95
setAttributeMethod · 0.95
initMethod · 0.95
getNamespaceMethod · 0.95
getNameMethod · 0.95
getDepthMethod · 0.80
isEmptyElementTagMethod · 0.80
nextTokenMethod · 0.80
getChildCountMethod · 0.80
requireMethod · 0.80
getNamespaceCountMethod · 0.45
getNamespacePrefixMethod · 0.45

Tested by

no test coverage detected