C# Class Spring.Objects.Factory.Xml.NamespaceParserRegistry

Provides a resolution mechanism for configuration parsers.

The DefaultObjectDefinitionDocumentReader uses this registry class to find the parser handling a specific namespace.

Exibir arquivo Open project: spring-projects/spring-net Class Usage Examples

Public Methods

Method Description
GetAssemblySchemaLocation ( Type schemaLocationAssemblyHint, string schemaLocation ) : string

Constructs a "assembly://..." qualified schemaLocation url using the given type to obtain the assembly name.

GetParser ( string namespaceURI ) : INamespaceParser

Returns a parser for the given namespace.

GetSchemas ( ) : XmlSchemaSet

Returns a schema collection containing validation schemas for all registered parsers.

RegisterParser ( INamespaceParser parser ) : void

Pegisters parser, using default namespace and schema location as defined by the NamespaceParserAttribute.

RegisterParser ( INamespaceParser parser, string namespaceUri, string schemaLocation ) : void

Associates a parser with a namespace.

Parsers registered with the same namespaceUri as that of a parser that has previously been registered will overwrite the existing parser.

RegisterParser ( Type parserType ) : void

Pegisters parser, using default namespace and schema location as defined by the NamespaceParserAttribute.

RegisterParser ( Type parserType, string namespaceUri, string schemaLocation ) : void

Associates a parser with a namespace.

Parsers registered with the same namespaceUri as that of a parser that has previously been registered will overwrite the existing parser.

Reset ( ) : void

Reset the list of registered parsers to "factory"-setting

use for unit tests only

Private Methods

Method Description
GetDefaults ( Type parserType ) : NamespaceParserAttribute

Returns default values for the parser namespace and schema location as defined by the NamespaceParserAttribute.

NamespaceParserRegistry ( ) : System

Creates a new instance of the NamespaceParserRegistry class.

RegisterSchema ( string namespaceUri, string schemaLocation ) : void

Register a schema as well-known

RegisterWellknownNamespaceParserType ( string namespaceUri ) : bool

Registers the INamespaceParser type for wellknown namespaces

Method Details

GetAssemblySchemaLocation() public static method

Constructs a "assembly://..." qualified schemaLocation url using the given type to obtain the assembly name.
public static GetAssemblySchemaLocation ( Type schemaLocationAssemblyHint, string schemaLocation ) : string
schemaLocationAssemblyHint System.Type
schemaLocation string
return string

GetParser() public static method

Returns a parser for the given namespace.
public static GetParser ( string namespaceURI ) : INamespaceParser
namespaceURI string /// The namespace for which to lookup the parser implementation. ///
return INamespaceParser

GetSchemas() public static method

Returns a schema collection containing validation schemas for all registered parsers.
public static GetSchemas ( ) : XmlSchemaSet
return System.Xml.Schema.XmlSchemaSet

RegisterParser() public static method

Pegisters parser, using default namespace and schema location as defined by the NamespaceParserAttribute.
/// If is . ///
public static RegisterParser ( INamespaceParser parser ) : void
parser INamespaceParser /// The parser instance. ///
return void

RegisterParser() public static method

Associates a parser with a namespace.
Parsers registered with the same namespaceUri as that of a parser that has previously been registered will overwrite the existing parser.
/// If is , or if /// is not specified and parser class /// does not have default value defined using . ///
public static RegisterParser ( INamespaceParser parser, string namespaceUri, string schemaLocation ) : void
parser INamespaceParser /// The parser instance. ///
namespaceUri string /// The namespace with which to associate instance of the parser. ///
schemaLocation string /// The location of the XML schema that should be used for validation /// of the XML elements that belong to the specified namespace /// (can be any valid Spring.NET resource URI). ///
return void

RegisterParser() public static method

Pegisters parser, using default namespace and schema location as defined by the NamespaceParserAttribute.
/// If is . ///
public static RegisterParser ( Type parserType ) : void
parserType System.Type /// The of the parser that will be activated /// when an element in its default namespace is encountered. ///
return void

RegisterParser() public static method

Associates a parser with a namespace.
Parsers registered with the same namespaceUri as that of a parser that has previously been registered will overwrite the existing parser.
/// If the is not a /// that implements the /// interface. /// /// If is . ///
public static RegisterParser ( Type parserType, string namespaceUri, string schemaLocation ) : void
parserType System.Type /// The of the parser that will be activated /// when the attendant is /// encountered. ///
namespaceUri string /// The namespace with which to associate instance of the parser. ///
schemaLocation string /// The location of the XML schema that should be used for validation /// of the XML elements that belong to the specified namespace /// (can be any valid Spring.NET resource URI). ///
return void

Reset() public static method

Reset the list of registered parsers to "factory"-setting
use for unit tests only
public static Reset ( ) : void
return void