Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions src/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,11 @@
"NamespacesToAvoid": [
"org.apache.commons.logging"
],
"ClassesWithCallbacks": [
{
"ClassName": "org.apache.pdfbox.pdmodel.common.function.type4.Parser$AbstractSyntaxHandler",
"Patterns": [
"^comment.*",
"^newLine.*",
"^whitespace.*"
]
}
],
"ClassesToBeListener": [
"org.apache.pdfbox.pdmodel.common.function.type4.Parser$SyntaxHandler"
],
"ClassesToAvoid": [
"org.apache.pdfbox.pdmodel.common.function.type4.Parser$AbstractSyntaxHandler",
"org.apache.pdfbox.pdmodel.font.FileSystemFontProvider"
],
"ClassesManuallyDeveloped": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@ public void setReturnData(Object retData) {
_internalListener.setReturnData(retData);
}

//@Override
public void token(java.lang.CharSequence arg0) {
org.mases.jnet.developed.JNetEventResult eventDataExchange = new org.mases.jnet.developed.JNetEventResult();
raiseEvent("token", eventDataExchange, arg0); if (!eventDataExchange.getHasOverride()) throw new UnsupportedOperationException("The method shall be implemented in .NET side since does not have a default implementation within the JVM");
}
//@Override
public void tokenBase(java.lang.CharSequence arg0) {
super.token(arg0);
}
//@Override
public void comment(java.lang.CharSequence arg0) {
org.mases.jnet.developed.JNetEventResult eventDataExchange = new org.mases.jnet.developed.JNetEventResult();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ public partial class AbstractSyntaxHandler
/// </summary>
protected virtual void InitializeHandlers()
{
AddEventHandler("token", new global::System.EventHandler<CLRListenerEventArgs<CLREventData<MASES.JNet.Specific.JNetEventResult>>>(TokenEventHandler));
AddEventHandler("comment", new global::System.EventHandler<CLRListenerEventArgs<CLREventData<MASES.JNet.Specific.JNetEventResult>>>(CommentEventHandler));
AddEventHandler("newLine", new global::System.EventHandler<CLRListenerEventArgs<CLREventData<MASES.JNet.Specific.JNetEventResult>>>(NewLineEventHandler));
AddEventHandler("whitespace", new global::System.EventHandler<CLRListenerEventArgs<CLREventData<MASES.JNet.Specific.JNetEventResult>>>(WhitespaceEventHandler));
Expand All @@ -272,35 +271,9 @@ protected virtual void InitializeHandlers()
/// <see href="https://www.javadoc.io/doc/org.apache.pdfbox/pdfbox/3.0.4/org/apache/pdfbox/pdmodel/common/function/type4/Parser.SyntaxHandler.html#token-java.lang.CharSequence-"/>
/// </summary>
/// <param name="arg0"><see cref="Java.Lang.CharSequence"/></param>
/// <remarks>The method invokes the default implementation in the JVM interface</remarks>
public void TokenBase(Java.Lang.CharSequence arg0)
{
IExecuteWithSignature("tokenBase", "(Ljava/lang/CharSequence;)V", arg0);
}

/// <summary>
/// Handler for <see href="https://www.javadoc.io/doc/org.apache.pdfbox/pdfbox/3.0.4/org/apache/pdfbox/pdmodel/common/function/type4/Parser.SyntaxHandler.html#token-java.lang.CharSequence-"/>
/// </summary>
/// <remarks>If <see cref="OnToken"/> has a value it takes precedence over corresponding class method</remarks>
public global::System.Action<Java.Lang.CharSequence> OnToken { get; set; } = null;

bool hasOverrideToken = true;
void TokenEventHandler(object sender, CLRListenerEventArgs<CLREventData<MASES.JNet.Specific.JNetEventResult>> data)
public void Token(Java.Lang.CharSequence arg0)
{
hasOverrideToken = true;
var methodToExecute = (OnToken != null) ? OnToken : Token;
methodToExecute.Invoke(data.EventData.GetAt<Java.Lang.CharSequence>(0));
data.EventData.TypedEventData.HasOverride = hasOverrideToken;
}

/// <summary>
/// <see href="https://www.javadoc.io/doc/org.apache.pdfbox/pdfbox/3.0.4/org/apache/pdfbox/pdmodel/common/function/type4/Parser.SyntaxHandler.html#token-java.lang.CharSequence-"/>
/// </summary>
/// <param name="arg0"><see cref="Java.Lang.CharSequence"/></param>
/// <remarks>The method invokes the default implementation in the JVM interface using <see cref="TokenBase"/>; override the method to implement a different behavior</remarks>
public virtual void Token(Java.Lang.CharSequence arg0)
{
hasOverrideToken = false;
IExecuteWithSignature("token", "(Ljava/lang/CharSequence;)V", arg0);
}
/// <summary>
/// <see href="https://www.javadoc.io/doc/org.apache.pdfbox/pdfbox/3.0.4/org/apache/pdfbox/pdmodel/common/function/type4/Parser.AbstractSyntaxHandler.html#comment-java.lang.CharSequence-"/>
Expand Down
Loading