mercredi 22 avril 2015

How to extract annotation arguments into external file?

I have following class.

public class MultipartFileWrapper {
    @Extensions({".jpg",".png",".gif",".bmp",".mp4"})
    MultipartFile multipartFile;  
    ...
}

Now I want to extract formats to configuration file. But I don't understand how to replace

@Extensions({".jpg",".png",".gif",".bmp",".mp4"})

I want to rewrite it something like this:

public class MultipartFileWrapper {
        @Extensions(readFormatsFromFile())
        MultipartFile multipartFile;  
        ...
    }

formats should takes from external file with the following content:

.jpg,.png,.gif,.bmp,.mp4

Does java allow do this?





Aucun commentaire:

Enregistrer un commentaire