本文整理汇总了Java中com.google.gerrit.extensions.restapi.RestModifyView类的典型用法代码示例。如果您正苦于以下问题:Java RestModifyView类的具体用法?Java RestModifyView怎么用?Java RestModifyView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RestModifyView类属于com.google.gerrit.extensions.restapi包,在下文中一共展示了RestModifyView类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: inputType
import com.google.gerrit.extensions.restapi.RestModifyView; //导入依赖的package包/类
private static Type inputType(RestModifyView<RestResource, Object> m) {
// MyModifyView implements RestModifyView<SomeResource, MyInput>
TypeLiteral<?> typeLiteral = TypeLiteral.get(m.getClass());
// RestModifyView<SomeResource, MyInput>
// This is smart enough to resolve even when there are intervening subclasses, even if they have
// reordered type arguments.
TypeLiteral<?> supertypeLiteral = typeLiteral.getSupertype(RestModifyView.class);
Type supertype = supertypeLiteral.getType();
checkState(
supertype instanceof ParameterizedType,
"supertype of %s is not parameterized: %s",
typeLiteral,
supertypeLiteral);
return ((ParameterizedType) supertype).getActualTypeArguments()[1];
}
开发者ID:gerrit-review,项目名称:gerrit,代码行数:18,代码来源:RestApiServlet.java
示例2: guessRestApiHandler
import com.google.gerrit.extensions.restapi.RestModifyView; //导入依赖的package包/类
private static String guessRestApiHandler() {
StackTraceElement[] trace = Thread.currentThread().getStackTrace();
int i = findRestApiServlet(trace);
if (i < 0) {
return null;
}
try {
for (i--; i >= 0; i--) {
String cn = trace[i].getClassName();
Class<?> cls = Class.forName(cn);
if (RestModifyView.class.isAssignableFrom(cls) && cls != RetryingRestModifyView.class) {
return viewName(cn);
}
}
return null;
} catch (ClassNotFoundException e) {
return null;
}
}
开发者ID:gerrit-review,项目名称:gerrit,代码行数:20,代码来源:NoteDbUpdateManager.java
示例3: create
import com.google.gerrit.extensions.restapi.RestModifyView; //导入依赖的package包/类
@Override
public RestModifyView<ProjectResource, ?> create(ProjectResource parent, IdString id)
throws RestApiException {
if (isDefaultDashboard(id)) {
return createDefault.get();
}
throw new ResourceNotFoundException(id);
}
开发者ID:gerrit-review,项目名称:gerrit,代码行数:9,代码来源:DashboardsCollection.java
示例4: setReviewed
import com.google.gerrit.extensions.restapi.RestModifyView; //导入依赖的package包/类
@Override
public void setReviewed(String path, boolean reviewed) throws RestApiException {
try {
RestModifyView<FileResource, Input> view;
if (reviewed) {
view = putReviewed;
} else {
view = deleteReviewed;
}
view.apply(files.parse(revision, IdString.fromDecoded(path)), new Input());
} catch (Exception e) {
throw asRestApiException("Cannot update reviewed flag", e);
}
}
开发者ID:gerrit-review,项目名称:gerrit,代码行数:15,代码来源:RevisionApiImpl.java
示例5: createView
import com.google.gerrit.extensions.restapi.RestModifyView; //导入依赖的package包/类
@Override
protected RestModifyView<RevisionResource, TestSubmitRuleInput> createView() {
return view;
}
开发者ID:gerrit-review,项目名称:gerrit,代码行数:5,代码来源:TestSubmitTypeCommand.java
示例6: createView
import com.google.gerrit.extensions.restapi.RestModifyView; //导入依赖的package包/类
protected abstract RestModifyView<RevisionResource, TestSubmitRuleInput> createView();
开发者ID:gerrit-review,项目名称:gerrit,代码行数:2,代码来源:BaseTestPrologCommand.java
注:本文中的com.google.gerrit.extensions.restapi.RestModifyView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论