3 changed files with 139 additions and 21 deletions
@ -1,26 +1,39 @@ |
|||||||
# ---> Java |
target/ |
||||||
# Compiled class file |
!.mvn/wrapper/maven-wrapper.jar |
||||||
*.class |
!**/src/main/**/target/ |
||||||
|
!**/src/test/**/target/ |
||||||
|
|
||||||
# Log file |
### IntelliJ IDEA ### |
||||||
*.log |
.idea/modules.xml |
||||||
|
.idea/jarRepositories.xml |
||||||
|
.idea/compiler.xml |
||||||
|
.idea/libraries/ |
||||||
|
*.iws |
||||||
|
*.iml |
||||||
|
*.ipr |
||||||
|
.idea/* |
||||||
|
|
||||||
# BlueJ files |
### Eclipse ### |
||||||
*.ctxt |
.apt_generated |
||||||
|
.classpath |
||||||
|
.factorypath |
||||||
|
.project |
||||||
|
.settings |
||||||
|
.springBeans |
||||||
|
.sts4-cache |
||||||
|
|
||||||
# Mobile Tools for Java (J2ME) |
### NetBeans ### |
||||||
.mtj.tmp/ |
/nbproject/private/ |
||||||
|
/nbbuild/ |
||||||
|
/dist/ |
||||||
|
/nbdist/ |
||||||
|
/.nb-gradle/ |
||||||
|
build/ |
||||||
|
!**/src/main/**/build/ |
||||||
|
!**/src/test/**/build/ |
||||||
|
|
||||||
# Package Files # |
### VS Code ### |
||||||
*.jar |
.vscode/ |
||||||
*.war |
|
||||||
*.nar |
|
||||||
*.ear |
|
||||||
*.zip |
|
||||||
*.tar.gz |
|
||||||
*.rar |
|
||||||
|
|
||||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml |
|
||||||
hs_err_pid* |
|
||||||
replay_pid* |
|
||||||
|
|
||||||
|
### Mac OS ### |
||||||
|
.DS_Store |
@ -0,0 +1,49 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
|
||||||
|
<groupId>cc.niushuai.demo</groupId> |
||||||
|
<artifactId>design-pattern</artifactId> |
||||||
|
<version>1.0-SNAPSHOT</version> |
||||||
|
|
||||||
|
<properties> |
||||||
|
<maven.compiler.source>17</maven.compiler.source> |
||||||
|
<maven.compiler.target>17</maven.compiler.target> |
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
||||||
|
</properties> |
||||||
|
|
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>cn.hutool</groupId> |
||||||
|
<artifactId>hutool-all</artifactId> |
||||||
|
<version>5.8.23</version> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
|
||||||
|
<repositories> |
||||||
|
<repository> |
||||||
|
<id>aliyun</id> |
||||||
|
<url>https://maven.aliyun.com/repository/public</url> |
||||||
|
<releases> |
||||||
|
<enabled>true</enabled> |
||||||
|
</releases> |
||||||
|
<snapshots> |
||||||
|
<enabled>false</enabled> |
||||||
|
</snapshots> |
||||||
|
</repository> |
||||||
|
</repositories> |
||||||
|
<pluginRepositories> |
||||||
|
<pluginRepository> |
||||||
|
<id>aliyun-plugin</id> |
||||||
|
<url>https://maven.aliyun.com/repository/public</url> |
||||||
|
<releases> |
||||||
|
<enabled>true</enabled> |
||||||
|
</releases> |
||||||
|
<snapshots> |
||||||
|
<enabled>false</enabled> |
||||||
|
</snapshots> |
||||||
|
</pluginRepository> |
||||||
|
</pluginRepositories> |
||||||
|
</project> |
@ -0,0 +1,56 @@ |
|||||||
|
/* |
||||||
|
* Copyright (C) 2023 niushuai233 niushuai.cc |
||||||
|
* |
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||||
|
* you may not use this file except in compliance with the License. |
||||||
|
* You may obtain a copy of the License at |
||||||
|
* |
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
* |
||||||
|
* Unless required by applicable law or agreed to in writing, software |
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, |
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||||
|
* See the License for the specific language governing permissions and |
||||||
|
* limitations under the License. |
||||||
|
*/ |
||||||
|
|
||||||
|
package cc.niushuai.demo.designpattern; |
||||||
|
|
||||||
|
import cn.hutool.core.lang.ConsoleTable; |
||||||
|
import cn.hutool.core.util.ClassUtil; |
||||||
|
|
||||||
|
import java.util.Set; |
||||||
|
|
||||||
|
/** |
||||||
|
* main class
|
||||||
|
* |
||||||
|
* @author niushuai233 |
||||||
|
* @date 2023/12/18 15:11 |
||||||
|
* @since 0.0.1 |
||||||
|
*/ |
||||||
|
public class Application { |
||||||
|
|
||||||
|
public static final String AUTHOR = "niushuai233"; |
||||||
|
|
||||||
|
public static void main(String[] args) { |
||||||
|
|
||||||
|
printAllClasses(); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 控制台打印所有类 |
||||||
|
* |
||||||
|
* @author niushuai233 |
||||||
|
* @date 2023/12/18 15:19 |
||||||
|
* @since 0.0.1 |
||||||
|
*/ |
||||||
|
private static void printAllClasses() { |
||||||
|
Set<Class<?>> allUtils = ClassUtil.scanPackage("cc.niushuai.demo.designpattern"); |
||||||
|
|
||||||
|
final ConsoleTable consoleTable = ConsoleTable.create().addHeader("类名", "所在包"); |
||||||
|
for (Class<?> clazz : allUtils) { |
||||||
|
consoleTable.addBody(clazz.getSimpleName(), clazz.getPackage().getName()); |
||||||
|
} |
||||||
|
consoleTable.print(); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue