本文整理了Java中org.glassfish.jersey.server.model.AnnotatedMethod.getGenericParameterTypes()
方法的一些代码示例,展示了AnnotatedMethod.getGenericParameterTypes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AnnotatedMethod.getGenericParameterTypes()
方法的具体详情如下:
包路径:org.glassfish.jersey.server.model.AnnotatedMethod
类名称:AnnotatedMethod
方法名:getGenericParameterTypes
[英]Get generic method parameter types. See also Method#getGenericParameterTypes().
[中]获取泛型方法参数类型。另请参见方法#getGenericParameterTypes()。
代码示例来源:origin: dropwizard/dropwizard
final Annotation[][] parameterAnnotations = am.getParameterAnnotations();
final Class<?>[] parameterTypes = am.getParameterTypes();
final Type[] parameterGenericTypes = am.getGenericParameterTypes();
代码示例来源:origin: jersey/jersey
/**
* Create a list of parameter models for a given Java method handling a resource
* method, sub-resource method or a sub-resource locator.
*
* @param concreteClass concrete resource method handler implementation class.
* @param declaringClass the class declaring the handling Java method.
* @param javaMethod Java method handling a resource method, sub-resource
* method or a sub-resource locator.
* @param keepEncoded set to {@code true} to disable automatic decoding
* of all the method parameters. (See {@link Encoded}.
* @return a list of handling method parameter models.
*/
public static List<Parameter> create(
Class concreteClass,
Class declaringClass,
Method javaMethod,
boolean keepEncoded) {
AnnotatedMethod method = new AnnotatedMethod(javaMethod);
return create(
concreteClass, declaringClass,
((null != method.getAnnotation(Encoded.class)) || keepEncoded),
method.getParameterTypes(),
method.getGenericParameterTypes(),
method.getParameterAnnotations());
}
代码示例来源:origin: jersey/jersey
/**
* Create a list of parameter models for a given Java method handling a resource
* method, sub-resource method or a sub-resource locator.
*
* @param concreteClass concrete resource method handler implementation class.
* @param declaringClass the class declaring the handling Java method.
* @param javaMethod Java method handling a resource method, sub-resource
* method or a sub-resource locator.
* @param keepEncoded set to {@code true} to disable automatic decoding
* of all the method parameters. (See {@link Encoded}.
* @return a list of handling method parameter models.
*/
public static List<Parameter> create(
Class concreteClass,
Class declaringClass,
Method javaMethod,
boolean keepEncoded) {
AnnotatedMethod method = new AnnotatedMethod(javaMethod);
return create(
concreteClass, declaringClass,
((null != method.getAnnotation(Encoded.class)) || keepEncoded),
method.getParameterTypes(),
method.getGenericParameterTypes(),
method.getParameterAnnotations());
}
代码示例来源:origin: jersey/jersey
private void checkResourceClassSetters(final MethodList methodList,
final boolean encodedFlag,
Collection<Parameter> injectableParameters) {
for (AnnotatedMethod method : methodList.withoutMetaAnnotation(HttpMethod.class)
.withoutAnnotation(Path.class)
.hasNumParams(1)
.hasReturnType(void.class)
.nameStartsWith("set")) {
Parameter p = Parameter.create(
handlerClass,
method.getMethod().getDeclaringClass(),
encodedFlag || method.isAnnotationPresent(Encoded.class),
method.getParameterTypes()[0],
method.getGenericParameterTypes()[0],
method.getAnnotations());
if (null != p) {
ResourceMethodValidator.validateParameter(p, method.getMethod(), method.getMethod().toGenericString(), "1",
InvocableValidator.isSingleton(handlerClass));
// we do not inject entity parameters into class instance fields and properties.
if (p.getSource() != Parameter.Source.ENTITY) {
injectableParameters.add(p);
}
}
}
}
代码示例来源:origin: jersey/jersey
private void checkResourceClassSetters(final MethodList methodList,
final boolean encodedFlag,
Collection<Parameter> injectableParameters) {
for (AnnotatedMethod method : methodList.withoutMetaAnnotation(HttpMethod.class)
.withoutAnnotation(Path.class)
.hasNumParams(1)
.hasReturnType(void.class)
.nameStartsWith("set")) {
Parameter p = Parameter.create(
handlerClass,
method.getMethod().getDeclaringClass(),
encodedFlag || method.isAnnotationPresent(Encoded.class),
method.getParameterTypes()[0],
method.getGenericParameterTypes()[0],
method.getAnnotations());
if (null != p) {
ResourceMethodValidator.validateParameter(p, method.getMethod(), method.getMethod().toGenericString(), "1",
InvocableValidator.isSingleton(handlerClass));
// we do not inject entity parameters into class instance fields and properties.
if (p.getSource() != Parameter.Source.ENTITY) {
injectableParameters.add(p);
}
}
}
}
代码示例来源:origin: org.glassfish.jersey.core/jersey-server
/**
* Create a list of parameter models for a given Java method handling a resource
* method, sub-resource method or a sub-resource locator.
*
* @param concreteClass concrete resource method handler implementation class.
* @param declaringClass the class declaring the handling Java method.
* @param javaMethod Java method handling a resource method, sub-resource
* method or a sub-resource locator.
* @param keepEncoded set to {@code true} to disable automatic decoding
* of all the method parameters. (See {@link Encoded}.
* @return a list of handling method parameter models.
*/
public static List<Parameter> create(
Class concreteClass,
Class declaringClass,
Method javaMethod,
boolean keepEncoded) {
AnnotatedMethod method = new AnnotatedMethod(javaMethod);
return create(
concreteClass, declaringClass,
((null != method.getAnnotation(Encoded.class)) || keepEncoded),
method.getParameterTypes(),
method.getGenericParameterTypes(),
method.getParameterAnnotations());
}
代码示例来源:origin: org.glassfish.jersey.core/jersey-server
private void checkResourceClassSetters(final MethodList methodList,
final boolean encodedFlag,
Collection<Parameter> injectableParameters) {
for (AnnotatedMethod method : methodList.withoutMetaAnnotation(HttpMethod.class)
.withoutAnnotation(Path.class)
.hasNumParams(1)
.hasReturnType(void.class)
.nameStartsWith("set")) {
Parameter p = Parameter.create(
handlerClass,
method.getMethod().getDeclaringClass(),
encodedFlag || method.isAnnotationPresent(Encoded.class),
method.getParameterTypes()[0],
method.getGenericParameterTypes()[0],
method.getAnnotations());
if (null != p) {
ResourceMethodValidator.validateParameter(p, method.getMethod(), method.getMethod().toGenericString(), "1",
InvocableValidator.isSingleton(handlerClass));
// we do not inject entity parameters into class instance fields and properties.
if (p.getSource() != Parameter.Source.ENTITY) {
injectableParameters.add(p);
}
}
}
}
代码示例来源:origin: io.dropwizard/dropwizard-auth
final Annotation[][] parameterAnnotations = am.getParameterAnnotations();
final Class<?>[] parameterTypes = am.getParameterTypes();
final Type[] parameterGenericTypes = am.getGenericParameterTypes();
代码示例来源:origin: hstaudacher/osgi-jax-rs-connector
/**
* Create a list of parameter models for a given Java method handling a resource
* method, sub-resource method or a sub-resource locator.
*
* @param concreteClass concrete resource method handler implementation class.
* @param declaringClass the class declaring the handling Java method.
* @param javaMethod Java method handling a resource method, sub-resource
* method or a sub-resource locator.
* @param keepEncoded set to {@code true} to disable automatic decoding
* of all the method parameters. (See {@link Encoded}.
* @return a list of handling method parameter models.
*/
public static List<Parameter> create(
Class concreteClass,
Class declaringClass,
Method javaMethod,
boolean keepEncoded) {
AnnotatedMethod method = new AnnotatedMethod(javaMethod);
return create(
concreteClass, declaringClass,
((null != method.getAnnotation(Encoded.class)) || keepEncoded),
method.getParameterTypes(),
method.getGenericParameterTypes(),
method.getParameterAnnotations());
}
代码示例来源:origin: org.glassfish.jersey.bundles/jaxrs-ri
/**
* Create a list of parameter models for a given Java method handling a resource
* method, sub-resource method or a sub-resource locator.
*
* @param concreteClass concrete resource method handler implementation class.
* @param declaringClass the class declaring the handling Java method.
* @param javaMethod Java method handling a resource method, sub-resource
* method or a sub-resource locator.
* @param keepEncoded set to {@code true} to disable automatic decoding
* of all the method parameters. (See {@link Encoded}.
* @return a list of handling method parameter models.
*/
public static List<Parameter> create(
Class concreteClass,
Class declaringClass,
Method javaMethod,
boolean keepEncoded) {
AnnotatedMethod method = new AnnotatedMethod(javaMethod);
return create(
concreteClass, declaringClass,
((null != method.getAnnotation(Encoded.class)) || keepEncoded),
method.getParameterTypes(),
method.getGenericParameterTypes(),
method.getParameterAnnotations());
}
代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all
/**
* Create a list of parameter models for a given Java method handling a resource
* method, sub-resource method or a sub-resource locator.
*
* @param concreteClass concrete resource method handler implementation class.
* @param declaringClass the class declaring the handling Java method.
* @param javaMethod Java method handling a resource method, sub-resource
* method or a sub-resource locator.
* @param keepEncoded set to {@code true} to disable automatic decoding
* of all the method parameters. (See {@link Encoded}.
* @return a list of handling method parameter models.
*/
public static List<Parameter> create(
Class concreteClass,
Class declaringClass,
Method javaMethod,
boolean keepEncoded) {
AnnotatedMethod method = new AnnotatedMethod(javaMethod);
return create(
concreteClass, declaringClass,
((null != method.getAnnotation(Encoded.class)) || keepEncoded),
method.getParameterTypes(),
method.getGenericParameterTypes(),
method.getParameterAnnotations());
}
代码示例来源:origin: hstaudacher/osgi-jax-rs-connector
/**
* Create a list of parameter models for a given Java method handling a resource
* method, sub-resource method or a sub-resource locator.
*
* @param concreteClass concrete resource method handler implementation class.
* @param declaringClass the class declaring the handling Java method.
* @param javaMethod Java method handling a resource method, sub-resource
* method or a sub-resource locator.
* @param keepEncoded set to {@code true} to disable automatic decoding
* of all the method parameters. (See {@link Encoded}.
* @return a list of handling method parameter models.
*/
public static List<Parameter> create(
Class concreteClass,
Class declaringClass,
Method javaMethod,
boolean keepEncoded) {
AnnotatedMethod method = new AnnotatedMethod(javaMethod);
return create(
concreteClass, declaringClass,
((null != method.getAnnotation(Encoded.class)) || keepEncoded),
method.getParameterTypes(),
method.getGenericParameterTypes(),
method.getParameterAnnotations());
}
代码示例来源:origin: hstaudacher/osgi-jax-rs-connector
private void checkResourceClassSetters(final MethodList methodList,
final boolean encodedFlag,
Collection<Parameter> injectableParameters) {
for (AnnotatedMethod method : methodList.withoutMetaAnnotation(HttpMethod.class)
.withoutAnnotation(Path.class)
.hasNumParams(1)
.hasReturnType(void.class)
.nameStartsWith("set")) {
Parameter p = Parameter.create(
handlerClass,
method.getMethod().getDeclaringClass(),
encodedFlag || method.isAnnotationPresent(Encoded.class),
method.getParameterTypes()[0],
method.getGenericParameterTypes()[0],
method.getAnnotations());
if (null != p) {
ResourceMethodValidator.validateParameter(p, method.getMethod(), method.getMethod().toGenericString(), "1",
InvocableValidator.isSingleton(handlerClass));
// we do not inject entity parameters into class instance fields and properties.
if (p.getSource() != Parameter.Source.ENTITY) {
injectableParameters.add(p);
}
}
}
}
代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all
private void checkResourceClassSetters(final MethodList methodList,
final boolean encodedFlag,
Collection<Parameter> injectableParameters) {
for (AnnotatedMethod method : methodList.withoutMetaAnnotation(HttpMethod.class)
.withoutAnnotation(Path.class)
.hasNumParams(1)
.hasReturnType(void.class)
.nameStartsWith("set")) {
Parameter p = Parameter.create(
handlerClass,
method.getMethod().getDeclaringClass(),
encodedFlag || method.isAnnotationPresent(Encoded.class),
method.getParameterTypes()[0],
method.getGenericParameterTypes()[0],
method.getAnnotations());
if (null != p) {
ResourceMethodValidator.validateParameter(p, method.getMethod(), method.getMethod().toGenericString(), "1",
InvocableValidator.isSingleton(handlerClass));
// we do not inject entity parameters into class instance fields and properties.
if (p.getSource() != Parameter.Source.ENTITY) {
injectableParameters.add(p);
}
}
}
}
代码示例来源:origin: org.glassfish.jersey.bundles/jaxrs-ri
private void checkResourceClassSetters(final MethodList methodList,
final boolean encodedFlag,
Collection<Parameter> injectableParameters) {
for (AnnotatedMethod method : methodList.withoutMetaAnnotation(HttpMethod.class)
.withoutAnnotation(Path.class)
.hasNumParams(1)
.hasReturnType(void.class)
.nameStartsWith("set")) {
Parameter p = Parameter.create(
handlerClass,
method.getMethod().getDeclaringClass(),
encodedFlag || method.isAnnotationPresent(Encoded.class),
method.getParameterTypes()[0],
method.getGenericParameterTypes()[0],
method.getAnnotations());
if (null != p) {
ResourceMethodValidator.validateParameter(p, method.getMethod(), method.getMethod().toGenericString(), "1",
InvocableValidator.isSingleton(handlerClass));
// we do not inject entity parameters into class instance fields and properties.
if (p.getSource() != Parameter.Source.ENTITY) {
injectableParameters.add(p);
}
}
}
}
代码示例来源:origin: hstaudacher/osgi-jax-rs-connector
private void checkResourceClassSetters(final MethodList methodList,
final boolean encodedFlag,
Collection<Parameter> injectableParameters) {
for (AnnotatedMethod method : methodList.withoutMetaAnnotation(HttpMethod.class)
.withoutAnnotation(Path.class)
.hasNumParams(1)
.hasReturnType(void.class)
.nameStartsWith("set")) {
Parameter p = Parameter.create(
handlerClass,
method.getMethod().getDeclaringClass(),
encodedFlag || method.isAnnotationPresent(Encoded.class),
method.getParameterTypes()[0],
method.getGenericParameterTypes()[0],
method.getAnnotations());
if (null != p) {
ResourceMethodValidator.validateParameter(p, method.getMethod(), method.getMethod().toGenericString(), "1",
InvocableValidator.isSingleton(handlerClass));
// we do not inject entity parameters into class instance fields and properties.
if (p.getSource() != Parameter.Source.ENTITY) {
injectableParameters.add(p);
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!