当前位置: 首页>>代码示例>>Java>>正文


Java VKApiModel类代码示例

本文整理汇总了Java中com.vk.sdk.api.model.VKApiModel的典型用法代码示例。如果您正苦于以下问题:Java VKApiModel类的具体用法?Java VKApiModel怎么用?Java VKApiModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


VKApiModel类属于com.vk.sdk.api.model包,在下文中一共展示了VKApiModel类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: VKRequest

import com.vk.sdk.api.model.VKApiModel; //导入依赖的package包/类
/**
 * Creates new request with parameters. See documentation for methods here https://vk.com/dev/methods
 *
 * @param method     API-method name, e.g. audio.get
 * @param parameters method parameters
 * @param modelClass class for automatic parse
 */
public VKRequest(String method, VKParameters parameters, Class<? extends VKApiModel> modelClass) {
    this.context = VKUIHelper.getApplicationContext();

    this.methodName = method;
    if (parameters == null) {
        parameters = new VKParameters();
    }
    this.mMethodParameters = new VKParameters(parameters);
    this.mAttemptsUsed = 0;

    this.secure = true;
    //By default there is 1 attempt for loading.
    this.attempts = 1;

    //If system language is not supported, we use english
    this.mPreferredLang = "en";
    //By default we use system language.
    this.useSystemLanguage = true;

    this.shouldInterruptUI = true;

    setModelClass(modelClass);
}
 
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:31,代码来源:VKRequest.java

示例2: createModel

import com.vk.sdk.api.model.VKApiModel; //导入依赖的package包/类
@Override
public Object createModel(JSONObject object) {
    try {
        VKApiModel model = mModelClass.newInstance();
        model.parse(object);
        return model;
    } catch (Exception e) {
        if (VKSdk.DEBUG)
            e.printStackTrace();
    }
    return null;
}
 
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:13,代码来源:VKDefaultParser.java

示例3: VKDefaultParser

import com.vk.sdk.api.model.VKApiModel; //导入依赖的package包/类
public VKDefaultParser(Class<? extends VKApiModel> objectModel) {
    mModelClass = objectModel;
}
 
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:4,代码来源:VKDefaultParser.java

示例4: prepareRequest

import com.vk.sdk.api.model.VKApiModel; //导入依赖的package包/类
protected VKRequest prepareRequest(String methodName, VKParameters methodParameters,
                                   Class<? extends VKApiModel> modelClass) {
    return new VKRequest(String.format(Locale.US, "%s.%s", getMethodsGroup(), methodName), methodParameters, modelClass);
}
 
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:5,代码来源:VKApiBase.java

示例5: setModelClass

import com.vk.sdk.api.model.VKApiModel; //导入依赖的package包/类
/**
 * Sets class for parse object model
 *
 * @param modelClass Class extends VKApiModel
 */
public void setModelClass(Class<? extends VKApiModel> modelClass) {
    mModelClass = modelClass;
    if (mModelClass != null)
        parseModel = true;
}
 
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:11,代码来源:VKRequest.java

示例6: prepareRequest

import com.vk.sdk.api.model.VKApiModel; //导入依赖的package包/类
VKRequest prepareRequest(String methodName, VKParameters methodParameters,
                         VKRequest.HttpMethod httpMethod,
                         Class<? extends VKApiModel> modelClass) {
    return new VKRequest(String.format(Locale.US, "%s.%s", mMethodGroup, methodName),
            methodParameters, httpMethod, modelClass);
}
 
开发者ID:DementorAl,项目名称:VkAdmin,代码行数:7,代码来源:VKApiBase.java

示例7: setModelClass

import com.vk.sdk.api.model.VKApiModel; //导入依赖的package包/类
/**
 * Sets class for parse object model
 * @param modelClass Class extends VKApiModel
 */
public void setModelClass(Class<? extends VKApiModel> modelClass) {
    mModelClass = modelClass;
    if (mModelClass != null)
        parseModel = true;
}
 
开发者ID:DementorAl,项目名称:VkAdmin,代码行数:10,代码来源:VKRequest.java

示例8: VKModelOperation

import com.vk.sdk.api.model.VKApiModel; //导入依赖的package包/类
/**
 * Create new model operation
 *
 * @param uriRequest Prepared request
 * @param modelClass Model for parsing response
 */
public VKModelOperation(VKHttpClient.VKHTTPRequest uriRequest, Class<? extends VKApiModel> modelClass) {
    super(uriRequest);
    mParser = new VKDefaultParser(modelClass);
}
 
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:11,代码来源:VKModelOperation.java

示例9: VKModelOperation

import com.vk.sdk.api.model.VKApiModel; //导入依赖的package包/类
/**
 * Create new model operation
 * @param uriRequest Prepared request
 * @param modelClass Model for parsing response
 */
public VKModelOperation(HttpUriRequest uriRequest, Class<? extends VKApiModel> modelClass) {
    super(uriRequest);
    mParser = new VKDefaultParser(modelClass);
}
 
开发者ID:DementorAl,项目名称:VkAdmin,代码行数:10,代码来源:VKModelOperation.java

示例10: VKRequest

import com.vk.sdk.api.model.VKApiModel; //导入依赖的package包/类
/**
 * Creates new request with parameters. See documentation for methods here https://vk.com/dev/methods
 *
 * @param method     API-method name, e.g. audio.get
 * @param parameters method parameters
 * @param httpMethod HTTP method for execution, e.g. GET, POST
 * @param modelClass class for automatic parse
 */
public VKRequest(String method, VKParameters parameters, HttpMethod httpMethod,
                 Class<? extends VKApiModel> modelClass) {
    this(method, parameters, httpMethod);
    setModelClass(modelClass);
}
 
开发者ID:DementorAl,项目名称:VkAdmin,代码行数:14,代码来源:VKRequest.java


注:本文中的com.vk.sdk.api.model.VKApiModel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。