Skip to content

Commit

Permalink
feature: support building documents incrementally
Browse files Browse the repository at this point in the history
  • Loading branch information
Fioooooooo committed Nov 16, 2023
1 parent bafa85d commit 81069a0
Showing 26 changed files with 1,452 additions and 57 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -73,6 +73,11 @@
<artifactId>slf4j-api</artifactId>
<version>2.0.7</version>
</dependency>
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>5.13.2.202306221912-r</version>
</dependency>
</dependencies>
<build>
<plugins>
Original file line number Diff line number Diff line change
@@ -22,7 +22,6 @@

import com.power.common.model.EnumDictionary;

import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.Collections;

@@ -38,8 +37,7 @@ public interface DictionaryValuesResolver {
* @param clazz dictionary class
* @return the dictionary
*/
@Nonnull
default <T extends EnumDictionary> Collection<T> resolve(@Nonnull Class<?> clazz) {
default <T extends EnumDictionary> Collection<T> resolve(Class<?> clazz) {
return resolve();
}

@@ -48,7 +46,6 @@ default <T extends EnumDictionary> Collection<T> resolve(@Nonnull Class<?> clazz
*
* @see #resolve(Class)
*/
@Nonnull
default <T extends EnumDictionary> Collection<T> resolve() {
return Collections.emptyList();
}
5 changes: 3 additions & 2 deletions src/main/java/com/ly/doc/factory/BuildTemplateFactory.java
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@
package com.ly.doc.factory;

import com.ly.doc.constants.FrameworkEnum;
import com.ly.doc.model.IDoc;
import com.ly.doc.template.IDocBuildTemplate;

/**
@@ -35,10 +36,10 @@ public class BuildTemplateFactory {
* @param <T> API doc type
* @return Implements of IDocBuildTemplate
*/
public static <T> IDocBuildTemplate getDocBuildTemplate(String framework) {
public static <T extends IDoc> IDocBuildTemplate<T> getDocBuildTemplate(String framework) {
String className = FrameworkEnum.getClassNameByFramework(framework);
try {
return (IDocBuildTemplate) Class.forName(className).newInstance();
return (IDocBuildTemplate<T>) Class.forName(className).newInstance();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
Loading

0 comments on commit 81069a0

Please sign in to comment.