Skip to content

Commit

Permalink
Strong improvements in JNetReflector (#181)
Browse files Browse the repository at this point in the history
* #178: update JNetReflector to manage Main-Class with new IJNetBridgeMain, remove keyword from argument names, improved management of generic super-classes, improved management of generics in constructor arguments

* #178: upgrade code after change into JNetReflector

* Added build and create to the list of names to be avoided in Properties

* #178 (comment): added switch to rename classes, better management of return type in generics

* #178 (comment)

* #178 (comment)

* #178 (comment): created interfaces for each Class that is a Java interface
#137: created the stub methods of the listener interface, first step to introduce auto generated Listeners

* #178 (comment): added where clause based on interfaces and forced the new constraint

* #178 (comment): when a constraint is a native type it is removed

* #178 (comment): fixed not matching declaration

* #178 (comment): removed many warning during compilation related to newly added interfaces

* Update classes with warning removal

* #178 (comment): update where clause generation when a generic class depends on itself when extended

* #178 (comment): added switches related to interface generation

* #178 (comment): management of Iterator and update retriever of generic type defined for Iterator and Iterable

* #178 (comment): fixed generation of avoid interfaces

* #137: concrete classes implementing a Listener does not extend it
#178 (comment): classes with a single interface which isn't a listener inherits from interface implementation class

* #137 (comment): Use always JVMBridgeException when there is an exception type in parameters to have an unified approach between listeners and methods

* Code update for #137 (comment)

* Folder structure review: Extensions moved under Specific

* #178 (comment): limited super interfaces

* #178 (comment): solved base class inheritance from avoided types

* #178 (comment): JVMInterfaceName shall use GetGenerics to get the real type

* #178 (comment): added avoidance check of inner types

* #178 (comment): Added namespace to IJNetBridgeMain
  • Loading branch information
masesdevelopers authored Jun 12, 2023
1 parent 44acc28 commit 43504bd
Show file tree
Hide file tree
Showing 2,043 changed files with 63,464 additions and 7,566 deletions.
3 changes: 3 additions & 0 deletions src/net/Documentation/articles/usageReflector.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ _jnr_ accepts the following command-line switch:
* **ClassesToAvoidInGenerics**: A CSV list of classes to be removed during analysis from the classes which have generics types
* **ClassesToBeListener**: A CSV list of class names to be treated as Listener
* **NamespacesInConflict**: A CSV list of namespaces in conflict with class name: to this one will be added an "Ns" at the end
* **ClassesInConflict**: A CSV list of classes in conflict with namespace name: to this one will be added an "Class" at the end
* **OnlyPropertiesForGetterSetter**: The option forces the tool to convert into properties only getter/setter
* **ReflectDeprecated**: The option forces the tool to write any constructor, method or field marked as deprecated, default is to avoid deprecated
* **AvoidCSharpGenericDefinition**: The option forces the tool to reflect generics without create the C# generic definition
* **AvoidCSharpGenericClauseDefinition**: The option forces the tool to reflect generics without create the clauses of C# generic definition
* **DisableGenericsInNonGenericClasses**: The option disables generation of generic methods in non generic classes
* **DisableGenerics**: The option forces the tool to disable any generic type
* **CreateInterfaceInheritance**: The option forces the tool to create the C# interface inheritance
* **DisableInterfaceMethodGeneration**: The option disables the generation of the methods in the C# interface
* **AvoidParallelBuild**: The option forces the tool to disable parallel execution
* **DryRun**: Execute everything, but do not write anything to disk
* **DoNotCamel**: Does not use camelized names in methods, class and so on
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@ namespace Java.Awt.Dnd
/// <summary>
/// Interface for <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/dnd/DragGestureListener.html"/>
/// </summary>
public interface IDragGestureListener : IJVMBridgeBase
public partial interface IDragGestureListener : IJVMBridgeBase
{
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/dnd/DragGestureListener.html#dragGestureRecognized(java.awt.dnd.DragGestureEvent)"/>
/// </summary>
void DragGestureRecognized(DragGestureEvent dge);

}

/// <summary>
Expand Down Expand Up @@ -68,10 +65,5 @@ void EventHandlerDragGestureRecognized(object sender, CLRListenerEventArgs<CLREv
{
OnDragGestureRecognized(data.EventData.TypedEventData);
}
/// <inheritdoc cref="IDragGestureListener.DragGestureRecognized(DragGestureEvent)"/>
public virtual void DragGestureRecognized(DragGestureEvent dge)
{

}
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -164,35 +164,5 @@ void EventHandlerDragMouseMoved(object sender, CLRListenerEventArgs<CLREventData
{
OnDragMouseMoved(data.EventData.TypedEventData);
}
/// <inheritdoc cref="IDragSourceAdapter.DragEnter(DragSourceDragEvent)"/>
public virtual void DragEnter(DragSourceDragEvent dtde)
{

}
/// <inheritdoc cref="IDragSourceAdapter.DragOver(DragSourceDragEvent)"/>
public virtual void DragOver(DragSourceDragEvent dtde)
{

}
/// <inheritdoc cref="IDragSourceAdapter.DropActionChanged(DragSourceDragEvent)"/>
public virtual void DropActionChanged(DragSourceDragEvent dtde)
{

}
/// <inheritdoc cref="IDragSourceAdapter.DragExit(DragSourceEvent)"/>
public virtual void DragExit(DragSourceEvent dte)
{

}
/// <inheritdoc cref="IDragSourceAdapter.DragDropEnd(DragSourceDropEvent)"/>
public virtual void DragDropEnd(DragSourceDropEvent dsde)
{

}
/// <inheritdoc cref="IDragSourceAdapter.DragMouseMoved(DragSourceDragEvent)"/>
public virtual void DragMouseMoved(DragSourceDragEvent dsde)
{

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,9 @@ namespace Java.Awt.Dnd
/// <summary>
/// Interface for <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/dnd/DragSourceListener.html"/>
/// </summary>
public interface IDragSourceListener : IJVMBridgeBase
public partial interface IDragSourceListener : IJVMBridgeBase
{
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/dnd/DragSourceListener.html#dragEnter(java.awt.dnd.DragSourceDragEvent)"/>
/// </summary>
void DragEnter(DragSourceDragEvent dtde);
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/dnd/DragSourceListener.html#dragOver(java.awt.dnd.DragSourceDragEvent)"/>
/// </summary>
void DragOver(DragSourceDragEvent dtde);
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/dnd/DragSourceListener.html#dropActionChanged(java.awt.dnd.DragSourceDragEvent)"/>
/// </summary>
void DropActionChanged(DragSourceDragEvent dtde);
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/dnd/DragSourceListener.html#dragExit(java.awt.dnd.DragSourceEvent)"/>
/// </summary>
void DragExit(DragSourceEvent dte);
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/dnd/DragSourceListener.html#dragDropEnd(java.awt.dnd.DragSourceDropEvent)"/>
/// </summary>
void DragDropEnd(DragSourceDropEvent dsde);

}

/// <summary>
Expand Down Expand Up @@ -145,31 +126,5 @@ void EventHandlerDragDropEnd(object sender, CLRListenerEventArgs<CLREventData<Dr
{
OnDragDropEnd(data.EventData.TypedEventData);
}

/// <inheritdoc cref="IDragSourceListener.DragEnter(DragSourceDragEvent)"/>
public virtual void DragEnter(DragSourceDragEvent dtde)
{

}
/// <inheritdoc cref="IDragSourceListener.DragOver(DragSourceDragEvent)"/>
public virtual void DragOver(DragSourceDragEvent dtde)
{

}
/// <inheritdoc cref="IDragSourceListener.DropActionChanged(DragSourceDragEvent)"/>
public virtual void DropActionChanged(DragSourceDragEvent dtde)
{

}
/// <inheritdoc cref="IDragSourceListener.DragExit(DragSourceEvent)"/>
public virtual void DragExit(DragSourceEvent dte)
{

}
/// <inheritdoc cref="IDragSourceListener.DragDropEnd(DragSourceDropEvent)"/>
public virtual void DragDropEnd(DragSourceDropEvent dsde)
{

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,9 @@ namespace Java.Awt.Dnd
/// <summary>
/// Interface for <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/dnd/DropTargetListener.html"/>
/// </summary>
public interface IDropTargetListener : IJVMBridgeBase
public partial interface IDropTargetListener : IJVMBridgeBase
{
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/dnd/DropTargetListener.html#dragEnter(java.awt.dnd.DropTargetDragEvent)"/>
/// </summary>
void DragEnter(DropTargetDragEvent dtde);
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/dnd/DropTargetListener.html#dragOver(java.awt.dnd.DropTargetDragEvent)"/>
/// </summary>
void DragOver(DropTargetDragEvent dtde);
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/dnd/DropTargetListener.html#dropActionChanged(java.awt.dnd.DropTargetDragEvent)"/>
/// </summary>
void DropActionChanged(DropTargetDragEvent dtde);
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/dnd/DropTargetListener.html#dragExit(java.awt.dnd.DropTargetEvent)"/>
/// </summary>
void DragExit(DropTargetEvent dte);
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/dnd/DropTargetListener.html#drop(java.awt.dnd.DropTargetDropEvent)"/>
/// </summary>
void Drop(DropTargetDropEvent dtde);

}

/// <summary>
Expand Down Expand Up @@ -145,30 +126,5 @@ void EventHandlerDrop(object sender, CLRListenerEventArgs<CLREventData<DropTarge
{
OnDrop(data.EventData.TypedEventData);
}
/// <inheritdoc cref="IDropTargetListener.DragEnter(DropTargetDragEvent)"/>
public virtual void DragEnter(DropTargetDragEvent dtde)
{

}
/// <inheritdoc cref="IDropTargetListener.DragOver(DropTargetDragEvent)"/>
public virtual void DragOver(DropTargetDragEvent dtde)
{

}
/// <inheritdoc cref="IDropTargetListener.DropActionChanged(DropTargetDragEvent)"/>
public virtual void DropActionChanged(DropTargetDragEvent dtde)
{

}
/// <inheritdoc cref="IDropTargetListener.DragExit(DropTargetEvent)"/>
public virtual void DragExit(DropTargetEvent dte)
{

}
/// <inheritdoc cref="IDropTargetListener.Drop(DropTargetDropEvent)"/>
public virtual void Drop(DropTargetDropEvent dtde)
{

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@ namespace Java.Awt.EventNs
/// <summary>
/// Interface for <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/event/AWTEventListener.html"/>
/// </summary>
public interface IAWTEventListener : IJVMBridgeBase
public partial interface IAWTEventListener : IJVMBridgeBase
{
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/event/AWTEventListener.html#eventDispatched(java.awt.AWTEvent)"/>
/// </summary>
void EventDispatched(AWTEvent e);

}

/// <summary>
Expand Down Expand Up @@ -68,10 +65,5 @@ void EventHandlerEventDispatched(object sender, CLRListenerEventArgs<CLREventDat
{
OnEventDispatched(data.EventData.TypedEventData);
}
/// <inheritdoc cref="IAWTEventListener.EventDispatched(AWTEvent)"/>
public virtual void EventDispatched(AWTEvent e)
{

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,8 @@ namespace Java.Awt.EventNs
/// <summary>
/// Interface for <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/event/ActionListener.html"/>
/// </summary>
public interface IActionListener : IJVMBridgeBase
public partial interface IActionListener : IJVMBridgeBase
{
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/event/ActionListener.html#actionPerformed(java.awt.event.ActionEvent)"/>
/// </summary>
void ActionPerformed(ActionEvent e);
}

/// <summary>
Expand Down Expand Up @@ -68,10 +64,5 @@ void EventHandlerActionPerformed(object sender, CLRListenerEventArgs<CLREventDat
{
OnActionPerformed(data.EventData.TypedEventData);
}
/// <inheritdoc cref="IActionListener.ActionPerformed(ActionEvent)"/>
public virtual void ActionPerformed(ActionEvent e)
{

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@ namespace Java.Awt.EventNs
/// <summary>
/// Interface for <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/event/AdjustmentListener.html"/>
/// </summary>
public interface IAdjustmentListener : IJVMBridgeBase
public partial interface IAdjustmentListener : IJVMBridgeBase
{
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/event/AdjustmentListener.html#adjustmentValueChanged(java.awt.event.AdjustmentEvent)"/>
/// </summary>
void AdjustmentValueChanged(AdjustmentEvent e);

}

/// <summary>
Expand Down Expand Up @@ -68,10 +65,5 @@ void EventHandlerAdjustmentValueChanged(object sender, CLRListenerEventArgs<CLRE
{
OnAdjustmentValueChanged(data.EventData.TypedEventData);
}
/// <inheritdoc cref="IAdjustmentListener.AdjustmentValueChanged(AdjustmentEvent)"/>
public virtual void AdjustmentValueChanged(AdjustmentEvent e)
{

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,9 @@ namespace Java.Awt.EventNs
/// <summary>
/// Interface for <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/event/ComponentListener.html"/>
/// </summary>
public interface IComponentListener : IJVMBridgeBase
public partial interface IComponentListener : IJVMBridgeBase
{
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/event/ComponentListener.html#componentResized(java.awt.event.ComponentEvent)"/>
/// </summary>
void ComponentResized(ComponentEvent e);
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/event/ComponentListener.html#componentMoved(java.awt.event.ComponentEvent)"/>
/// </summary>
void ComponentMoved(ComponentEvent e);
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/event/ComponentListener.html#componentShown(java.awt.event.ComponentEvent)"/>
/// </summary>
void ComponentShown(ComponentEvent e);
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/event/ComponentListener.html#componentHidden(java.awt.event.ComponentEvent)"/>
/// </summary>
void ComponentHidden(ComponentEvent e);

}

/// <summary>
Expand Down Expand Up @@ -126,25 +111,5 @@ void EventHandlerComponentHidden(object sender, CLRListenerEventArgs<CLREventDat
{
OnComponentHidden(data.EventData.TypedEventData);
}
/// <inheritdoc cref="IComponentListener.ComponentResized(ComponentEvent)"/>
public virtual void ComponentResized(ComponentEvent e)
{

}
/// <inheritdoc cref="IComponentListener.ComponentMoved(ComponentEvent)"/>
public virtual void ComponentMoved(ComponentEvent e)
{

}
/// <inheritdoc cref="IComponentListener.ComponentShown(ComponentEvent)"/>
public virtual void ComponentShown(ComponentEvent e)
{

}
/// <inheritdoc cref="IComponentListener.ComponentHidden(ComponentEvent)"/>
public virtual void ComponentHidden(ComponentEvent e)
{

}
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,9 @@ namespace Java.Awt.EventNs
/// <summary>
/// Interface for <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/event/FocusListener.html"/>
/// </summary>
public interface IFocusListener : IJVMBridgeBase
public partial interface IFocusListener : IJVMBridgeBase
{
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/event/FocusListener.html#focusGained(java.awt.event.FocusEvent)"/>
/// </summary>
void FocusGained(FocusEvent e);
/// <summary>
/// <see href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/event/FocusListener.html#focusLost(java.awt.event.FocusEvent)"/>
/// </summary>
void FocusLost(FocusEvent e);

}

/// <summary>
Expand Down Expand Up @@ -88,15 +81,5 @@ void EventHandlerFocusLost(object sender, CLRListenerEventArgs<CLREventData<Focu
{
OnFocusLost(data.EventData.TypedEventData);
}
/// <inheritdoc cref="IFocusListener.FocusGained(FocusEvent)"/>
public virtual void FocusGained(FocusEvent e)
{

}
/// <inheritdoc cref="IFocusListener.FocusLost(FocusEvent)"/>
public virtual void FocusLost(FocusEvent e)
{

}
}
}
File renamed without changes.
Loading

0 comments on commit 43504bd

Please sign in to comment.