Does this follow a common namespace design pattern for XML in such a way that I can deduce exactly what beans belong to what namespace? If not, how can I inspect the underlying API in order to make an accurate assessment?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can find out, but you have to dig through some code. The entry-point for processing a namespace is an implementation of
org.springframework.beans.factory.xml.NamespaceHandler. This implementation will typically set up a number oforg.springframework.beans.factory.xml.BeanDefinitionParserimplementations to handle the various top-level elements in that namespace.The
NamespaceHandlerimplementations are usually named according to the schema they support, but that is not guaranteed. To determine without doubt which handler is reponsible for a given namespace, you need to find thespring.handlersfile that defines that namespace handler. That file will be located in the META-INF folder of the containing jar.For example:
In the META-INF folder in spring-tx-[version].jar there is a
spring.handlersfile with the following line:That is, the
txnamespace is handled by theTxNamespaceHandler. If you look in the source-code of that handler, in theinit()you will seewhich means that a
<tx:advice>statement in your spring xml is processed by theorg.springframework.transaction.config.TxAdviceBeanDefinitionParser. You can drill down into anyspring.handlersandNamespaceHandlerin a similar way.