Close
« Tutorial

Spring MVC - Custom Formatter Annotation MCQ

0/13
0 ✓
0 ✗

1. What is the main purpose of the AnnotationFormatterFactory interface in Spring MVC?

2. Which method of WebMvcConfigurer is overridden to register an AnnotationFormatterFactory?

3. Which method must be implemented to specify the types of fields that a custom AnnotationFormatterFactory supports?

4. What is the role of the @Target annotation on a custom formatter annotation?

5. Which retention policy is required for a custom formatter annotation to be available at runtime?

6. In an AnnotationFormatterFactory, which method is responsible for creating a Parser that converts a String back to the field type?

7. Which interface does a custom formatter typically implement when it is bound to an annotation?

8. What is the purpose of the addFormatterForFieldAnnotation method in the FormatterRegistry?

9. Which of the following is a valid use of the @Retention annotation on a custom formatter annotation?

10. What does the getPrinter method of an AnnotationFormatterFactory return?

11. Which annotation is used to mark a method that registers formatters in a Spring MVC configuration class?

12. What is the purpose of the @Target element ElementType.FIELD in a custom formatter annotation?

13. Which component is responsible for applying the formatting logic when a field is annotated with a custom formatter annotation?

14. What is the correct way to specify that a custom annotation can be used on both fields and method parameters?

15. Which method in the Formatter interface is used to convert an object into its String representation?

16. What is the purpose of the getFieldTypes method in an AnnotationFormatterFactory?

17. Which of the following annotations is essential for a class that implements WebMvcConfigurer to enable Spring MVC configuration?

Join