mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-26 05:52:06 +01:00
Remove java.beans dependency
The java.beans package is not available on all platforms (e.g. Android).
This commit is contained in:
parent
d655e130ca
commit
b9f07046d3
1 changed files with 5 additions and 5 deletions
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
package org.jivesoftware.smack.util;
|
||||
|
||||
import java.beans.PropertyDescriptor;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
|
@ -832,14 +831,15 @@ public class PacketParserUtils {
|
|||
if (eventType == XmlPullParser.START_TAG) {
|
||||
String name = parser.getName();
|
||||
String stringValue = parser.nextText();
|
||||
PropertyDescriptor descriptor = new PropertyDescriptor(name, objectClass);
|
||||
// Load the class type of the property.
|
||||
Class<?> propertyType = descriptor.getPropertyType();
|
||||
Class<?> propertyType = object.getClass().getMethod(
|
||||
"get" + Character.toUpperCase(name.charAt(0)) + name.substring(1)).getReturnType();
|
||||
// Get the value of the property by converting it from a
|
||||
// String to the correct object type.
|
||||
Object value = decode(propertyType, stringValue);
|
||||
// Set the value of the bean.
|
||||
descriptor.getWriteMethod().invoke(object, value);
|
||||
object.getClass().getMethod(
|
||||
"set" + Character.toUpperCase(name.charAt(0)) + name.substring(1),
|
||||
propertyType).invoke(object, value);
|
||||
}
|
||||
else if (eventType == XmlPullParser.END_TAG) {
|
||||
if (parser.getName().equals(elementName)) {
|
||||
|
|
Loading…
Reference in a new issue