Code example for XmlSerializer

Methods: attribute

0
    } 
 
    private static class MySerializer implements XmlSerializerAndParser<AuthenticatorDescription> {
        public void writeAsXml(AuthenticatorDescription item, XmlSerializer out)
                throws IOException { 
            out.attribute(null, "type", item.type);
        } 
 
        public AuthenticatorDescription createFromXml(XmlPullParser parser)
                throws IOException, XmlPullParserException { 
            return AuthenticatorDescription.newKey(parser.getAttributeValue(null, "type"));
        } 
    } 
}