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


Java AbstractSubResourceMethod类代码示例

本文整理汇总了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());
	}
}
 
开发者ID:phoenixctms,项目名称:ctsms,代码行数:10,代码来源:SubResourceMethodComparator.java

示例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;
}
 
开发者ID:palominolabs,项目名称:jersey-new-relic,代码行数:30,代码来源:ResourceTransactionNamerImpl.java

示例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));
}
 
开发者ID:palominolabs,项目名称:jersey-new-relic,代码行数:10,代码来源:ResourceTransactionNamerImplTest.java

示例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));
}
 
开发者ID:palominolabs,项目名称:jersey-new-relic,代码行数:10,代码来源:ResourceTransactionNamerImplTest.java

示例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;
}
 
开发者ID:palominolabs,项目名称:jersey-metrics-filter,代码行数:30,代码来源:ResourceMetricNamerImpl.java

示例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));
}
 
开发者ID:palominolabs,项目名称:jersey-metrics-filter,代码行数:10,代码来源:ResourceMetricNamerImplTest.java

示例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));
}
 
开发者ID:palominolabs,项目名称:jersey-metrics-filter,代码行数:10,代码来源:ResourceMetricNamerImplTest.java


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