當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。