Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Target({ElementType.TYPE_USE,ElementType.TYPE_PARAMETER})
- public @interface TemplateCollection {
- String key() default "";
- }
- List<Message> messages = new @TemplateCollection(key = "Chapters") ArrayList<>();
- messages.add(new Message("title1", "content1"));
- messages.add(new Message("title2", "content2"));
- ArrayList<Chapter> res = Mapper.map((List)messages);
- public static ArrayList<Chapter> map(Object object) throws SerializationException {
- try {
- Class<?> demoClassObj = object.getClass();
- Annotation[] annotations = demoClassObj.getAnnotations(); <<< always Zero
- return null;
- } catch (Exception e) {
- throw new SerializationException(e.getMessage());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement