NamespaceSupport Class

Definition

Encapsulate Namespace logic for use by applications using SAX, or internally by SAX drivers.

[Android.Runtime.Register("org/xml/sax/helpers/NamespaceSupport", DoNotGenerateAcw=true)]
public class NamespaceSupport : Java.Lang.Object
[<Android.Runtime.Register("org/xml/sax/helpers/NamespaceSupport", DoNotGenerateAcw=true)>]
type NamespaceSupport = class
    inherit Object
Inheritance
NamespaceSupport
Attributes

Remarks

Encapsulate Namespace logic for use by applications using SAX, or internally by SAX drivers.

<blockquote> <em>This module, both source code and documentation, is in the Public Domain, and comes with <strong>NO WARRANTY</strong>.</em> See http://www.saxproject.org for further information. </blockquote>

This class encapsulates the logic of Namespace processing: it tracks the declarations currently in force for each context and automatically processes qualified XML names into their Namespace parts; it can also be used in reverse for generating XML qnames from Namespaces.

Namespace support objects are reusable, but the reset method must be invoked between each session.

Here is a simple session:

String parts[] = new String[3];
            NamespaceSupport support = new NamespaceSupport();

            support.pushContext();
            support.declarePrefix("", "http://www.w3.org/1999/xhtml");
            support.declarePrefix("dc", "http://www.purl.org/dc#");

            parts = support.processName("p", parts, false);
            System.out.println("Namespace URI: " + parts[0]);
            System.out.println("Local name: " + parts[1]);
            System.out.println("Raw name: " + parts[2]);

            parts = support.processName("dc:title", parts, false);
            System.out.println("Namespace URI: " + parts[0]);
            System.out.println("Local name: " + parts[1]);
            System.out.println("Raw name: " + parts[2]);

            support.popContext();

Note that this class is optimized for the use case where most elements do not contain Namespace declarations: if the same prefix/URI mapping is repeated for each context (for example), this class will be somewhat less efficient.

Although SAX drivers (parsers) may choose to use this class to implement namespace handling, they are not required to do so. Applications must track namespace information themselves if they want to use namespace information.

Added in SAX 2.0.

Java documentation for org.xml.sax.helpers.NamespaceSupport.

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

NamespaceSupport()

Create a new Namespace support object.

NamespaceSupport(IntPtr, JniHandleOwnership)

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

Fields

Nsdecl

The namespace declaration URI as a constant.

Xmlns

The XML Namespace URI as a constant.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
DeclaredPrefixes

Return an enumeration of all prefixes declared in this context.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
NamespaceDeclUris

Returns true if namespace declaration attributes are placed into a namespace. -or- Controls whether namespace declaration attributes are placed into the #NSDECL NSDECL namespace by #processName processName().

PeerReference (Inherited from Object)
Prefixes

Return an enumeration of all prefixes whose declarations are active in the current context.

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.

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
DeclarePrefix(String, String)

Declare a Namespace prefix.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

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

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetPrefix(String)

Return one of the prefixes mapped to a Namespace URI.

GetPrefixes(String)

Return an enumeration of all prefixes for a given URI whose declarations are active in the current context.

GetURI(String)

Look up a prefix and get the currently-mapped Namespace URI.

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)
PopContext()

Revert to the previous Namespace context.

ProcessName(String, String[], Boolean)

Process a raw XML qualified name, after all declarations in the current context have been handled by #declarePrefix declarePrefix().

PushContext()

Start a new Namespace context.

Reset()

Reset this Namespace support object for reuse.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
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)

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, 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)

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