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


Java MetadataMap类代码示例

本文整理汇总了Java中org.apache.cxf.jaxrs.impl.MetadataMap的典型用法代码示例。如果您正苦于以下问题:Java MetadataMap类的具体用法?Java MetadataMap怎么用?Java MetadataMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MetadataMap类属于org.apache.cxf.jaxrs.impl包,在下文中一共展示了MetadataMap类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newFindAllParameters

import org.apache.cxf.jaxrs.impl.MetadataMap; //导入依赖的package包/类
private UriInfo newFindAllParameters() {
	final UriInfo uriInfo = Mockito.mock(UriInfo.class);
	Mockito.when(uriInfo.getQueryParameters()).thenReturn(new MetadataMap<>());
	uriInfo.getQueryParameters().add("draw", "1");
	uriInfo.getQueryParameters().add("start", "0");
	uriInfo.getQueryParameters().add("length", "10");
	uriInfo.getQueryParameters().add("columns[0][data]", "name");
	uriInfo.getQueryParameters().add("order[0][column]", "0");
	uriInfo.getQueryParameters().add("order[0][dir]", "asc");
	return uriInfo;
}
 
开发者ID:ligoj,项目名称:plugin-id-ldap,代码行数:12,代码来源:DelegateLdapResourceTest.java

示例2: newFindAllParameters

import org.apache.cxf.jaxrs.impl.MetadataMap; //导入依赖的package包/类
private UriInfo newFindAllParameters() {
	final UriInfo uriInfo = Mockito.mock(UriInfo.class);
	Mockito.when(uriInfo.getQueryParameters()).thenReturn(new MetadataMap<>());
	uriInfo.getQueryParameters().add("draw", "1");
	uriInfo.getQueryParameters().add("start", "0");
	uriInfo.getQueryParameters().add("length", "10");
	uriInfo.getQueryParameters().add("columns[0][data]", "name");
	uriInfo.getQueryParameters().add("order[0][column]", "0");
	uriInfo.getQueryParameters().add("order[0][dir]", "desc");
	return uriInfo;
}
 
开发者ID:ligoj,项目名称:plugin-id,代码行数:12,代码来源:ContainerScopeResourceTest.java

示例3: getSearchSelect2

import org.apache.cxf.jaxrs.impl.MetadataMap; //导入依赖的package包/类
@Test
public void getSearchSelect2() {
	final UriInfo uriInfo = Mockito.mock(UriInfo.class);
	Mockito.when(uriInfo.getQueryParameters()).thenReturn(new MetadataMap<String, String>());
	uriInfo.getQueryParameters().add("q", "  S1 ");
	Assert.assertEquals("S1", DataTableAttributes.getSearch(uriInfo));
}
 
开发者ID:ligoj,项目名称:bootstrap,代码行数:8,代码来源:DataTableAttributesTest.java

示例4: getSearchDataTable

import org.apache.cxf.jaxrs.impl.MetadataMap; //导入依赖的package包/类
@Test
public void getSearchDataTable() {
	final UriInfo uriInfo = Mockito.mock(UriInfo.class);
	Mockito.when(uriInfo.getQueryParameters()).thenReturn(new MetadataMap<String, String>());
	uriInfo.getQueryParameters().add(DataTableAttributes.SEARCH, "  S1 ");
	Assert.assertEquals("S1", DataTableAttributes.getSearch(uriInfo));
}
 
开发者ID:ligoj,项目名称:bootstrap,代码行数:8,代码来源:DataTableAttributesTest.java

示例5: getSearchDataTableToNull

import org.apache.cxf.jaxrs.impl.MetadataMap; //导入依赖的package包/类
@Test
public void getSearchDataTableToNull() {
	final UriInfo uriInfo = Mockito.mock(UriInfo.class);
	Mockito.when(uriInfo.getQueryParameters()).thenReturn(new MetadataMap<String, String>());
	uriInfo.getQueryParameters().add(DataTableAttributes.SEARCH, "   ");
	Assert.assertTrue(DataTableAttributes.getSearch(uriInfo).length() == 0);
}
 
开发者ID:ligoj,项目名称:bootstrap,代码行数:8,代码来源:DataTableAttributesTest.java

示例6: bindCamelHeadersToRequestHeaders

