esoe 2 years ago
parent
commit
41aa33521b
  1. 14
      files/src/main/docs/diagrams/src/Files.puml
  2. 1
      files/src/main/java/ru/molokoin/Extension.java
  3. 15
      files/src/main/java/ru/molokoin/File.java
  4. 8
      files/src/main/java/ru/molokoin/Format.java
  5. 7
      files/src/main/java/ru/molokoin/Storage.java

14
files/src/main/docs/diagrams/src/Files.puml

@ -1,15 +1,21 @@ @@ -1,15 +1,21 @@
@startuml Files
title Files class diagram
class File {
String name
byte size
class Storage {
Extension extension
String readAnnotation()
void main
}
enum Format{
enum Extension{
DOCUMENT
IMAGE
AUDIO
VIDEO
OTHER
}
annotation File {
String name()
byte size()
Extension extension ()
}
@enduml

1
files/src/main/java/ru/molokoin/Extension.java

@ -4,5 +4,4 @@ public enum Extension { @@ -4,5 +4,4 @@ public enum Extension {
AUDIO,
VIDEO,
OTHER;
}

15
files/src/main/java/ru/molokoin/File.java

@ -1,9 +1,8 @@ @@ -1,9 +1,8 @@
import annota
Format (name=noname; size=0; extension=Extension.OTHER)
public class File {
private String name;
private byte size;
//читаем днные аннотации
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface File {
String name() default "noname";
byte size() default "0";
Extension extension () default Extension.OTHER;
}

8
files/src/main/java/ru/molokoin/Format.java

@ -1,8 +0,0 @@ @@ -1,8 +0,0 @@
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Format {
String name() default "noname";
byte size() default "0";
Extension extension () default Extension.OTHER;
}

7
files/src/main/java/ru/molokoin/Storage.java

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
//import annota
@File (name=noname, size=0, extension=Extension.OTHER)
public class Storage {
Extension extension;
//читаем днные аннотации
}
Loading…
Cancel
Save