}
}
// Replace any ${x} references in the element text
if (replace)
{
PropertyEditor editor = PropertyEditorManager.findEditor(typeClass);
if (editor == null)
{
log.warn("Cannot perform property replace on Element");
}
else
{
editor.setValue(value);
String text = editor.getAsText();
text = StringPropertyReplacer.replaceProperties(text);
editor.setAsText(text);
value = editor.getValue();
}
}
}
if (value == null)
{
PropertyEditor editor = PropertyEditorManager.findEditor(typeClass);
if (editor == null)
{
throw new DeploymentException
("No property editor for attribute: " + attributeName +
"; type=" + typeClass);
}
// JBAS-1709, temporarily switch the TCL so that property
// editors have access to the actual deployment ClassLoader.
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(cl);
try
{
editor.setAsText(attributeText);
value = editor.getValue();
}
finally
{
Thread.currentThread().setContextClassLoader(tcl);
}