Udostępnij za pośrednictwem


ValidatorHandler Class

Definition

Streaming validator that works on SAX stream.

[Android.Runtime.Register("javax/xml/validation/ValidatorHandler", DoNotGenerateAcw=true)]
public abstract class ValidatorHandler : Java.Lang.Object, IDisposable, Java.Interop.IJavaPeerable, Org.Xml.Sax.IContentHandler
[<Android.Runtime.Register("javax/xml/validation/ValidatorHandler", DoNotGenerateAcw=true)>]
type ValidatorHandler = class
    inherit Object
    interface IContentHandler
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
ValidatorHandler
Attributes
Implements

Remarks

Streaming validator that works on SAX stream.

A ValidatorHandler object is a thread-unsafe, non-reentrant object. In other words, it is the application's responsibility to make sure that one ValidatorHandler object is not used from more than one thread at any given time.

ValidatorHandler checks if the SAX events follow the set of constraints described in the associated Schema, and additionally it may modify the SAX events (for example by adding default values, etc.)

ValidatorHandler extends from ContentHandler, but it refines the underlying ContentHandler in the following way: <ol> <li>startElement/endElement events must receive non-null String for uri, localName, and qname, even though SAX allows some of them to be null. Similarly, the user-specified ContentHandler will receive non-null Strings for all three parameters.

<li>Applications must ensure that ValidatorHandler's ContentHandler#startPrefixMapping(String,String) and ContentHandler#endPrefixMapping(String) are invoked properly. Similarly, the user-specified ContentHandler will receive startPrefixMapping/endPrefixMapping events. If the ValidatorHandler introduces additional namespace bindings, the user-specified ContentHandler will receive additional startPrefixMapping/endPrefixMapping events.

<li>org.xml.sax.Attributes for the ContentHandler#startElement(String,String,String,Attributes) method may or may not include xmlns* attributes. </ol>

A ValidatorHandler is automatically reset every time the startDocument method is invoked.

<h2>Recognized Properties and Features</h2>

This spec defines the following feature that must be recognized by all ValidatorHandler implementations.

<h3>http://xml.org/sax/features/namespace-prefixes</h3>

This feature controls how a ValidatorHandler introduces namespace bindings that were not present in the original SAX event stream. When this feature is set to true, it must make sure that the user's ContentHandler will see the corresponding xmlns* attribute in the org.xml.sax.Attributes object of the ContentHandler#startElement(String,String,String,Attributes) callback. Otherwise, xmlns* attributes must not be added to org.xml.sax.Attributes that's passed to the user-specified ContentHandler.

(Note that regardless of this switch, namespace bindings are always notified to applications through ContentHandler#startPrefixMapping(String,String) and ContentHandler#endPrefixMapping(String) methods of the ContentHandler specified by the user.)

Note that this feature does <em>NOT</em> affect the way a ValidatorHandler receives SAX events. It merely changes the way it augments SAX events.

This feature is set to false by default.

Added in 1.5.

Java documentation for javax.xml.validation.ValidatorHandler.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

ValidatorHandler()

Constructor for derived classes.

ValidatorHandler(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
ContentHandler

Gets the IContentHandler which receives the augmented validation result.

ErrorHandler

Gets the current IErrorHandler set to this ValidatorHandler.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
ResourceResolver

Gets the current ILSResourceResolver set to this ValidatorHandler.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

TypeInfoProvider

Obtains the TypeInfoProvider implementation of this ValidatorHandler.

Methods

Characters(Char[], Int32, Int32)

Receive notification of character data.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
EndDocument()

Receive notification of the end of a document.

EndElement(String, String, String)

Receive notification of the end of an element.

EndPrefixMapping(String)

End the scope of a prefix-URI mapping.

Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetFeature(String)

Look up the value of a feature flag.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetProperty(String)

Look up the value of a property.

IgnorableWhitespace(Char[], Int32, Int32)

Receive notification of ignorable whitespace in element content.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
ProcessingInstruction(String, String)

Receive notification of a processing instruction.

SetDocumentLocator(ILocator)

Receive an object for locating the origin of SAX document events.

SetFeature(String, Boolean)

Set the value of a feature flag.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetProperty(String, Object)

Set the value of a property.

SkippedEntity(String)

Receive notification of a skipped entity.

StartDocument()

Receive notification of the beginning of a document.

StartElement(String, String, String, IAttributes)

Receive notification of the beginning of an element.

StartPrefixMapping(String, String)

Begin the scope of a prefix-URI Namespace mapping.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to