esoe 2 years ago
parent
commit
f714beba10
  1. 27
      files/src/main/java/ru/molokoin/AnnotationReseacher.java

27
files/src/main/java/ru/molokoin/AnnotationReseacher.java

@ -0,0 +1,27 @@
package ru.molokoin;
import java.lang.annotation.Annotation;
public class AnnotationReseacher {
public static File getFile(Storage storage){
Annotation fileAnnotation = storage
.getClass()
.getAnnotation(File.class);
File file = (File)fileAnnotation;
return file;
}
public static void print(Storage storage){
Annotation fileAnnotation = storage
.getClass()
.getAnnotation(File.class);
File file = (File)fileAnnotation;
System.out.println(file.name());
System.out.println(file.extension());
System.out.println(file.size());
}
public static void main(String[] args) {
Storage storage = new Storage();
print(storage);
}
}
Loading…
Cancel
Save