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.

Afficher le fichier Open project: spring-projects/spring-net Class Usage Examples

Méthodes publiques

Méthode 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

Méthode 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 méthode

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
Résultat string

GetParser() public static méthode

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

GetSchemas() public static méthode

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

RegisterParser() public static méthode

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. ///
Résultat void

RegisterParser() public static méthode

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). ///
Résultat void

RegisterParser() public static méthode

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. ///
Résultat void

RegisterParser() public static méthode

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). ///
Résultat void

Reset() public static méthode

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