i have spring xml config
schema:
<?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:util="http://www.springframework.org/schema/util" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
with property bean definition:
<property name="airdates"> <util:set set-class="java.util.treeset"> <ref bean="first_event_datetime"/> </util:set> </property> <bean name="first_event_datetime" class="java.time.localdatetime" factory-method="of"> <constructor-arg type="int" value="2020"/> <constructor-arg type="int" value="6"/> <constructor-arg type="int" value="15"/> <constructor-arg type="int" value="19"/> <constructor-arg type="int" value="30"/> </bean>
target of injection navigableset
setter , getter accordingly
private navigableset<localdatetime> airdates = new treeset<>();
the problem is: 1) ide highlights util:set
, says bean must 1 of these types:
bean must 1 of these types: java.time.localdatetime or java.util.navigableset
2) spring execution says me:
cannot locate beandefinitiondecorator element [set]
do have ideas how solve problem?
please provide definition of first_event_datetime
update: following definition works @ environment:
xml:
... <bean name="first_event_datetime" class="java.time.localdatetime" factory-method="of"> <constructor-arg type="int" value="2020"/> <constructor-arg type="int" value="6"/> <constructor-arg type="int" value="15"/> <constructor-arg type="int" value="19"/> <constructor-arg type="int" value="30"/> </bean> ... <bean id="client" class="<my package>.client" <property name="airdates"> <util:set set-class="java.util.treeset"> <ref bean="first_event_datetime"/> </util:set> </property> </bean>
java:
import java.time.localdatetime; import java.util.navigableset; public class client { private navigableset<localdatetime> airdates; public navigableset<localdatetime> getairdates() { return airdates; } public void setairdates(navigableset<localdatetime> airdates) { this.airdates = airdates; } ... }
Comments
Post a Comment