本文整理匯總了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));
}