Table of Contents

Class ParserAdapter

Namespace
Org.Xml.Sax.Helpers
Assembly
MASES.JNet.dll
public class ParserAdapter : JVMBridgeListener, IDynamicMetaObjectProvider, IJVMBridgeCore, IEquatable<IJVMBridgeBase>, IDisposable, IJVMBridgeBaseStatic, IJVMBridgeBase, IJVMBridgeDefinition
Inheritance
ParserAdapter
Implements
Derived
Inherited Members
JVMBridgeListener.ListenerShallManageEventIndex
JVMBridgeListener.ListenerShallManageEventName
JVMBridgeListener.ListenerShallManageEventIndexWithData
JVMBridgeListener.ListenerShallManageEventNameWithData
JVMBridgeBase<JVMBridgeListener>.IsAssignableFrom(IJavaType)
JVMBridgeBase<JVMBridgeListener>.IsAssignableFrom<T>()
JVMBridgeBase<JVMBridgeListener>.Execute<T>(params T[])
JVMBridgeBase<JVMBridgeListener>.DynBridgeClazz
JVMBridgeBase<JVMBridgeListener>.BridgeClazz
JVMBridgeBase.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.DynBridgeInstance
JVMBridgeBase.BridgeInstance
JVMBridgeBase.IsBridgeInterface
JVMBridgeBase.IsBridgeAbstract
Extension Methods

Constructors

ParserAdapter()

public ParserAdapter()

Exceptions

SAXException

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

initializer IJVMBridgeBaseInitializer

ParserAdapter(Parser)

public ParserAdapter(Parser arg0)

Parameters

arg0 Parser

Parser

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

args object[]

Properties

BridgeClassName

Java class name to be instantiated

public override string BridgeClassName { get; }

Property Value

string

OnCharacters

public Action<char[], int, int> OnCharacters { get; set; }

Property Value

Action<char[], int, int>

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

public Action OnEndDocument { get; set; }

Property Value

Action

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

Action<String>

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

public Func<ContentHandler> OnGetContentHandler { get; set; }

Property Value

Func<ContentHandler>

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

Action<ContentHandler>

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

public Func<DTDHandler> OnGetDTDHandler { get; set; }

Property Value

Func<DTDHandler>

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

Action<DTDHandler>

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

public Func<EntityResolver> OnGetEntityResolver { get; set; }

Property Value

Func<EntityResolver>

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

Action<EntityResolver>

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

public Func<ErrorHandler> OnGetErrorHandler { get; set; }

Property Value

Func<ErrorHandler>

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

Action<ErrorHandler>

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

Func<String, bool>

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

Action<bool>

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

Func<String, object>

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

Action<object>

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

Action<char[], int, int>

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

public Action<String> OnParse { get; set; }

Property Value

Action<String>

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

Action<InputSource>

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

Action<String, String>

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

Action<ContentHandler>

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

Action<DTDHandler>

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

Action<Locator>

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

Action<EntityResolver>

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

Action<ErrorHandler>

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

Action<String, bool>

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

Action<String, object>

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

public Action OnStartDocument { get; set; }

Property Value

Action

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

Action<String, AttributeList>

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

arg0 char[]

char

arg1 int

int

arg2 int

int

Exceptions

SAXException

EndDocument()

public virtual void EndDocument()

Exceptions

SAXException

EndElement(String)

public virtual void EndElement(String arg0)

Parameters

arg0 String

String

Exceptions

SAXException

GetContentHandler()

public virtual ContentHandler GetContentHandler()

Returns

ContentHandler

ContentHandler

GetDTDHandler()

public virtual DTDHandler GetDTDHandler()

Returns

DTDHandler

DTDHandler

GetEntityResolver()

public virtual EntityResolver GetEntityResolver()

Returns

EntityResolver

EntityResolver

GetErrorHandler()

public virtual ErrorHandler GetErrorHandler()

Returns

ErrorHandler

ErrorHandler

GetFeature(String)

public virtual bool GetFeature(String arg0)

Parameters

arg0 String

String

Returns

bool

bool

Exceptions

SAXNotRecognizedException
SAXNotSupportedException

GetProperty(String)

public virtual object GetProperty(String arg0)

Parameters

arg0 String

String

Returns

object

object

Exceptions

SAXNotRecognizedException
SAXNotSupportedException

IgnorableWhitespace(char[], int, int)

public virtual void IgnorableWhitespace(char[] arg0, int arg1, int arg2)

Parameters

arg0 char[]

char

arg1 int

int

arg2 int

int

Exceptions

SAXException

InitializeHandlers(Type)

Handlers initializer for ParserAdapter

protected virtual void InitializeHandlers(Type listenerRuntimeType)

Parameters

listenerRuntimeType Type

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

eventIndex int

The index of the event triggered as returned from AddEventHandler(string, EventHandler) or AddEventHandler<TDataClass>(string, EventHandler<CLRListenerEventArgs<TDataClass>>)

Returns

bool

Returns true to continue event evaluation, false to return the control to the JVM

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

eventIndex int

Returns

bool

Parse(String)

public virtual void Parse(String arg0)

Parameters

arg0 String

String

Exceptions

IOException
SAXException

Parse(InputSource)

public virtual void Parse(InputSource arg0)

Parameters

arg0 InputSource

InputSource

Exceptions

IOException
SAXException

ProcessingInstruction(String, String)

public virtual void ProcessingInstruction(String arg0, String arg1)

Parameters

arg0 String

String

arg1 String

String

Exceptions

SAXException

SetContentHandler(ContentHandler)

public virtual void SetContentHandler(ContentHandler arg0)

Parameters

arg0 ContentHandler

ContentHandler

SetDTDHandler(DTDHandler)

public virtual void SetDTDHandler(DTDHandler arg0)

Parameters

arg0 DTDHandler

DTDHandler

SetDocumentLocator(Locator)

public virtual void SetDocumentLocator(Locator arg0)

Parameters

arg0 Locator

Locator

SetEntityResolver(EntityResolver)

public virtual void SetEntityResolver(EntityResolver arg0)

Parameters

arg0 EntityResolver

EntityResolver

SetErrorHandler(ErrorHandler)

public virtual void SetErrorHandler(ErrorHandler arg0)

Parameters

arg0 ErrorHandler

ErrorHandler

SetFeature(String, bool)

public virtual void SetFeature(String arg0, bool arg1)

Parameters

arg0 String

String

arg1 bool

bool

Exceptions

SAXNotRecognizedException
SAXNotSupportedException

SetProperty(String, object)

public virtual void SetProperty(String arg0, object arg1)

Parameters

arg0 String

String

arg1 object

object

Exceptions

SAXNotRecognizedException
SAXNotSupportedException

StartDocument()

public virtual void StartDocument()

Exceptions

SAXException

StartElement(String, AttributeList)

public virtual void StartElement(String arg0, AttributeList arg1)

Parameters

arg0 String

String

arg1 AttributeList

AttributeList

Exceptions

SAXException