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


Java Injectable类代码示例

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

示例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));
        }
    };
}
 
开发者ID:deelam,项目名称:agilion,代码行数:19,代码来源:LocalDateProvider.java

示例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;
}
 
开发者ID:phoenixctms,项目名称:ctsms,代码行数:8,代码来源:BasicAuthenticationProvider.java

示例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());
        }
    };
}
 
开发者ID:bazaarvoice,项目名称:emodb,代码行数:10,代码来源:AuthenticatedSubjectProvider.java

示例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());
    }
  };
}
 
开发者ID:HubSpot,项目名称:httpQL,代码行数:10,代码来源:BindQueryInjectableProvider.java

示例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();
    }
};
   }
 
开发者ID:AtomGraph,项目名称:Processor,代码行数:13,代码来源:OntologyProvider.java

示例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();
    }
};
   }
 
开发者ID:AtomGraph,项目名称:Processor,代码行数:13,代码来源:TemplateCallProvider.java

示例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();
    }
};
   }
 
开发者ID:AtomGraph,项目名称:Processor,代码行数:13,代码来源:TemplateProvider.java

示例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();
    }
};
   }
 
开发者ID:AtomGraph,项目名称:Processor,代码行数:13,代码来源:ApplicationProvider.java

示例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;
}
 
开发者ID:telefonicaid,项目名称:fiware-keypass,代码行数:8,代码来源:TenantProvider.java

示例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;
}
 
开发者ID:telefonicaid,项目名称:fiware-keypass,代码行数:8,代码来源:CorrelatorProvider.java

示例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;
  }
}
 
开发者ID:soulrebel,项目名称:dropwizard-jaxb,代码行数:9,代码来源:ValidatorProvider.java

示例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);
}
 
开发者ID:yammer,项目名称:backups,代码行数:12,代码来源:TypedAuthProvider.java


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