esoe 2 years ago
parent
commit
96ded31b61
  1. 12
      files/pom.xml
  2. 13
      files/src/main/docs/diagrams/src/Files.puml
  3. 29
      files/src/main/java/ru/molokoin/AnnotationReseacher.java
  4. 3
      files/src/main/java/ru/molokoin/DocumentFile.java
  5. 24
      files/src/main/java/ru/molokoin/File.java
  6. 0
      files/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  7. 4
      files/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

12
files/pom.xml

@ -17,11 +17,9 @@ @@ -17,11 +17,9 @@
<artifactId>files</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
<scope>provided</scope>
</dependency>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

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

@ -1,9 +1,8 @@ @@ -1,9 +1,8 @@
@startuml Files
title Files class diagram
class Storage {
Extension extension
String readAnnotation()
void main
File[] files
}
enum Extension{
DOCUMENT
@ -12,10 +11,10 @@ enum Extension{ @@ -12,10 +11,10 @@ enum Extension{
VIDEO
OTHER
}
annotation File {
String name()
byte size()
Extension extension ()
class File {
String name
byte size
Extension extension
}
@enduml

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

@ -1,29 +0,0 @@ @@ -1,29 +0,0 @@
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) {
}
}

3
files/src/main/java/ru/molokoin/DocumentFile.java

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
public class DocumentFile extends File{
}

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

@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
package ru.molokoin;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
public class File {
String name;
Byte size;
Extension extension;
public File (String name, Byte size, Extension extension){
}
public static void main(String[] args) {
//
}
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface File {
String name() default "noname";
byte size() default 0;
Extension extension () default Extension.OTHER;
}

0
files/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

4
files/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
c:\Users\Strannik\Documents\esoe\code\education\files\src\main\java\ru\molokoin\DocumentFile.java
c:\Users\Strannik\Documents\esoe\code\education\files\src\main\java\ru\molokoin\Extension.java
c:\Users\Strannik\Documents\esoe\code\education\files\src\main\java\ru\molokoin\Storage.java
c:\Users\Strannik\Documents\esoe\code\education\files\src\main\java\ru\molokoin\File.java
Loading…
Cancel
Save