@Override public Object getValue(RuntimeContext runtimeContext) { return contextAccessor.getContext(getType(), runtimeContext); } }
private static ValueConvertor createArrayValueConvertor(Class<?> componentType, Type genericType) { ValueConvertor concreteConvertor = createConcreteValueConvertor(componentType, genericType); return new ArrayValueConvertor(concreteConvertor, componentType); }
@Override protected final boolean isConstructorParameterValid(Injectable fp) { // This method is declared as final, since parseConstructors(), which // calls it, is invoked from the constructor return !(fp.getParamType() == Injectable.ParamType.ENTITY); }
private static ValueConvertor getSingleValueConvertor(Class<?> classType) { if (classType.equals(String.class)) { return new StringConvertor(); } else if (classType.equals(Character.class)) { return new CharacterConvertor(); } else if (classType.isPrimitive()) { return new PrimitiveConvertor(classType); } else if (classType.equals(PathSegment.class)) { return new PathSegmentConvertor(); } else { return getComplexValueConverter(classType); } }
public <T> MessageBodyWriter<T> getMessageBodyWriter(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return providersRegistry.getMessageBodyWriter(type, genericType, annotations, mediaType, runtimeContext); }
public <T> MessageBodyReader<T> getMessageBodyReader(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return providersRegistry.getMessageBodyReader(type, genericType, annotations, mediaType, runtimeContext); }
public <T> T getContext(Class<T> contextClass, RuntimeContext runtimeContext) { // try to get a context from a ContextResolver T context = getContextFromResolver(contextClass, runtimeContext); if (context != null) { return context; } // get a context from one of the message context accessors return getContextFromAccessor(contextClass, runtimeContext); }
public Injectable createHeaderParam(String value, Class<?> classType, Type genericType, Annotation[] annotations, Member member) { return new NullInjectable(Injectable.ParamType.HEADER, classType, genericType, annotations, member); }
public List<ProviderRecord<?>> getExceptionMapperRecords() { ArrayList<ProviderRecord<?>> recordList = new ArrayList<ProviderRecord<?>>(); for (PriorityObjectFactory<ExceptionMapper<?>> factory : exceptionMappers) { ProviderRecord<?> record = new ProviderRecord<ExceptionMapper<?>>(factory.getInstanceClass(), null, ExceptionMapper.class, factory.isSystemProvider); recordList.add(record); } return recordList; }
/** * @param userOnly only print user-defined entities * @param trace if calling toString as part of debugging, use * trace=false, if as part of trace or any other reason, use * trace=true * @return */ public String toString(boolean userOnly, boolean trace) { return toString(" ", userOnly, trace); }
protected BoundInjectable(ParamType paramType, String name, Class<?> type, Type genericType, Annotation[] annotations, Member member) { super(paramType, type, genericType, annotations, member); this.name = name; this.convertor = ValueConvertor.createValueConvertor(type, genericType); this.defaultValue = null; this.encoded = false; }
@Override protected final boolean isConstructorParameterValid(Injectable fp) { // This method is declared as final, since parseConstructors(), which // calls it, is invoked from the constructor return fp.getParamType() == Injectable.ParamType.CONTEXT; }
public Injectable createEntityParam(Class<?> classType, Type genericType, Annotation[] annotations, Member member) { return new NullInjectable(Injectable.ParamType.ENTITY, classType, genericType, annotations, member); }
@Override public String toString() { return toString(" ", false, true); //$NON-NLS-1$ }
public Injectable createMatrixParam(String value, Class<?> classType, Type genericType, Annotation[] annotations, Member member) { return new NullInjectable(Injectable.ParamType.MATRIX, classType, genericType, annotations, member); }
public Injectable createPathParam(String value, Class<?> classType, Type genericType, Annotation[] annotations, Member member) { return new NullInjectable(Injectable.ParamType.PATH, classType, genericType, annotations, member); }
public Injectable createCookieParam(String value, Class<?> classType, Type genericType, Annotation[] annotations, Member member) { return new NullInjectable(Injectable.ParamType.COOKIE, classType, genericType, annotations, member); }
public Injectable createQueryParam(String value, Class<?> classType, Type genericType, Annotation[] annotations, Member member) { return new NullInjectable(Injectable.ParamType.QUERY, classType, genericType, annotations, member); }
public Injectable createFormParam(String value, Class<?> classType, Type genericType, Annotation[] annotations, Member member) { return new NullInjectable(Injectable.ParamType.FORM, classType, genericType, annotations, member); }