Inconsistent injection value in XML application context
Reports inconsistent tags and attributes on injection points in XML application contexts.
<property>
and<constructor-arg>
must specify aref
,value
, or a sub-element<property>
and<constructor-arg>
cannot contain more than one sub-element<ref>
can contain either abean
attribute, alocal
attribute, or aparent
attribute<ref>
must specify a bean<idref>
can contain either abean
attribute or alocal
attribute<idref>
must specify a bean<map>
must specify a key<idref>
can contain either akey
attribute, akey-ref
attribute, or a<key>
sub-element
Example:
<beans>
<!-- 1. Property is only allowed to contain either "ref" attribute OR "value" attribute OR sub-element -->
<bean class="MyClass">
<property name="bean" ref="myBean" value="foo"/>
<!-- Property is only allowed to contain either "ref" attribute OR "value" attribute OR sub-element -->
</bean>
<!-- 2. Property must not contain more than one sub-element -->
<bean class="MyFactory">
<property name="bean">
<ref>bean</ref> <!-- Property must not contain more than one sub-element -->
<value>foo</value> <!-- Property must not contain more than one sub-element -->
</property>
</bean>
<!-- 3. Map entry must specify a key -->
<bean class="MyBean">
<property name="map">
<map>
<entry value="foo"/> <!-- Map entry must specify a key -->
</map>
</property>
</bean>
</beans>
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
SpringInjectionValueConsistencyInspection
Inspection Details | |
---|---|
By default bundled with: | |
Can be installed with plugin: | Spring, 243.23126 |
Thanks for your feedback!