final Object defaultValue = getDefaultValue(annotationData, paramType, parameterType); switch (annotationData.getName()) { case "requestParam": param = new RequestParam(required, paramName, defaultValue, description);
if (requestMapping != null && requestMapping.getName().equals("bridge")) { requestPaths.add("/" + methodAccess.name().toLowerCase());
public static Collection<AnnotationData> getAnnotationDataForFieldAndProperty( Class<?> clazz, String propertyName, Set<String> allowedPackages ) { /* Extract the AnnotationData from the Java annotation. */ List<AnnotationData> propertyAnnotationDataList = getAnnotationDataForProperty( clazz, propertyName, false, allowedPackages ); /* Read the field annotation. */ List<AnnotationData> fieldAnnotationDataList = getAnnotationDataForField( clazz, propertyName, allowedPackages ); /* Combine the annotation from field and properties. Field validations take precedence over property validations. */ Map<String, AnnotationData> map = new HashMap<String, AnnotationData>( propertyAnnotationDataList.size() + fieldAnnotationDataList.size() ); /* Add the property annotation to the map. */ for ( AnnotationData annotationData : propertyAnnotationDataList ) { map.put( annotationData.getName(), annotationData ); } /* Add the field annotation to the map allowing them to override the property annotation. */ for ( AnnotationData annotationData : fieldAnnotationDataList ) { map.put( annotationData.getName(), annotationData ); } return map.values(); }
public static Collection<AnnotationData> getAnnotationDataForFieldAndProperty( Class<?> clazz, String propertyName, Set<String> allowedPackages ) { /* Extract the AnnotationData from the Java annotation. */ List<AnnotationData> propertyAnnotationDataList = getAnnotationDataForProperty( clazz, propertyName, false, allowedPackages ); /* Read the field annotation. */ List<AnnotationData> fieldAnnotationDataList = getAnnotationDataForField( clazz, propertyName, allowedPackages ); /* Combine the annotation from field and properties. Field validations take precedence over property validations. */ Map<String, AnnotationData> map = new HashMap<String, AnnotationData>( propertyAnnotationDataList.size() + fieldAnnotationDataList.size() ); /* Add the property annotation to the map. */ for ( AnnotationData annotationData : propertyAnnotationDataList ) { map.put( annotationData.getName(), annotationData ); } /* Add the field annotation to the map allowing them to override the property annotation. */ for ( AnnotationData annotationData : fieldAnnotationDataList ) { map.put( annotationData.getName(), annotationData ); } return map.values(); }
public ConstructorAccessImpl( Constructor<T> method ) { this.constructor = method; this.constructor.setAccessible(true); this.annotationData = Annotations.getAnnotationDataForMethod(method); annotationMap = new ConcurrentHashMap<>( ); for (AnnotationData data : annotationData) { annotationMap.put( data.getName(), data ); annotationMap.put( data.getSimpleClassName(), data ); annotationMap.put( data.getFullClassName(), data ); } }
public ConstructorAccessImpl( Constructor<T> method ) { this.constructor = method; this.constructor.setAccessible(true); this.annotationData = Annotations.getAnnotationDataForMethod(method); annotationMap = new ConcurrentHashMap<>( ); for (AnnotationData data : annotationData) { annotationMap.put( data.getName(), data ); annotationMap.put( data.getSimpleClassName(), data ); annotationMap.put( data.getFullClassName(), data ); } }
public static Map<String, AnnotationData> getAnnotationDataForClassAsMap( Class<?> clazz ) { final Map<Class<?>, Map<String, AnnotationData>> cache = context ().annotationDataCacheClassAsMap; Map<String, AnnotationData> map = cache.get(clazz); if (map == null) { final List<AnnotationData> list = getAnnotationDataForClass ( clazz ); if (list.size () == 0) { map = Collections.EMPTY_MAP; } else { map = new ConcurrentHashMap<> ( list.size () ); for (AnnotationData data : list) { map.put ( data.getFullClassName (), data ); map.put ( data.getSimpleClassName (), data); map.put ( data.getName (), data); } } cache.put ( clazz, map ); } return map; }
public static Map<String, AnnotationData> getAnnotationDataForClassAsMap( Class<?> clazz ) { final Map<Class<?>, Map<String, AnnotationData>> cache = context ().annotationDataCacheClassAsMap; Map<String, AnnotationData> map = cache.get(clazz); if (map == null) { final List<AnnotationData> list = getAnnotationDataForClass ( clazz ); if (list.size () == 0) { map = Collections.EMPTY_MAP; } else { map = new ConcurrentHashMap<> ( list.size () ); for (AnnotationData data : list) { map.put ( data.getFullClassName (), data ); map.put ( data.getSimpleClassName (), data); map.put ( data.getName (), data); } } cache.put ( clazz, map ); } return map; }
public MethodAccessImpl( Method method ) { this.method = method; this.method.setAccessible( true ); this.annotationData = Annotations.getAnnotationDataForMethod(method); this.annotationDataForParams = Annotations.getAnnotationDataForMethodParams(method); for (Class<?> cls : method.getParameterTypes()) { paramTypeEnumList.add(TypeType.getType(cls)); } annotationMap = new ConcurrentHashMap<>( ); for (AnnotationData data : annotationData) { annotationMap.put( data.getName(), data ); annotationMap.put( data.getSimpleClassName(), data ); annotationMap.put( data.getFullClassName(), data ); } score(method); }
annotationMap.put(data.getName(), data); annotationMap.put(data.getSimpleClassName(), data); annotationMap.put(data.getFullClassName(), data);
final Object defaultValue = getDefaultValue(annotationData, paramType, parameterType); switch (annotationData.getName()) { case "requestParam": param = new RequestParam(required, paramName, defaultValue, description);
final Object defaultValue = getDefaultValue(annotationData, paramType, parameterType); switch (annotationData.getName()) { case "requestParam": param = new RequestParam(required, paramName, defaultValue, description);
if (requestMapping != null && requestMapping.getName().equals("bridge")) { requestPaths.add("/" + methodAccess.name().toLowerCase());