import org.apache.cxf.jaxrs.impl.MetadataMap; //导入依赖的package包/类
public MultivaluedMap<String, String> bindCamelHeadersToRequestHeaders(Map<String, Object> camelHeaders,
                                                                       Exchange camelExchange)
    throws Exception {

    MultivaluedMap<String, String> answer = new MetadataMap<String, String>();
    for (Map.Entry<String, Object> entry : camelHeaders.entrySet()) {
        // Need to make sure the cxf needed header will not be filtered 
        if (headerFilterStrategy.applyFilterToCamelHeaders(entry.getKey(), entry.getValue(), camelExchange)
            && camelToCxfHeaderMap.get(entry.getKey()) == null) {
            LOG.trace("Drop Camel header: {}={}", entry.getKey(), entry.getValue());
            continue;
        }
        
        // we need to make sure the entry value is not null
        if (entry.getValue() == null) {
            LOG.trace("Drop Camel header: {}={}", entry.getKey(), entry.getValue());
            continue;
        }
        
        String mappedHeaderName = camelToCxfHeaderMap.get(entry.getKey());
        if (mappedHeaderName == null) {
            mappedHeaderName = entry.getKey();
        }
        
        LOG.trace("Propagate Camel header: {}={} as {}",
            new Object[]{entry.getKey(), entry.getValue(), mappedHeaderName});
        
        answer.putSingle(mappedHeaderName, entry.getValue().toString());
    }
    return answer;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:32,代码来源:DefaultCxfRsBinding.java

示例7: testReadFrom

import org.apache.cxf.jaxrs.impl.MetadataMap; //导入依赖的package包/类
@Test
public void testReadFrom() throws Exception {
    DataFormatProvider<Book> p = new DataFormatProvider<Book>();
    p.setFormat("text/plain", new TestDataFormat());

    ByteArrayInputStream bis = new ByteArrayInputStream("dataformat".getBytes());
    Book b = p.readFrom(Book.class, Book.class, new Annotation[] {}, MediaType.TEXT_PLAIN_TYPE,
                        new MetadataMap<String, String>(), bis);
    assertEquals("dataformat", b.getName());
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:11,代码来源:DataFormatProviderTest.java

示例8: testWriteTo

import org.apache.cxf.jaxrs.impl.MetadataMap; //导入依赖的package包/类
@Test
public void testWriteTo() throws Exception {
    DataFormatProvider<Book> p = new DataFormatProvider<Book>();
    p.setFormat("text/plain", new TestDataFormat());

    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    p.writeTo(new Book("dataformat"), Book.class, Book.class, new Annotation[] {},
              MediaType.TEXT_PLAIN_TYPE, new MetadataMap<String, Object>(), bos);
    assertEquals("dataformat", bos.toString());
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:11,代码来源:DataFormatProviderTest.java

示例9: createMap

import org.apache.cxf.jaxrs.impl.MetadataMap; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected MultivaluedMap<String, String> createMap(Class<?> clazz) throws Exception {
    if (clazz == MultivaluedMap.class || clazz == Form.class) {
        return new MetadataMap<String, String>();
    }
    return (MultivaluedMap<String, String>)clazz.newInstance();
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:8,代码来源:FormEncodingProvider.java

示例10: addHeader

import org.apache.cxf.jaxrs.impl.MetadataMap; //导入依赖的package包/类
public void addHeader(Message message, String name, String value) {
    HttpHeaders requestHeaders = new HttpHeadersImpl(message);
    MultivaluedMap<String, String> newHeaders = new MetadataMap<String, String>();
    newHeaders.putAll(requestHeaders.getRequestHeaders());
    newHeaders.put(name, Arrays.asList(value));
    message.put(Message.PROTOCOL_HEADERS, newHeaders);
}
 
开发者ID:antoniomaria,项目名称:gazpachoquest,代码行数:8,代码来源:HmacAuthInterceptor.java

示例11: newUriInfo

import org.apache.cxf.jaxrs.impl.MetadataMap; //导入依赖的package包/类
/**
 * Return a new mocked {@link UriInfo} instance.
 * 
 * @return a new mocked {@link UriInfo} instance.
 */
protected UriInfo newUriInfo() {
	final UriInfo uriInfo = Mockito.mock(UriInfo.class);
	Mockito.when(uriInfo.getQueryParameters()).thenReturn(new MetadataMap<String, String>());
	return uriInfo;
}
 
开发者ID:ligoj,项目名称:bootstrap,代码行数:11,代码来源:AbstractDataGeneratorTest.java


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