本文整理汇总了Java中com.sun.jersey.spi.inject.Injectable类的典型用法代码示例。如果您正苦于以下问题:Java Injectable类的具体用法?Java Injectable怎么用?Java Injectable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Injectable类属于com.sun.jersey.spi.inject包,在下文中一共展示了Injectable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInjectable
import com.sun.jersey.spi.inject.Injectable; //导入依赖的package包/类
@Override
public Injectable<OffsetDateTime> getInjectable(final ComponentContext cc, final QueryParam a) {
return new Injectable<OffsetDateTime>() {
@Override
public OffsetDateTime getValue() {
final List<String> values = uriInfo.getQueryParameters().get(a.value());
if (values == null || values.isEmpty())
return null;
if (values.size() > 1) {
throw new WebApplicationException(Response.status(Status.BAD_REQUEST).
entity(a.value() + " cannot contain multiple values").build());
}
return OffsetDateTime.parse(values.get(0));
}
};
}
示例2: getInjectable
import com.sun.jersey.spi.inject.Injectable; //导入依赖的package包/类
@Override
public Injectable<LocalDate> getInjectable(final ComponentContext cc, final QueryParam a) {
return new Injectable<LocalDate>() {
@Override
public LocalDate getValue() {
final List<String> values = uriInfo.getQueryParameters().get(a.value());
if (values == null || values.isEmpty())
return null;
if (values.size() > 1) {
throw new WebApplicationException(Response.status(Status.BAD_REQUEST).
entity(a.value() + " cannot contain multiple values").build());
}
return LocalDate.parse(values.get(0));
}
};
}
示例3: getInjectable
import com.sun.jersey.spi.inject.Injectable; //导入依赖的package包/类
@Override
public Injectable<Object> getInjectable(ComponentContext ic, ModelParam mp, Type type) {
if (type instanceof Class && Model.class.isAssignableFrom((Class<?>) type)) {
return new ModelInjectableProvider(type);
} else if (type instanceof ParameterizedType) {
List<Class<?>> genTypes = Reflect.getGenericType(type);
Class<?> genType = genTypes != null && genTypes.size() > 0 ? genTypes.get(0) : null;
if (genType != null && Model.class.isAssignableFrom(genType)) {
return new ModelInjectableProvider(type);
}
}
return null;
}
开发者ID:geetools,项目名称:geeCommerce-Java-Shop-Software-and-PIM,代码行数:17,代码来源:ModelInjectableProvider.java
示例4: getInjectable
import com.sun.jersey.spi.inject.Injectable; //导入依赖的package包/类
@Override
public Injectable<AuthenticationVO> getInjectable(ComponentContext ic, Context a, Type c) {
if (c.equals(AuthenticationVO.class)) {
return this;
}
return null;
}
示例5: getInjectable
import com.sun.jersey.spi.inject.Injectable; //导入依赖的package包/类
@Override
public Injectable getInjectable(ComponentContext componentContext, Authenticated authenticated, Parameter parameter) {
return new Injectable() {
@Override
public Object getValue() {
return new Subject(_securityManager, ThreadContext.getSubject().getPrincipals());
}
};
}
示例6: getInjectable
import com.sun.jersey.spi.inject.Injectable; //导入依赖的package包/类
@Override
public Injectable<Filter> getInjectable(ComponentContext ic, FilterParam fp, Type type) {
if (type instanceof Class<?> && Filter.class.isAssignableFrom((Class<?>) type)) {
return new FilterInjectableProvider();
}
return null;
}
开发者ID:geetools,项目名称:geeCommerce-Java-Shop-Software-and-PIM,代码行数:9,代码来源:FilterInjectableProvider.java
示例7: getInjectable
import com.sun.jersey.spi.inject.Injectable; //导入依赖的package包/类
@Override
public Injectable<ParsedQuery<? extends QuerySpec>> getInjectable(ComponentContext ic, final BindQuery a, Parameter c) {
return new AbstractHttpContextInjectable<ParsedQuery<? extends QuerySpec>>() {
@Override
public ParsedQuery<? extends QuerySpec> getValue(HttpContext context) {
return QueryParser.newBuilder(a.value()).build().parse(context.getUriInfo().getQueryParameters());
}
};
}
示例8: getInjectable
import com.sun.jersey.spi.inject.Injectable; //导入依赖的package包/类
@Override
public Injectable<Ontology> getInjectable(ComponentContext cc, Context context)
{
return new Injectable<Ontology>()
{
@Override
public Ontology getValue()
{
return getOntology();
}
};
}
示例9: getInjectable
import com.sun.jersey.spi.inject.Injectable; //导入依赖的package包/类
@Override
public Injectable<TemplateCall> getInjectable(ComponentContext ic, Context a)
{
return new Injectable<TemplateCall>()
{
@Override
public TemplateCall getValue()
{
return TemplateCallProvider.this.getTemplateCall();
}
};
}
示例10: getInjectable
import com.sun.jersey.spi.inject.Injectable; //导入依赖的package包/类
@Override
public Injectable<Template> getInjectable(ComponentContext ic, Context a)
{
return new Injectable<Template>()
{
@Override
public Template getValue()
{
return getTemplate();
}
};
}
示例11: getInjectable
import com.sun.jersey.spi.inject.Injectable; //导入依赖的package包/类
@Override
public Injectable<Application> getInjectable(ComponentContext ic, Context a)
{
return new Injectable<Application>()
{
@Override
public Application getValue()
{
return getApplication();
}
};
}
示例12: getInjectable
import com.sun.jersey.spi.inject.Injectable; //导入依赖的package包/类
@Override
public Injectable getInjectable(ComponentContext componentContext, Tenant tenant, Type type) {
if (type.equals(String.class)) {
return this;
}
return null;
}
示例13: getInjectable
import com.sun.jersey.spi.inject.Injectable; //导入依赖的package包/类
@Override
public Injectable getInjectable(ComponentContext componentContext, Correlator correlator, Type type) {
if (type.equals(String.class)) {
return this;
}
return null;
}
示例14: getInjectable
import com.sun.jersey.spi.inject.Injectable; //导入依赖的package包/类
@Override
public Injectable<Validator> getInjectable(ComponentContext ic, Context a, Type c) {
if (Validator.class.equals(c)) {
return this;
} else {
return null;
}
}
示例15: getInjectable
import com.sun.jersey.spi.inject.Injectable; //导入依赖的package包/类
@Override
public Injectable getInjectable(ComponentContext ic, Auth auth, Parameter parameter) {
final Type type = parameter.getParameterType();
final InjectableProvider<Auth, Parameter> delegate = map.get(type);
if (delegate == null) {
return null;
}
return delegate.getInjectable(ic, auth, parameter);
}