Skip to content

Commit

Permalink
Merge pull request #23 from shuzijun/feat/kt
Browse files Browse the repository at this point in the history
support kotlin
  • Loading branch information
shuzijun authored Oct 8, 2023
2 parents 6c82937 + d554916 commit 69614ad
Show file tree
Hide file tree
Showing 26 changed files with 730 additions and 36 deletions.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions plantuml-parser-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ repositories {
}

dependencies {
compile 'commons-cli:commons-cli:1.5.0'
compile project(":plantuml-parser-core")
implementation 'commons-cli:commons-cli:1.5.0'
implementation project(":plantuml-parser-core")
}

tasks.withType(JavaCompile) {
Expand Down
6 changes: 4 additions & 2 deletions plantuml-parser-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'java'
id 'maven-publish'
id 'org.jetbrains.kotlin.jvm' version '1.9.10'
}

group 'com.shuzijun'
Expand All @@ -12,9 +13,10 @@ repositories {
}

dependencies {
compile "com.github.javaparser:javaparser-core:3.25.3"
api "com.github.javaparser:javaparser-core:3.25.3"

compile "commons-io:commons-io:2.8.0"
api "commons-io:commons-io:2.8.0"
api "org.jetbrains.kotlin:kotlin-compiler"
}

tasks.withType(JavaCompile) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @author shuzijun
*/
public class ClassVoidVisitor extends VoidVisitorAdapter<PUml> {
public class ClassVoidVisitor extends VoidVisitorAdapter<PUml> implements MyVisitor {

private final String packageName;

Expand Down Expand Up @@ -340,16 +340,6 @@ public void visit(EnumConstantDeclaration enumConstantDeclaration, PUml pUml) {
}
}

private PUmlClass createUmlClass() {
PUmlClass pUmlClass = new PUmlClass();
if (parserConfig.isShowPackage()) {
pUmlClass.setPackageName(packageName);
} else {
pUmlClass.setPackageName("");
}
return pUmlClass;
}

private NodeList<ImportDeclaration> parseImport(Node node, PUmlClass pUmlClass, PUmlView pUmlView) {
if (node instanceof CompilationUnit) {
return ((CompilationUnit) node).getImports();
Expand All @@ -369,11 +359,14 @@ private NodeList<ImportDeclaration> parseImport(Node node, PUmlClass pUmlClass,
return null;
}

private String getPackageNamePrefix(String packageName) {
if (packageName == null || packageName.trim().equals("")) {
return "";
} else {
return packageName + ".";
}

@Override
public String getPackageName() {
return packageName;
}

@Override
public ParserConfig getParserConfig() {
return parserConfig;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.shuzijun.plantumlparser.core;

public class Constant {

public static String VisibilityAll = "*";
public static String VisibilityPrivate = "private";
public static String VisibilityDefault = "default";
public static String VisibilityProtected = "protected";
public static String VisibilityPublic = "public";



}
Loading

0 comments on commit 69614ad

Please sign in to comment.