-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JNetReflector update and added Java 11 reflected classes (#131)
* #130: added new command line switch DoNotAddJarsInClasspath * #130: extending ClassLoader, Package and added classes in JNetReflector * #130: upgrade compilation to Java 11 and added new class to get Java classes from modules * #130: upgrade to JCOBridge 2.5.3, update class retrieve using burning wave, better sharing classes between JNetReflector and JNet, every reflection made on Class instead to ZipArchiveEntry * #130: folder rename to be inline with JNetReflector rules * #53: version upgrade * #38: finalize update of JCOBridge * #130: command-line switch becomes ModulesToParse * #130: update namespace name and using to follow JNetReflector rules * #130: Fix generation of properties * #130 (comment): if the class name ends with Listener it is reflected only using a container class and it is in charge to developer to build the Java-.NET connection class * #130: added management of Exception * #130: added check for property name in contrast with method name, plus start adding operators section * #130: added ClassToBeListener, ClassesToAvoid, NamespacesInConflict to manage some conditions raised from Java 11 reflection * #130: Biggest review of previous created classes to receive the classes of Java 11 generated with JNetReflector * #130: update command line switch to ClassesToBeListener * #130: added first generated version of Java 11 classes * #130: added management of cast operators * #130 (comment): preliminary update for operators * #130 (comment): full update after application of operators * #130: updates after JNet changes * #130: reflect Java classes for native types as nullable in .NET * #130: updates trying to create always the same order on classes, methods, etc * #130: updates after ordering * #130: try fix classes sequence * #130: documentation update * Force to set Java 11 as default to solve CodeQL issue
- Loading branch information
1 parent
107e711
commit 059d26d
Showing
3,796 changed files
with
502,302 additions
and
6,994 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
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
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
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
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
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
80 changes: 80 additions & 0 deletions
80
src/java/jnet/src/main/java/org/mases/jnet/JNetReflectorHelper.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,80 @@ | ||
/* | ||
* Copyright 2023 MASES s.r.l. | ||
* | ||
* 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. | ||
* | ||
* Refer to LICENSE for more information. | ||
*/ | ||
|
||
package org.mases.jnet; | ||
|
||
import org.burningwave.core.assembler.ComponentContainer; | ||
import org.burningwave.core.assembler.ComponentSupplier; | ||
import org.burningwave.core.classes.ClassCriteria; | ||
import org.burningwave.core.classes.ClassHunter; | ||
import org.burningwave.core.classes.SearchConfig; | ||
import org.burningwave.core.classes.ClassHunter.SearchResult; | ||
import org.burningwave.core.io.PathHelper; | ||
|
||
import java.util.Collection; | ||
|
||
public class JNetReflectorHelper { | ||
public static Collection<Class<?>> find() { | ||
ComponentSupplier componentSupplier = ComponentContainer.getInstance(); | ||
PathHelper pathHelper = componentSupplier.getPathHelper(); | ||
ClassHunter classHunter = componentSupplier.getClassHunter(); | ||
SearchConfig searchConfig = SearchConfig.forPaths( | ||
//Here you can add all absolute path you want: | ||
//both folders, zip, jar, war, ear and jmod will be recursively scanned. | ||
//For example you can add: "C:\\Users\\user\\.m2" | ||
//With the row below the search will be executed on runtime Classpaths | ||
pathHelper.getMainClassPaths() | ||
); | ||
try (ClassHunter.SearchResult searchResult = classHunter.findBy(searchConfig)) { | ||
return searchResult.getClasses(); | ||
} | ||
} | ||
|
||
public static Collection<Class<?>> find(String packageOrModuleName, boolean isModule) { | ||
ComponentSupplier componentSupplier = ComponentContainer.getInstance(); | ||
|
||
if (isModule) { | ||
PathHelper pathHelper = componentSupplier.getPathHelper(); | ||
ClassHunter classHunter = componentSupplier.getClassHunter(); | ||
try (ClassHunter.SearchResult searchResult = classHunter.findBy( | ||
SearchConfig.forPaths( | ||
pathHelper.getAllMainClassPaths() | ||
).by( | ||
ClassCriteria.create().allThoseThatMatch((currentScannedClass) -> | ||
currentScannedClass.getModule().getName() != null && | ||
currentScannedClass.getModule().getName().equals(packageOrModuleName) | ||
) | ||
) | ||
) | ||
) { | ||
return searchResult.getClasses(); | ||
} | ||
} else { | ||
ClassHunter classHunter = componentSupplier.getClassHunter(); | ||
SearchConfig searchConfig = SearchConfig.byCriteria( | ||
ClassCriteria.create().allThoseThatMatch((cls) -> { | ||
String packageName = cls.getPackage().getName(); | ||
return packageName != null && packageName.matches(packageOrModuleName); | ||
}) | ||
); | ||
try (ClassHunter.SearchResult searchResult = classHunter.findBy(searchConfig)) { | ||
return searchResult.getClasses(); | ||
} | ||
} | ||
} | ||
} |
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
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
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
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,27 @@ | ||
/* | ||
* Copyright 2023 MASES s.r.l. | ||
* | ||
* 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. | ||
* | ||
* Refer to LICENSE for more information. | ||
*/ | ||
|
||
/* | ||
* This file is generated by MASES.JNetReflector (ver. 1.5.2.0) | ||
* using java.* as reference | ||
*/ | ||
|
||
namespace Java.Applet | ||
{ | ||
|
||
} |
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,58 @@ | ||
/* | ||
* Copyright 2023 MASES s.r.l. | ||
* | ||
* 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. | ||
* | ||
* Refer to LICENSE for more information. | ||
*/ | ||
|
||
/* | ||
* This file is generated by MASES.JNetReflector (ver. 1.5.2.0) | ||
* using java.* as reference | ||
*/ | ||
|
||
using MASES.JCOBridge.C2JBridge; | ||
|
||
namespace Java.Awt | ||
{ | ||
#region AWTError | ||
public partial class AWTError | ||
{ | ||
#region Constructors | ||
|
||
#endregion | ||
|
||
#region Class/Interface conversion operators | ||
|
||
#endregion | ||
|
||
#region Fields | ||
|
||
#endregion | ||
|
||
#region Static methods | ||
|
||
#endregion | ||
|
||
#region Instance methods | ||
|
||
#endregion | ||
|
||
#region Nested classes | ||
|
||
#endregion | ||
|
||
// TODO: complete the class | ||
} | ||
#endregion | ||
} |
Oops, something went wrong.