本文整理汇总了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);
}
示例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;
}
示例3: VKDefaultParser
import com.vk.sdk.api.model.VKApiModel; //导入依赖的package包/类
public VKDefaultParser(Class<? extends VKApiModel> objectModel) {
mModelClass = objectModel;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}