Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Xml
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv32125/Xml
Modified Files:
ObjectsNamespaceParser.cs
Log Message:
PropertyPlaceholderConfigurer does not replace property values in <list element-type=${prop}> [SPRNET-719]
Index: ObjectsNamespaceParser.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Xml/ObjectsNamespaceParser.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ObjectsNamespaceParser.cs 28 Aug 2007 14:16:40 -0000 1.6
--- ObjectsNamespaceParser.cs 26 Nov 2007 14:15:54 -0000 1.7
***************
*** 882,886 ****
else if (element.Name.Equals(ObjectDefinitionConstants.DictionaryElement))
{
! return GetMap(element, name, parserHelper);
}
else if (element.Name.Equals(ObjectDefinitionConstants.NameValuesElement))
--- 882,886 ----
else if (element.Name.Equals(ObjectDefinitionConstants.DictionaryElement))
{
! return GetDictionary(element, name, parserHelper);
}
else if (element.Name.Equals(ObjectDefinitionConstants.NameValuesElement))
***************
*** 1021,1028 ****
{
ManagedList list = new ManagedList();
string elementTypeName = element.GetAttribute("element-type");
if (StringUtils.HasText(elementTypeName))
{
! list.ElementType = TypeResolutionUtils.ResolveType(elementTypeName);
}
--- 1021,1029 ----
{
ManagedList list = new ManagedList();
+
string elementTypeName = element.GetAttribute("element-type");
if (StringUtils.HasText(elementTypeName))
{
! list.ElementTypeName = elementTypeName;
}
***************
*** 1057,1061 ****
if (StringUtils.HasText(elementTypeName))
{
! theSet.ElementType = TypeResolutionUtils.ResolveType(elementTypeName);
}
foreach (XmlNode node in element.ChildNodes)
--- 1058,1062 ----
if (StringUtils.HasText(elementTypeName))
{
! theSet.ElementTypeName = elementTypeName;
}
foreach (XmlNode node in element.ChildNodes)
***************
*** 1072,1099 ****
/// <summary>
! /// Gets a map definition.
/// </summary>
/// <param name="element">
! /// The element describing the map definition.
/// </param>
/// <param name="name">
! /// The name of the object (definition) associated with the map definition.
/// </param>
/// <param name="parserHelper">
/// The namespace-aware parser.
/// </param>
! /// <returns>The map definition.</returns>
! protected IDictionary GetMap(XmlElement element, string name, ObjectDefinitionParserHelper parserHelper)
{
! ManagedDictionary map = new ManagedDictionary();
string keyTypeName = element.GetAttribute("key-type");
string valueTypeName = element.GetAttribute("value-type");
if (StringUtils.HasText(keyTypeName))
{
! map.KeyType = TypeResolutionUtils.ResolveType(keyTypeName);
}
if (StringUtils.HasText(valueTypeName))
{
! map.ValueType = TypeResolutionUtils.ResolveType(valueTypeName);
}
--- 1073,1100 ----
/// <summary>
! /// Gets a dictionary definition.
/// </summary>
/// <param name="element">
! /// The element describing the dictionary definition.
/// </param>
/// <param name="name">
! /// The name of the object (definition) associated with the dictionary definition.
/// </param>
/// <param name="parserHelper">
/// The namespace-aware parser.
/// </param>
! /// <returns>The dictionary definition.</returns>
! protected IDictionary GetDictionary(XmlElement element, string name, ObjectDefinitionParserHelper parserHelper)
{
! ManagedDictionary dictionary = new ManagedDictionary();
string keyTypeName = element.GetAttribute("key-type");
string valueTypeName = element.GetAttribute("value-type");
if (StringUtils.HasText(keyTypeName))
{
! dictionary.KeyTypeName = keyTypeName;
}
if (StringUtils.HasText(valueTypeName))
{
! dictionary.ValueTypeName = valueTypeName;
}
***************
*** 1155,1159 ****
{
// ok, we're using the value attribute shortcut...
! map[key] = inlineValueAtt.Value;
}
else if (entryEle.Attributes[ObjectDefinitionConstants.DictionaryValueRefShortcutAttribute] != null)
--- 1156,1160 ----
{
// ok, we're using the value attribute shortcut...
! dictionary[key] = inlineValueAtt.Value;
}
else if (entryEle.Attributes[ObjectDefinitionConstants.DictionaryValueRefShortcutAttribute] != null)
***************
*** 1162,1166 ****
XmlAttribute inlineValueRefAtt = entryEle.Attributes[ObjectDefinitionConstants.DictionaryValueRefShortcutAttribute];
RuntimeObjectReference ror = new RuntimeObjectReference(inlineValueRefAtt.Value);
! map[key] = ror;
}
else if (entryEle.Attributes[ObjectDefinitionConstants.ExpressionAttribute] != null)
--- 1163,1167 ----
XmlAttribute inlineValueRefAtt = entryEle.Attributes[ObjectDefinitionConstants.DictionaryValueRefShortcutAttribute];
RuntimeObjectReference ror = new RuntimeObjectReference(inlineValueRefAtt.Value);
! dictionary[key] = ror;
}
else if (entryEle.Attributes[ObjectDefinitionConstants.ExpressionAttribute] != null)
***************
*** 1169,1173 ****
XmlAttribute inlineExpressionAtt = entryEle.Attributes[ObjectDefinitionConstants.ExpressionAttribute];
ExpressionHolder expHolder = new ExpressionHolder(inlineExpressionAtt.Value);
! map[key] = expHolder;
}
else
--- 1170,1174 ----
XmlAttribute inlineExpressionAtt = entryEle.Attributes[ObjectDefinitionConstants.ExpressionAttribute];
ExpressionHolder expHolder = new ExpressionHolder(inlineExpressionAtt.Value);
! dictionary[key] = expHolder;
}
else
***************
*** 1188,1197 ****
ObjectDefinitionConstants.ValueAttribute, ObjectDefinitionConstants.DictionaryValueRefShortcutAttribute, ObjectDefinitionConstants.EntryElement));
}
! map[key] = ParsePropertySubElement((XmlElement) valueElements.Item(0), name, parserHelper);
}
#endregion
}
! return map;
}
--- 1189,1198 ----
ObjectDefinitionConstants.ValueAttribute, ObjectDefinitionConstants.DictionaryValueRefShortcutAttribute, ObjectDefinitionConstants.EntryElement));
}
! dictionary[key] = ParsePropertySubElement((XmlElement)valueElements.Item(0), name, parserHelper);
}
#endregion
}
! return dictionary;
}
|