@Test public void parse() { XTokenIQ element = parseString(stringToken); assertNotNull(element); assertEquals("VkpTYqfpPcLpwciTRtgHaV7BC9O9kY", element.getToken()); assertEquals("49975a48609793c5c93f5e9264f6706f04164", element.getUid()); assertEquals(1536322632000L, element.getExpire()); }
@Override public XTokenIQ parse(XmlPullParser parser, int initialDepth) throws Exception { String token = null; String tokenUID = null; long expire = 0; outerloop: while (true) { int eventType = parser.getEventType(); switch (eventType) { case XmlPullParser.START_TAG: if (XTokenIQ.ELEMENT.equals(parser.getName()) && XTokenIQ.NAMESPACE.equals(parser.getNamespace())) { parser.next(); } else if (XTokenIQ.ELEMENT_TOKEN.equals(parser.getName())) { token = parser.nextText(); } else if (XTokenIQ.ELEMENT_TOKEN_UID.equals(parser.getName())) { tokenUID = parser.nextText(); } else if (XTokenIQ.ELEMENT_EXPIRE.equals(parser.getName())) { expire = Long.valueOf(parser.nextText()); } else parser.next(); break; case XmlPullParser.END_TAG: if (XTokenIQ.ELEMENT.equals(parser.getName())) { break outerloop; } else parser.next(); break; default: parser.next(); } } if (token != null && tokenUID != null) return new XTokenIQ(token, tokenUID, TimeUnit.SECONDS.toMillis(expire)); else return null; }
XTokenProvider extends IQProvider<XTokenIQ> { @Override public XTokenIQ parse(XmlPullParser parser, int initialDepth) throws Exception { String token = null; String tokenUID = null; long expire = 0; outerloop: while (true) { int eventType = parser.getEventType(); switch (eventType) { case XmlPullParser.START_TAG: if (XTokenIQ.ELEMENT.equals(parser.getName()) && XTokenIQ.NAMESPACE.equals(parser.getNamespace())) { parser.next(); } else if (XTokenIQ.ELEMENT_TOKEN.equals(parser.getName())) { token = parser.nextText(); } else if (XTokenIQ.ELEMENT_TOKEN_UID.equals(parser.getName())) { tokenUID = parser.nextText(); } else if (XTokenIQ.ELEMENT_EXPIRE.equals(parser.getName())) { expire = Long.valueOf(parser.nextText()); } else parser.next(); break; case XmlPullParser.END_TAG: if (XTokenIQ.ELEMENT.equals(parser.getName())) { break outerloop; } else parser.next(); break; default: parser.next(); } } if (token != null && tokenUID != null) return new XTokenIQ(token, tokenUID, TimeUnit.SECONDS.toMillis(expire)); else return null; } }
XTokenProvider extends IQProvider<XTokenIQ> { @Override public XTokenIQ parse(XmlPullParser parser, int initialDepth) throws Exception { String token = null; String tokenUID = null; long expire = 0; outerloop: while (true) { int eventType = parser.getEventType(); switch (eventType) { case XmlPullParser.START_TAG: if (XTokenIQ.ELEMENT.equals(parser.getName()) && XTokenIQ.NAMESPACE.equals(parser.getNamespace())) { parser.next(); } else if (XTokenIQ.ELEMENT_TOKEN.equals(parser.getName())) { token = parser.nextText(); } else if (XTokenIQ.ELEMENT_TOKEN_UID.equals(parser.getName())) { tokenUID = parser.nextText(); } else if (XTokenIQ.ELEMENT_EXPIRE.equals(parser.getName())) { expire = Long.valueOf(parser.nextText()); } else parser.next(); break; case XmlPullParser.END_TAG: if (XTokenIQ.ELEMENT.equals(parser.getName())) { break outerloop; } else parser.next(); break; default: parser.next(); } } if (token != null && tokenUID != null) return new XTokenIQ(token, tokenUID, TimeUnit.SECONDS.toMillis(expire)); else return null; }  }
XTokenProvider extends IQProvider<XTokenIQ> { @Override public XTokenIQ parse(XmlPullParser parser, int initialDepth) throws Exception { String token = null; String tokenUID = null; long expire = 0; outerloop: while (true) { int eventType = parser.getEventType(); switch (eventType) { case XmlPullParser.START_TAG: if (XTokenIQ.ELEMENT.equals(parser.getName()) && XTokenIQ.NAMESPACE.equals(parser.getNamespace())) { parser.next(); } else if (XTokenIQ.ELEMENT_TOKEN.equals(parser.getName())) { token = parser.nextText(); } else if (XTokenIQ.ELEMENT_TOKEN_UID.equals(parser.getName())) { tokenUID = parser.nextText(); } else if (XTokenIQ.ELEMENT_EXPIRE.equals(parser.getName())) { expire = Long.valueOf(parser.nextText()); } else parser.next(); break; case XmlPullParser.END_TAG: if (XTokenIQ.ELEMENT.equals(parser.getName())) { break outerloop; } else parser.next(); break; default: parser.next(); } } if (token != null && tokenUID != null) return new XTokenIQ(token, tokenUID, TimeUnit.SECONDS.toMillis(expire)); else return null; }  @Override XTokenIQ parse(XmlPullParser parser, int initialDepth); }
XTokenProvider extends IQProvider<XTokenIQ> { @Override public XTokenIQ parse(XmlPullParser parser, int initialDepth) throws Exception { String token = null; String tokenUID = null; long expire = 0; outerloop: while (true) { int eventType = parser.getEventType(); switch (eventType) { case XmlPullParser.START_TAG: if (XTokenIQ.ELEMENT.equals(parser.getName()) && XTokenIQ.NAMESPACE.equals(parser.getNamespace())) { parser.next(); } else if (XTokenIQ.ELEMENT_TOKEN.equals(parser.getName())) { token = parser.nextText(); } else if (XTokenIQ.ELEMENT_TOKEN_UID.equals(parser.getName())) { tokenUID = parser.nextText(); } else if (XTokenIQ.ELEMENT_EXPIRE.equals(parser.getName())) { expire = Long.valueOf(parser.nextText()); } else parser.next(); break; case XmlPullParser.END_TAG: if (XTokenIQ.ELEMENT.equals(parser.getName())) { break outerloop; } else parser.next(); break; default: parser.next(); } } if (token != null && tokenUID != null) return new XTokenIQ(token, tokenUID, TimeUnit.SECONDS.toMillis(expire)); else return null; }  @Override XTokenIQ parse(XmlPullParser parser, int initialDepth);  }