public abstract class AbstractSingleBeanDefinitionParser extends AbstractBeanDefinitionParser
BeanDefinition のみを解析および定義する必要がある BeanDefinitionParser 実装の基本クラス。 任意の複雑な XML 要素から単一の Bean 定義を作成する場合は、このパーサークラスを継承します。比較的単純なカスタム XML 要素から単一の Bean 定義を作成する場合は、AbstractSimpleBeanDefinitionParser を継承することを検討してください。
結果の BeanDefinition は自動的に BeanDefinitionRegistry に登録されます。あなたのジョブは単に、カスタム XML ElementSE を単一の BeanDefinition に parse することです。
getBeanClass(org.w3c.dom.Element), getBeanClassName(org.w3c.dom.Element), doParse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext, org.springframework.beans.factory.support.BeanDefinitionBuilder)ID_ATTRIBUTE, NAME_ATTRIBUTE| コンストラクターと説明 |
|---|
AbstractSingleBeanDefinitionParser() |
| 修飾子と型 | メソッドと説明 |
|---|---|
protected void | doParse(ElementSE element, BeanDefinitionBuilder builder) 提供された ElementSE を解析し、必要に応じて提供された BeanDefinitionBuilder を入力します。 |
protected void | doParse(ElementSE element, ParserContext parserContext, BeanDefinitionBuilder builder) 提供された ElementSE を解析し、必要に応じて提供された BeanDefinitionBuilder を入力します。 |
protected ClassSE<?> | getBeanClass(ElementSE element) 提供された ElementSE に対応する Bean クラスを決定します。 |
protected StringSE | getBeanClassName(ElementSE element) 提供された ElementSE に対応する Bean クラス名を決定します。 |
protected StringSE | getParentName(ElementSE element) 現在の Bean が子 Bean として定義されている場合は、現在解析されている Bean の親の名前を判別します。 |
protected AbstractBeanDefinition | parseInternal(ElementSE element, ParserContext parserContext) |
parse, postProcessComponentDefinition, registerBeanDefinition, resolveId, shouldFireEvents, shouldGenerateId, shouldGenerateIdAsFallback, shouldParseNameAsAliasescloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEprotected final AbstractBeanDefinition parseInternal(ElementSE element, ParserContext parserContext)
bean Class の BeanDefinitionBuilder インスタンスを作成し、それを doParse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext, org.springframework.beans.factory.support.BeanDefinitionBuilder) ストラテジメソッドに渡します。AbstractBeanDefinitionParser の parseInternal element - 単一の BeanDefinition に解析される要素 parserContext - 解析プロセスの現在の状態をカプセル化するオブジェクト ElementSE の解析から得られた BeanDefinitionIllegalStateExceptionSE - getBeanClass(org.w3c.dom.Element) から返された Bean ClassSE が null の場合 doParse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext, org.springframework.beans.factory.support.BeanDefinitionBuilder)@Nullable protected StringSE getParentName(ElementSE element)
デフォルトの実装は、ルート Bean 定義を示す null を返します。
element - 解析されている Element null @Nullable protected ClassSE<?> getBeanClass(ElementSE element)
ElementSE に対応する Bean クラスを決定します。 アプリケーションクラスの場合、Bean 実装クラスへの直接の依存を回避するために、通常は代わりに getBeanClassName(org.w3c.dom.Element) をオーバーライドすることが望ましいことに注意してください。アプリケーションクラスがプラグインのクラスパスで利用できない場合でも、BeanDefinitionParser とその NamespaceHandler は IDE プラグイン内で使用できます。
element - 解析されている Element Element を解析することにより定義されている Bean の ClassSE、または存在しない場合は null getBeanClassName(org.w3c.dom.Element)@Nullable protected StringSE getBeanClassName(ElementSE element)
ElementSE に対応する Bean クラス名を決定します。element - 解析されている Element Element を解析することにより定義されている Bean のクラス名。ない場合は null getBeanClass(org.w3c.dom.Element)protected void doParse(ElementSE element, ParserContext parserContext, BeanDefinitionBuilder builder)
ElementSE を解析し、必要に応じて提供された BeanDefinitionBuilder を入力します。 デフォルトの実装は、ParserContext 引数なしの doParse バージョンに委譲します。
element - 解析される XML 要素 parserContext - 解析プロセスの現在の状態をカプセル化するオブジェクト builder - BeanDefinition の定義に使用 doParse(Element, BeanDefinitionBuilder)protected void doParse(ElementSE element, BeanDefinitionBuilder builder)
element - 解析される XML 要素 builder - BeanDefinition の定義に使用