Lines Matching refs:parser
205 XmlResourceParser parser = mSourceRes.getXml(layoutId);
206 beginDocument(parser, mRootTag);
207 final int depth = parser.getDepth();
212 while (((type = parser.next()) != XmlPullParser.END_TAG ||
213 parser.getDepth() > depth) && type != XmlPullParser.END_DOCUMENT) {
217 count += parseAndAddNode(parser, tagParserMap, screenIds);
226 protected void parseContainerAndScreen(XmlResourceParser parser, long[] out) {
227 if (HOTSEAT_CONTAINER_NAME.equals(getAttributeValue(parser, ATTR_CONTAINER))) {
230 long rank = Long.parseLong(getAttributeValue(parser, ATTR_RANK));
234 out[1] = Long.parseLong(getAttributeValue(parser, ATTR_SCREEN));
242 XmlResourceParser parser,
247 if (TAG_INCLUDE.equals(parser.getName())) {
248 final int resId = getAttributeResourceValue(parser, ATTR_WORKSPACE, 0);
258 parseContainerAndScreen(parser, mTemp);
264 mValues.put(Favorites.CELLX, getAttributeValue(parser, ATTR_X));
265 mValues.put(Favorites.CELLY, getAttributeValue(parser, ATTR_Y));
267 TagParser tagParser = tagParserMap.get(parser.getName());
269 if (LOGD) Log.d(TAG, "Ignoring unknown element tag: " + parser.getName());
272 long newElementId = tagParser.parseAndAdd(parser);
322 long parseAndAdd(XmlResourceParser parser)
332 public long parseAndAdd(XmlResourceParser parser) {
333 final String packageName = getAttributeValue(parser, ATTR_PACKAGE_NAME);
334 final String className = getAttributeValue(parser, ATTR_CLASS_NAME);
362 return invalidPackageOrClass(parser);
367 * Helper method to allow extending the parser capabilities
369 protected long invalidPackageOrClass(XmlResourceParser parser) {
381 public long parseAndAdd(XmlResourceParser parser) {
382 final String packageName = getAttributeValue(parser, ATTR_PACKAGE_NAME);
383 final String className = getAttributeValue(parser, ATTR_CLASS_NAME);
412 public long parseAndAdd(XmlResourceParser parser) {
413 final int titleResId = getAttributeResourceValue(parser, ATTR_TITLE, 0);
414 final int iconId = getAttributeResourceValue(parser, ATTR_ICON, 0);
421 final Intent intent = parseIntent(parser);
443 protected Intent parseIntent(XmlResourceParser parser) {
444 final String url = getAttributeValue(parser, ATTR_URL);
454 * AppWidget parser: Required attributes packageName, className, spanX and spanY.
460 public long parseAndAdd(XmlResourceParser parser)
462 final String packageName = getAttributeValue(parser, ATTR_PACKAGE_NAME);
463 final String className = getAttributeValue(parser, ATTR_CLASS_NAME);
484 mValues.put(Favorites.SPANX, getAttributeValue(parser, ATTR_SPAN_X));
485 mValues.put(Favorites.SPANY, getAttributeValue(parser, ATTR_SPAN_Y));
489 int widgetDepth = parser.getDepth();
491 while ((type = parser.next()) != XmlPullParser.END_TAG ||
492 parser.getDepth() > widgetDepth) {
497 if (TAG_EXTRA.equals(parser.getName())) {
498 String key = getAttributeValue(parser, ATTR_KEY);
499 String value = getAttributeValue(parser, ATTR_VALUE);
557 public long parseAndAdd(XmlResourceParser parser)
560 final int titleResId = getAttributeResourceValue(parser, ATTR_TITLE, 0);
582 int folderDepth = parser.getDepth();
584 while ((type = parser.next()) != XmlPullParser.END_TAG ||
585 parser.getDepth() > folderDepth) {
593 TagParser tagParser = mFolderElements.get(parser.getName());
595 final long id = tagParser.parseAndAdd(parser);
601 throw new RuntimeException("Invalid folder item " + parser.getName());
635 protected static final void beginDocument(XmlPullParser parser, String firstElementName)
638 while ((type = parser.next()) != XmlPullParser.START_TAG
645 if (!parser.getName().equals(firstElementName)) {
646 throw new XmlPullParserException("Unexpected start tag: found " + parser.getName() +
655 protected static String getAttributeValue(XmlResourceParser parser, String attribute) {
656 String value = parser.getAttributeValue(
659 value = parser.getAttributeValue(null, attribute);
668 protected static int getAttributeResourceValue(XmlResourceParser parser, String attribute,
670 int value = parser.getAttributeResourceValue(
674 value = parser.getAttributeResourceValue(null, attribute, defaultValue);