--- /dev/null
+package com.ranfa.lib;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Version {
+ String value();
+}
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
+import com.ranfa.lib.Version;
+
+@Version("v1.0.0")
public class DelesteRandomSelector extends JFrame {
private JPanel contentPane;
* Create the frame.
*/
public DelesteRandomSelector() {
+ // System.out.println(getVersion());
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
setContentPane(contentPane);
}
+
+ /**
+ * アノテーションで記載されているバージョンを取得します
+ * @since v1.0.0
+ * @return アノテーションで定義されているバージョン
+ */
+ public static String getVersion() {
+ Version version = (Version) DelesteRandomSelector.class.getAnnotation(Version.class);
+ return version.value();
+ }
+
}