All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aiwiown.face.internal.parser.xml.ObjectXmlParser Maven / Gradle / Ivy

There is a newer version: 3.0.9
Show newest version
package com.aiwiown.face.internal.parser.xml;

import com.aiwiown.face.ApiException;
import com.aiwiown.face.ApiParser;
import com.aiwiown.face.ApiResponse;
import com.aiwiown.face.internal.mapping.Converter;

/**
 * 单个JSON对象解释器。
 *
 * @author carver.gu
 * @since 1.0, Apr 11, 2010
 */
public class ObjectXmlParser implements ApiParser {

    private Class clazz;

    public ObjectXmlParser(Class clazz) {
        this.clazz = clazz;
    }
    @Override
    public T parse(String rsp) throws ApiException {
        Converter converter = new XmlConverter();
        return converter.toResponse(rsp, clazz);
    }
    @Override
    public Class getResponseClass() {
        return clazz;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy