Index: src/documentation/content/xdocs/rules.xml =================================================================== --- src/documentation/content/xdocs/rules.xml (revision 378363) +++ src/documentation/content/xdocs/rules.xml (working copy) @@ -300,11 +300,14 @@ value string yes - The value to set the proeprty to. The is interpreted as with the - smart translator, meaning that - conversion to normal Java types (boolean, int, etc.) will work as - expected. + The value to set the proeprty to. This value is interpreted based on the value of translator attribute. + + translator + string + no + The name of the translator to use to interpret the value. The default is the smart translator + Index: framework/src/java/org/apache/hivemind/ant/RegistrySerializer.java =================================================================== --- framework/src/java/org/apache/hivemind/ant/RegistrySerializer.java (revision 378363) +++ framework/src/java/org/apache/hivemind/ant/RegistrySerializer.java (working copy) @@ -623,6 +623,8 @@ rule.setAttribute("property", spr.getPropertyName()); rule.setAttribute("value", spr.getValue()); + if(!spr.isDefaultTranslator()) + rule.setAttribute("translator",spr.getTranslator()); } else if (r instanceof ConversionDescriptor) { Index: framework/src/java/org/apache/hivemind/parse/DescriptorParser.properties =================================================================== --- framework/src/java/org/apache/hivemind/parse/DescriptorParser.properties (revision 378363) +++ framework/src/java/org/apache/hivemind/parse/DescriptorParser.properties (working copy) @@ -84,6 +84,7 @@ required.set-property.property=true required.set-property.value=true +required.set-property.translator=false required.push-attribute.attribute=true Index: framework/src/java/org/apache/hivemind/parse/DescriptorParser.java =================================================================== --- framework/src/java/org/apache/hivemind/parse/DescriptorParser.java (revision 378363) +++ framework/src/java/org/apache/hivemind/parse/DescriptorParser.java (working copy) @@ -1125,7 +1125,8 @@ rule.setPropertyName(getAttribute("property")); rule.setValue(getAttribute("value")); - + rule.setTranslator(getAttribute("translator")); + elementModel.addRule(rule); } Index: framework/src/java/org/apache/hivemind/schema/rules/SetPropertyRule.java =================================================================== --- framework/src/java/org/apache/hivemind/schema/rules/SetPropertyRule.java (revision 378363) +++ framework/src/java/org/apache/hivemind/schema/rules/SetPropertyRule.java (working copy) @@ -30,11 +30,13 @@ public class SetPropertyRule extends BaseRule { private static final Log LOG = LogFactory.getLog(SetPropertyRule.class); - + private static final String DEFAULT_TRANSLATOR = "smart"; + private String _propertyName; private String _value; - private Translator _smartTranslator; - + private Translator _translator; + private String _translatorName = DEFAULT_TRANSLATOR; + public void begin(SchemaProcessor processor, Element element) { String value = RuleUtils.processText(processor, element, _value); @@ -43,13 +45,13 @@ try { - if (_smartTranslator == null) - _smartTranslator = RuleUtils.getTranslator(processor, "smart"); + if (_translator == null) + _translator = RuleUtils.getTranslator(processor, _translatorName); Class propertyType = PropertyUtils.getPropertyType(target, _propertyName); Object finalValue = - _smartTranslator.translate( + _translator.translate( processor.getContributingModule(), propertyType, value, @@ -88,4 +90,21 @@ return _value; } + public void setTranslator(String string) + { + if(string == null) + _translatorName = DEFAULT_TRANSLATOR; + else + _translatorName = string; + } + + public String getTranslator() + { + return _translatorName; + } + + public boolean isDefaultTranslator() + { + return DEFAULT_TRANSLATOR.equals(_translatorName); + } }