C# 클래스 Spring.Objects.Factory.Xml.AbstractObjectDefinitionParser

Abstract IObjectDefinitionParser implementation providing a number of convenience methods and a AbstractObjectDefinitionParser.ParseInternal template method that subclasses must override to provide the actual parsing logic.
Use this IObjectDefinitionParser implementation when you want to parse some arbitrarily complex XML into one or more IObjectDefinition ObjectDefinitions. If you just want to parse some XML into a single IObjectDefinition, you may wish to consider the simpler convenience extensions of this class, namely AbstractSingleObjectDefinitionParser and AbstractSimpleObjectDefinitionParser
상속: IObjectDefinitionParser
파일 보기 프로젝트 열기: spring-projects/spring-net

공개 프로퍼티들

프로퍼티 타입 설명
ID_ATTRIBUTE string

공개 메소드들

메소드 설명
ParseElement ( XmlElement element, ParserContext parserContext ) : IObjectDefinition

Parse the specified XmlElement and register the resulting ObjectDefinitions with the ParserContext.Registry IObjectDefinitionRegistry embedded in the supplied ParserContext

This method is never invoked if the parser is namespace aware and was called to process the root node.

보호된 메소드들

메소드 설명
GetAttributeValue ( XmlElement element, string attributeName ) : string

Returns the value of the element's attribute or null, if the attribute is not specified.

This is a helper for bypassing the behavior of XmlElement.GetAttribute(string) to return string.Empty if the attribute does not exist.

GetAttributeValue ( XmlElement element, string attributeName, string defaultValue ) : string

Returns the value of the element's attribute or defaultValue, if the attribute is not specified.

This is a helper for bypassing the behavior of XmlElement.GetAttribute(string) to return string.Empty if the attribute does not exist.

ParseInternal ( XmlElement element, ParserContext parserContext ) : AbstractObjectDefinition

Central template method to actually parse the supplied XmlElement into one or more IObjectDefinitions.

RegisterObjectDefinition ( Spring.Objects.Factory.Config.ObjectDefinitionHolder definition, IObjectDefinitionRegistry registry ) : void

Registers the supplied ObjectDefinitionHolder with the supplied IObjectDefinitionRegistry.

Subclasses can override this method to control whether or not the supplied ObjectDefinitionHolder is actually even registered, or to register even more objects.

The default implementation registers the supplied ObjectDefinitionHolder with the supplied ObjectDefinitionHolder only if the IsNested parameter is false, because one typically does not want inner objects to be registered as top level objects.

ResolveId ( XmlElement element, AbstractObjectDefinition definition, ParserContext parserContext ) : string

Resolves the ID for the supplied IObjectDefinition.

When using ShouldGenerateId generation, a name is generated automatically. Otherwise, the ID is extracted from the "id" attribute, potentially with a ShouldGenerateIdAsFallback fallback to a generated id.

메소드 상세

GetAttributeValue() 보호된 정적인 메소드

Returns the value of the element's attribute or null, if the attribute is not specified.
This is a helper for bypassing the behavior of XmlElement.GetAttribute(string) to return string.Empty if the attribute does not exist.
protected static GetAttributeValue ( XmlElement element, string attributeName ) : string
element System.Xml.XmlElement
attributeName string
리턴 string

GetAttributeValue() 보호된 정적인 메소드

Returns the value of the element's attribute or defaultValue, if the attribute is not specified.
This is a helper for bypassing the behavior of XmlElement.GetAttribute(string) to return string.Empty if the attribute does not exist.
protected static GetAttributeValue ( XmlElement element, string attributeName, string defaultValue ) : string
element System.Xml.XmlElement
attributeName string
defaultValue string
리턴 string

ParseElement() 공개 메소드

Parse the specified XmlElement and register the resulting ObjectDefinitions with the ParserContext.Registry IObjectDefinitionRegistry embedded in the supplied ParserContext

This method is never invoked if the parser is namespace aware and was called to process the root node.

public ParseElement ( XmlElement element, ParserContext parserContext ) : IObjectDefinition
element System.Xml.XmlElement The element to be parsed.
parserContext ParserContext The object encapsulating the current state of the parsing process. /// Provides access to a IObjectDefinitionRegistry
리턴 IObjectDefinition

ParseInternal() 보호된 추상적인 메소드

Central template method to actually parse the supplied XmlElement into one or more IObjectDefinitions.
protected abstract ParseInternal ( XmlElement element, ParserContext parserContext ) : AbstractObjectDefinition
element System.Xml.XmlElement The element that is to be parsed into one or more s
parserContext ParserContext The the object encapsulating the current state of the parsing process; /// provides access to a
리턴 Spring.Objects.Factory.Support.AbstractObjectDefinition

RegisterObjectDefinition() 보호된 메소드

Registers the supplied ObjectDefinitionHolder with the supplied IObjectDefinitionRegistry.
Subclasses can override this method to control whether or not the supplied ObjectDefinitionHolder is actually even registered, or to register even more objects.

The default implementation registers the supplied ObjectDefinitionHolder with the supplied ObjectDefinitionHolder only if the IsNested parameter is false, because one typically does not want inner objects to be registered as top level objects.

protected RegisterObjectDefinition ( Spring.Objects.Factory.Config.ObjectDefinitionHolder definition, IObjectDefinitionRegistry registry ) : void
definition Spring.Objects.Factory.Config.ObjectDefinitionHolder The object definition to be registered.
registry IObjectDefinitionRegistry The registry that the bean is to be registered with.
리턴 void

ResolveId() 보호된 메소드

Resolves the ID for the supplied IObjectDefinition.
When using ShouldGenerateId generation, a name is generated automatically. Otherwise, the ID is extracted from the "id" attribute, potentially with a ShouldGenerateIdAsFallback fallback to a generated id.
/// if no unique name could be generated for the given object definition ///
protected ResolveId ( XmlElement element, AbstractObjectDefinition definition, ParserContext parserContext ) : string
element System.Xml.XmlElement The element that the object definition has been built from.
definition Spring.Objects.Factory.Support.AbstractObjectDefinition The object definition to be registered.
parserContext ParserContext The the object encapsulating the current state of the parsing process; /// provides access to a
리턴 string

프로퍼티 상세

ID_ATTRIBUTE 공개적으로 정적으로 프로퍼티

Constant for the ID attribute
public static string ID_ATTRIBUTE
리턴 string