forked from Prunoideae/ProbeJS-Forge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
136 additions
and
22 deletions.
There are no files selected for viewing
15 changes: 0 additions & 15 deletions
15
src/main/java/com/probejs/rewrite/doc/type/DocTypeArray.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/com/probejs/rewrite/doc/type/java/JavaType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.probejs.rewrite.doc.type.java; | ||
|
||
import com.probejs.rewrite.doc.type.DocType; | ||
|
||
import java.lang.reflect.Type; | ||
import java.util.Collection; | ||
|
||
/** | ||
* @author ZZZank | ||
*/ | ||
public interface JavaType extends DocType { | ||
|
||
Type raw(); | ||
|
||
JavaType base(); | ||
|
||
Collection<Class<?>> relatedClasses(); | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/com/probejs/rewrite/doc/type/java/TypeArray.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.probejs.rewrite.doc.type.java; | ||
|
||
import com.probejs.info.type.IType; | ||
import com.probejs.rewrite.doc.type.DocType; | ||
import com.probejs.rewrite.doc.type.DocTypeResolver; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class TypeArray implements DocType { | ||
|
||
private final DocType base; | ||
|
||
public TypeArray(IType type) { | ||
this.base = DocTypeResolver.of(type.getBase()); | ||
} | ||
} |
11 changes: 6 additions & 5 deletions
11
...robejs/rewrite/doc/type/DocTypeClazz.java → ...bejs/rewrite/doc/type/java/TypeClazz.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
package com.probejs.rewrite.doc.type; | ||
package com.probejs.rewrite.doc.type.java; | ||
|
||
import com.probejs.info.clazz.ClassInfo; | ||
import com.probejs.info.type.IType; | ||
import com.probejs.info.type.TypeClass; | ||
import com.probejs.rewrite.ClazzPath; | ||
import com.probejs.rewrite.doc.DocClazz; | ||
import com.probejs.rewrite.doc.type.DocType; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class DocTypeClazz implements DocType { | ||
public class TypeClazz implements DocType { | ||
|
||
private final ClazzPath path; | ||
private final DocClazz doc; | ||
private final boolean assigned; | ||
|
||
DocTypeClazz(Class<?> clazz) { | ||
TypeClazz(Class<?> clazz) { | ||
this.doc = DocClazz.of(clazz); | ||
this.path = this.doc.getPath(); | ||
this.assigned = !this.doc.getAssignables().isEmpty(); | ||
} | ||
|
||
DocTypeClazz(ClassInfo clazz) { | ||
TypeClazz(ClassInfo clazz) { | ||
this(clazz.getRaw()); | ||
} | ||
|
||
public DocTypeClazz(IType iType) { | ||
public TypeClazz(IType iType) { | ||
this(((TypeClass) iType).getRaw()); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/com/probejs/rewrite/doc/type/java/TypeVariable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.probejs.rewrite.doc.type.java; | ||
|
||
import com.probejs.info.type.TypeResolver; | ||
import com.probejs.rewrite.doc.type.DocTypeResolver; | ||
import lombok.AllArgsConstructor; | ||
import lombok.val; | ||
|
||
import java.lang.reflect.Type; | ||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
/** | ||
* @author ZZZank | ||
*/ | ||
@AllArgsConstructor | ||
public class TypeVariable implements JavaType { | ||
private final java.lang.reflect.TypeVariable<?> raw; | ||
|
||
@Override | ||
public Type raw() { | ||
return raw; | ||
} | ||
|
||
@Override | ||
public JavaType base() { | ||
return this; | ||
} | ||
|
||
@Override | ||
public Collection<Class<?>> relatedClasses() { | ||
val related = new ArrayList<Class<?>>(); | ||
for (Type bound : raw.getBounds()) { | ||
|
||
} | ||
return related; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/probejs/rewrite/doc/type/typescript/TSType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.probejs.rewrite.doc.type.typescript; | ||
|
||
import com.probejs.rewrite.doc.type.DocType; | ||
|
||
/** | ||
* @author ZZZank | ||
*/ | ||
public interface TSType extends DocType { | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/probejs/rewrite/doc/type/typescript/TypeIntersection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.probejs.rewrite.doc.type.typescript; | ||
|
||
import com.probejs.rewrite.doc.type.DocType; | ||
|
||
/** | ||
* aka TypeAnd, "string & number" | ||
* @author ZZZank | ||
*/ | ||
public record TypeIntersection(DocType left, DocType right) implements TSType { | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/probejs/rewrite/doc/type/typescript/TypeLiteral.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.probejs.rewrite.doc.type.typescript; | ||
|
||
import lombok.AllArgsConstructor; | ||
|
||
/** | ||
* @author ZZZank | ||
*/ | ||
@AllArgsConstructor | ||
public class TypeLiteral { | ||
private final String literal; | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/probejs/rewrite/doc/type/typescript/TypeObject.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.probejs.rewrite.doc.type.typescript; | ||
|
||
import com.probejs.rewrite.doc.type.DocType; | ||
import lombok.AllArgsConstructor; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* @author ZZZank | ||
*/ | ||
@AllArgsConstructor | ||
public class TypeObject implements TSType { | ||
private final Map<String, ? extends DocType> map; | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/probejs/rewrite/doc/type/typescript/TypeUnion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.probejs.rewrite.doc.type.typescript; | ||
|
||
import com.probejs.rewrite.doc.type.DocType; | ||
|
||
/** | ||
* aka TypeOr, "string | number" | ||
* | ||
* @author ZZZank | ||
*/ | ||
public record TypeUnion(DocType left, DocType right) implements TSType { | ||
} |