alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Spring Framework example source code file (testUtilNamespace.xml)

This example Spring Framework source code file (testUtilNamespace.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Spring Framework tags/keywords

harrop, harrop, min_value, min_value, rob, rob, utf-8, utf-8

The Spring Framework testUtilNamespace.xml source code

<?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-2.5.xsd
				http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">

	<util:constant id="min" static-field="
			java.lang.Integer.
			MIN_VALUE
 	"/>

	<util:constant static-field="java.lang.Integer.MAX_VALUE"/>

	<util:property-path id="name" path="
			configuredBean.
			name
  "/>

	<bean id="testBean" class="org.springframework.beans.TestBean" scope="prototype">
		<property name="name">
			<util:property-path path="configuredBean.name"/>
		</property>
		<property name="someProperties">
			<util:properties location="classpath:org/springframework/beans/factory/config/util.properties"/>
		</property>
	</bean>

	<bean id="constructedTestBean" class="org.springframework.beans.TestBean">
		<constructor-arg index="0">
			<util:property-path path="configuredBean.name"/>
		</constructor-arg>
	</bean>

	<bean id="configuredBean" class="org.springframework.beans.TestBean">
		<property name="name" value="Rob Harrop"/>
	</bean>

	<util:map id="simpleMap">
		<entry key="foo" value="bar"/>
	</util:map>

	<util:map id="scopedMap" scope="prototype">
		<entry key="foo" value="bar"/>
	</util:map>

	<util:map id="mapWithRef" map-class="java.util.TreeMap">
		<entry key="bean" value-ref="testBean"/>
	</util:map>

	<util:list id="simpleList">
		<value>Rob Harrop
	</util:list>

	<util:list id="scopedList" scope="prototype">
		<value>Rob Harrop
	</util:list>

	<util:set id="simpleSet">
		<value>Rob Harrop
	</util:set>

	<util:set id="scopedSet" scope="prototype">
		<value>Rob Harrop
	</util:set>

	<bean id="nestedCollectionsBean" class="org.springframework.beans.TestBean">
		<property name="someList">
			<util:list>
				<value>foo
			</util:list>
		</property>
		<property name="someSet">
			<util:set>
				<value>bar
			</util:set>
		</property>
		<property name="someMap">
			<util:map>
				<entry key="foo">
					<util:set>
						<value>bar
					</util:set>
				</entry>
			</util:map>
		</property>
	</bean>

	<bean id="nestedCustomTagBean" class="org.springframework.beans.TestBean" scope="prototype">
		<property name="someList">
			<list>
				<util:constant static-field="java.lang.Integer.MIN_VALUE"/>
			</list>
		</property>
		<property name="someSet">
			<set>
				<util:constant static-field="java.lang.Integer.MIN_VALUE"/>
			</set>
		</property>
	  <property name="someMap">
			<map>
				<entry>
					<key>min
					<util:constant static-field="java.lang.Integer.MIN_VALUE"/>
				</entry>
			</map>
	  </property>
	</bean>

	<bean id="circularCollectionsBean" class="org.springframework.beans.TestBean">
		<property name="someList">
			<util:list>
				<ref bean="circularCollectionsBean"/>
			</util:list>
		</property>
		<property name="someSet">
			<util:set>
				<ref bean="circularCollectionsBean"/>
			</util:set>
		</property>
		<property name="someMap">
			<util:map>
				<entry key="foo" value-ref="circularCollectionsBean"/>
			</util:map>
		</property>
	</bean>

	<util:list id="circularList">
		<ref bean="circularCollectionBeansBean"/>
	</util:list>

	<util:set id="circularSet">
		<ref bean="circularCollectionBeansBean"/>
	</util:set>

	<util:map id="circularMap">
		<entry key="foo" value-ref="circularCollectionBeansBean"/>
	</util:map>

	<bean id="circularCollectionBeansBean" class="org.springframework.beans.TestBean">
		<property name="someList" ref="circularList"/>
		<property name="someSet" ref="circularSet"/>
		<property name="someMap" ref="circularMap"/>
	</bean>

	<util:properties id="myProperties"
			location="classpath:org/springframework/beans/factory/config/util.properties"/>

	<util:properties id="myScopedProperties"
			location="classpath:org/springframework/beans/factory/config/util.properties" scope="prototype"/>

	<util:properties id="myLocalProperties">
		<prop key="foo2">bar2
	</util:properties>

	<util:properties id="myMergedProperties"
			location="classpath:org/springframework/beans/factory/config/util.properties">
		<prop key="foo2">bar2
	</util:properties>

	<util:properties id="defaultLocalOverrideProperties" 
			location="classpath:org/springframework/beans/factory/config/util.properties">
		<prop key="foo">local
		<prop key="foo2">local2
	</util:properties>

	<util:properties id="trueLocalOverrideProperties" 
			location="classpath:org/springframework/beans/factory/config/util.properties"
			local-override="true">
		<prop key="foo">local
		<prop key="foo2">local2
	</util:properties>

	<util:properties id="falseLocalOverrideProperties"
			location="classpath:org/springframework/beans/factory/config/util.properties"
			local-override="false">
		<prop key="foo">local
		<prop key="foo2">local2
	</util:properties>

</beans>

Other Spring Framework examples (source code examples)

Here is a short list of links related to this Spring Framework testUtilNamespace.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.