本文整理汇总了Java中com.sun.jersey.api.model.AbstractSubResourceMethod类的典型用法代码示例。如果您正苦于以下问题:Java AbstractSubResourceMethod类的具体用法?Java AbstractSubResourceMethod怎么用?Java AbstractSubResourceMethod使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractSubResourceMethod类属于com.sun.jersey.api.model包,在下文中一共展示了AbstractSubResourceMethod类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compare
import com.sun.jersey.api.model.AbstractSubResourceMethod; //导入依赖的package包/类
@Override
public int compare(AbstractSubResourceMethod a, AbstractSubResourceMethod b) {
int pathComparison = AlphanumComparatorBase.cmp(a.getPath(), b.getPath());
if (pathComparison != 0) {
return pathComparison;
} else {
return AlphanumComparatorBase.cmp(a.getHttpMethod(), b.getHttpMethod());
}
}
示例2: getTransactionName
import com.sun.jersey.api.model.AbstractSubResourceMethod; //导入依赖的package包/类
@Override
@Nonnull
public String getTransactionName(AbstractResourceMethod am) {
String transactionName = getPathWithoutSurroundingSlashes(am.getResource().getPath());
if (!transactionName.isEmpty()) {
transactionName = "/" + transactionName;
}
String httpMethod;
if (am instanceof AbstractSubResourceMethod) {
// if this is a subresource, add on the subresource's path component
AbstractSubResourceMethod asrm = (AbstractSubResourceMethod) am;
transactionName += "/" + getPathWithoutSurroundingSlashes(asrm.getPath());
httpMethod = asrm.getHttpMethod();
} else {
httpMethod = am.getHttpMethod();
}
if (transactionName.isEmpty()) {
// this happens for WadlResource -- that case actually exists at "application.wadl" though
transactionName = "(no path)";
}
transactionName += " " + httpMethod;
return transactionName;
}
示例3: testGetMetricIdClassWithPathMethodWithPath
import com.sun.jersey.api.model.AbstractSubResourceMethod; //导入依赖的package包/类
@Test
public void testGetMetricIdClassWithPathMethodWithPath() {
AbstractResource resource = new AbstractResource(FooResource.class, new PathValue("/res"));
AbstractResourceMethod method =
new AbstractSubResourceMethod(resource, null, Void.class, Void.class, new PathValue("/meth"), "GET",
new Annotation[]{});
assertEquals("/res/meth GET", namer.getTransactionName(method));
}
示例4: testGetMetricIdClassWithoutPathMethodWithPath
import com.sun.jersey.api.model.AbstractSubResourceMethod; //导入依赖的package包/类
@Test
public void testGetMetricIdClassWithoutPathMethodWithPath() {
AbstractResource resource = new AbstractResource(FooResource.class, null);
AbstractResourceMethod method =
new AbstractSubResourceMethod(resource, null, Void.class, Void.class, new PathValue("/meth"), "GET",
new Annotation[]{});
assertEquals("/meth GET", namer.getTransactionName(method));
}
示例5: getMetricBaseName
import com.sun.jersey.api.model.AbstractSubResourceMethod; //导入依赖的package包/类
@Nonnull
@Override
public String getMetricBaseName(AbstractResourceMethod am) {
String metricId = getPathWithoutSurroundingSlashes(am.getResource().getPath());
if (!metricId.isEmpty()) {
metricId = "/" + metricId;
}
String httpMethod;
if (am instanceof AbstractSubResourceMethod) {
// if this is a subresource, add on the subresource's path component
AbstractSubResourceMethod asrm = (AbstractSubResourceMethod) am;
metricId += "/" + getPathWithoutSurroundingSlashes(asrm.getPath());
httpMethod = asrm.getHttpMethod();
} else {
httpMethod = am.getHttpMethod();
}
if (metricId.isEmpty()) {
// this happens for WadlResource -- that case actually exists at "application.wadl" though
metricId = "_no path_";
}
metricId += " " + httpMethod;
return metricId;
}
示例6: testGetMetricIdClassWithPathMethodWithPath
import com.sun.jersey.api.model.AbstractSubResourceMethod; //导入依赖的package包/类
@Test
public void testGetMetricIdClassWithPathMethodWithPath() {
AbstractResource resource = new AbstractResource(FooResource.class, new PathValue("/res"));
AbstractResourceMethod method =
new AbstractSubResourceMethod(resource, null, Void.class, Void.class, new PathValue("/meth"), "GET",
new Annotation[]{});
assertEquals("/res/meth GET", namer.getMetricBaseName(method));
}
示例7: testGetMetricIdClassWithoutPathMethodWithPath
import com.sun.jersey.api.model.AbstractSubResourceMethod; //导入依赖的package包/类
@Test
public void testGetMetricIdClassWithoutPathMethodWithPath() {
AbstractResource resource = new AbstractResource(FooResource.class, null);
AbstractResourceMethod method =
new AbstractSubResourceMethod(resource, null, Void.class, Void.class, new PathValue("/meth"), "GET",
new Annotation[]{});
assertEquals("/meth GET", namer.getMetricBaseName(method));
}