Class ParserAdapter
public class ParserAdapter : JVMBridgeListener, IDynamicMetaObjectProvider, IJVMBridgeCore, IEquatable<IJVMBridgeBase>, IDisposable, IJVMBridgeBaseStatic, IJVMBridgeBase, IJVMBridgeDefinition
- Inheritance
-
ParserAdapter
- Implements
- Derived
- Inherited Members
-
JVMBridgeListener.ListenerShallManageEventIndexJVMBridgeListener.ListenerShallManageEventNameJVMBridgeListener.ListenerShallManageEventIndexWithDataJVMBridgeListener.ListenerShallManageEventNameWithDataJVMBridgeBase<JVMBridgeListener>.IsAssignableFrom(IJavaType)JVMBridgeBase<JVMBridgeListener>.IsAssignableFrom<T>()JVMBridgeBase<JVMBridgeListener>.Execute<T>(params T[])JVMBridgeBase<JVMBridgeListener>.DynBridgeClazzJVMBridgeBase<JVMBridgeListener>.BridgeClazzJVMBridgeBase.ReferenceEqualsJVM(IJVMBridgeBase, IJVMBridgeBase)JVMBridgeBase.RuntimeClassNameOf<T>()JVMBridgeBase.ClassNameOf<T>()JVMBridgeBase.ClassOf<T>()JVMBridgeBase.WrapsDirect<TNewClass>(IJavaObject)JVMBridgeBase.Wraps<TNewClass>(IJavaObject)JVMBridgeBase.Wraps<TNewClass, TReturn>(IJavaObject)JVMBridgeBase.Wraps<TNewClass, TReturn, TConverter>(IJavaObject)JVMBridgeBase.MonitorEnter()JVMBridgeBase.MonitorExit()JVMBridgeBase.IsInstanceOf(IJavaType)JVMBridgeBase.IsInstanceOf<T>()JVMBridgeBase.RuntimeIsInstanceOf<T>()JVMBridgeBase.CastTo<TNewClass>()JVMBridgeBase.CastToAndDetach<TNewClass>()JVMBridgeBase.CastDirect<TNewClass>()JVMBridgeBase.CastDirectAndDetach<TNewClass>()JVMBridgeBase.CheckDisposed()JVMBridgeBase.ToString()JVMBridgeBase.Equals(IJVMBridgeBase)JVMBridgeBase.GetHashCode()JVMBridgeBase.Notify()JVMBridgeBase.NotifyAll()JVMBridgeBase.Wait()JVMBridgeBase.IExecuteWithSignature<TNewClass, TReturn, TConverter>(string, string, params object[])JVMBridgeBase.DynBridgeInstanceJVMBridgeBase.BridgeInstanceJVMBridgeBase.IsBridgeInterfaceJVMBridgeBase.IsBridgeAbstract
- Extension Methods
Constructors
ParserAdapter()
public ParserAdapter()
Exceptions
ParserAdapter(IJVMBridgeBaseInitializer)
Initializer used internally by JCOBridge. Do not use directly.
[Obsolete("This public initializer is needed for JCOBridge internal use, other uses can produce unidentible behaviors.")]
public ParserAdapter(IJVMBridgeBaseInitializer initializer)
Parameters
initializerIJVMBridgeBaseInitializer
ParserAdapter(Parser)
public ParserAdapter(Parser arg0)
Parameters
ParserAdapter(params object[])
Generic constructor used by JCOBridge when a derived class needs to forward arguments to the base JVMBridgeBase class.
public ParserAdapter(params object[] args)
Parameters
argsobject[]
Properties
BridgeClassName
Java class name to be instantiated
public override string BridgeClassName { get; }
Property Value
OnCharacters
Handler for https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/ParserAdapter.html#characters-char[]-int-int-
public Action<char[], int, int> OnCharacters { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnEndDocument
Handler for https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/ParserAdapter.html#endDocument--
public Action OnEndDocument { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnEndElement
public Action<String> OnEndElement { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnGetContentHandler
Handler for https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/ParserAdapter.html#getContentHandler--
public Func<ContentHandler> OnGetContentHandler { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnGetContentHandlerDispose
Optional handler invoked after the event handler returns, to dispose the JVM object returned by this event.
public Action<ContentHandler> OnGetContentHandlerDispose { get; set; }
Property Value
Remarks
Set OnGetContentHandlerDispose when the event handler returns a JVM-backed object that is no longer needed after the call. The handler receives the return value and is responsible for calling IDisposable.Dispose on it, releasing the underlying JVM global reference immediately instead of waiting for the .NET garbage collector to finalize it. If not set, the return value is not disposed automatically.
OnGetDTDHandler
Handler for https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/ParserAdapter.html#getDTDHandler--
public Func<DTDHandler> OnGetDTDHandler { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnGetDTDHandlerDispose
Optional handler invoked after the event handler returns, to dispose the JVM object returned by this event.
public Action<DTDHandler> OnGetDTDHandlerDispose { get; set; }
Property Value
Remarks
Set OnGetDTDHandlerDispose when the event handler returns a JVM-backed object that is no longer needed after the call. The handler receives the return value and is responsible for calling IDisposable.Dispose on it, releasing the underlying JVM global reference immediately instead of waiting for the .NET garbage collector to finalize it. If not set, the return value is not disposed automatically.
OnGetEntityResolver
Handler for https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/ParserAdapter.html#getEntityResolver--
public Func<EntityResolver> OnGetEntityResolver { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnGetEntityResolverDispose
Optional handler invoked after the event handler returns, to dispose the JVM object returned by this event.
public Action<EntityResolver> OnGetEntityResolverDispose { get; set; }
Property Value
Remarks
Set OnGetEntityResolverDispose when the event handler returns a JVM-backed object that is no longer needed after the call. The handler receives the return value and is responsible for calling IDisposable.Dispose on it, releasing the underlying JVM global reference immediately instead of waiting for the .NET garbage collector to finalize it. If not set, the return value is not disposed automatically.
OnGetErrorHandler
Handler for https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/ParserAdapter.html#getErrorHandler--
public Func<ErrorHandler> OnGetErrorHandler { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnGetErrorHandlerDispose
Optional handler invoked after the event handler returns, to dispose the JVM object returned by this event.
public Action<ErrorHandler> OnGetErrorHandlerDispose { get; set; }
Property Value
Remarks
Set OnGetErrorHandlerDispose when the event handler returns a JVM-backed object that is no longer needed after the call. The handler receives the return value and is responsible for calling IDisposable.Dispose on it, releasing the underlying JVM global reference immediately instead of waiting for the .NET garbage collector to finalize it. If not set, the return value is not disposed automatically.
OnGetFeature
public Func<String, bool> OnGetFeature { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnGetFeatureDispose
Optional handler invoked after the event handler returns, to dispose the JVM object returned by this event.
public Action<bool> OnGetFeatureDispose { get; set; }
Property Value
Remarks
Set OnGetFeatureDispose when the event handler returns a JVM-backed object that is no longer needed after the call. The handler receives the return value and is responsible for calling IDisposable.Dispose on it, releasing the underlying JVM global reference immediately instead of waiting for the .NET garbage collector to finalize it. If not set, the return value is not disposed automatically.
OnGetProperty
public Func<String, object> OnGetProperty { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnGetPropertyDispose
Optional handler invoked after the event handler returns, to dispose the JVM object returned by this event.
public Action<object> OnGetPropertyDispose { get; set; }
Property Value
Remarks
Set OnGetPropertyDispose when the event handler returns a JVM-backed object that is no longer needed after the call. The handler receives the return value and is responsible for calling IDisposable.Dispose on it, releasing the underlying JVM global reference immediately instead of waiting for the .NET garbage collector to finalize it. If not set, the return value is not disposed automatically.
OnIgnorableWhitespace
public Action<char[], int, int> OnIgnorableWhitespace { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnParse
Handler for https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/ParserAdapter.html#parse-java.lang.String-
public Action<String> OnParse { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnParse1
public Action<InputSource> OnParse1 { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnProcessingInstruction
public Action<String, String> OnProcessingInstruction { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnSetContentHandler
public Action<ContentHandler> OnSetContentHandler { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnSetDTDHandler
public Action<DTDHandler> OnSetDTDHandler { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnSetDocumentLocator
public Action<Locator> OnSetDocumentLocator { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnSetEntityResolver
public Action<EntityResolver> OnSetEntityResolver { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnSetErrorHandler
public Action<ErrorHandler> OnSetErrorHandler { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnSetFeature
public Action<String, bool> OnSetFeature { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnSetProperty
public Action<String, object> OnSetProperty { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnStartDocument
Handler for https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/ParserAdapter.html#startDocument--
public Action OnStartDocument { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
OnStartElement
public Action<String, AttributeList> OnStartElement { get; set; }
Property Value
Remarks
Assign a delegate to handle the event without subclassing. If both this handler and a virtual method override are present, the delegate takes precedence. Set to null to delegate to the virtual method.
Methods
Characters(char[], int, int)
public virtual void Characters(char[] arg0, int arg1, int arg2)
Parameters
Exceptions
EndDocument()
public virtual void EndDocument()
Exceptions
EndElement(String)
public virtual void EndElement(String arg0)
Parameters
Exceptions
GetContentHandler()
https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/ParserAdapter.html#getContentHandler--
public virtual ContentHandler GetContentHandler()
Returns
GetDTDHandler()
public virtual DTDHandler GetDTDHandler()
Returns
GetEntityResolver()
https://docs.oracle.com/javase/8/docs/api/org/xml/sax/helpers/ParserAdapter.html#getEntityResolver--
public virtual EntityResolver GetEntityResolver()
Returns
GetErrorHandler()
public virtual ErrorHandler GetErrorHandler()
Returns
GetFeature(String)
public virtual bool GetFeature(String arg0)
Parameters
Returns
Exceptions
GetProperty(String)
public virtual object GetProperty(String arg0)
Parameters
Returns
Exceptions
IgnorableWhitespace(char[], int, int)
public virtual void IgnorableWhitespace(char[] arg0, int arg1, int arg2)
Parameters
Exceptions
InitializeHandlers(Type)
Handlers initializer for ParserAdapter
protected virtual void InitializeHandlers(Type listenerRuntimeType)
Parameters
listenerRuntimeTypeType
ListenerShallManageEvent(int)
Invoked from the JVMBridgeListener on each received event to notify the user which can decide to abort the execution for the specific event returning false
protected override bool ListenerShallManageEvent(int eventIndex)
Parameters
eventIndexintThe index of the event triggered as returned from AddEventHandler(string, EventHandler) or AddEventHandler<TDataClass>(string, EventHandler<CLRListenerEventArgs<TDataClass>>)
Returns
Remarks
By default every event continues the execution and reads the data from JVM; this implies an extra cost which can be limited using ListenerShallManageEvent(int) or the MASES.JCOBridge.C2JBridge.JVMBridgeListener.ListenerShallManageEventIndex/MASES.JCOBridge.C2JBridge.JVMBridgeListener.ListenerShallManageEventName handlers. Returning false the control is immediately returned to the JVM, anyway the user has received the notification. It can be useful in scenarios where the user is interested in few events and the other are simply discarded to optimize the execution speed. By default, this function invokes MASES.JCOBridge.C2JBridge.JVMBridgeListener.ListenerShallManageEventIndex, then try MASES.JCOBridge.C2JBridge.JVMBridgeListener.ListenerShallManageEventName if they are set or return true
ListenerShallManageEventHandlers(int)
protected virtual bool ListenerShallManageEventHandlers(int eventIndex)
Parameters
eventIndexint
Returns
Parse(String)
public virtual void Parse(String arg0)
Parameters
Exceptions
Parse(InputSource)
public virtual void Parse(InputSource arg0)
Parameters
arg0InputSource
Exceptions
ProcessingInstruction(String, String)
public virtual void ProcessingInstruction(String arg0, String arg1)
Parameters
Exceptions
SetContentHandler(ContentHandler)
public virtual void SetContentHandler(ContentHandler arg0)
Parameters
SetDTDHandler(DTDHandler)
public virtual void SetDTDHandler(DTDHandler arg0)
Parameters
arg0DTDHandler
SetDocumentLocator(Locator)
public virtual void SetDocumentLocator(Locator arg0)
Parameters
SetEntityResolver(EntityResolver)
public virtual void SetEntityResolver(EntityResolver arg0)
Parameters
SetErrorHandler(ErrorHandler)
public virtual void SetErrorHandler(ErrorHandler arg0)
Parameters
arg0ErrorHandler
SetFeature(String, bool)
public virtual void SetFeature(String arg0, bool arg1)
Parameters
Exceptions
SetProperty(String, object)
public virtual void SetProperty(String arg0, object arg1)
Parameters
Exceptions
StartDocument()
public virtual void StartDocument()
Exceptions
StartElement(String, AttributeList)
public virtual void StartElement(String arg0, AttributeList arg1)
Parameters
arg0Stringarg1AttributeList