Returns an attributes list which contains all the attributes passed in, with any text of form "${xxx}" in an attribute value replaced by the appropriate value from the system property.
(Attributes list)
| 2119 | * attribute value replaced by the appropriate value from the system property. |
| 2120 | */ |
| 2121 | private Attributes updateAttributes(Attributes list) { |
| 2122 | |
| 2123 | if (list.getLength() == 0) { |
| 2124 | return list; |
| 2125 | } |
| 2126 | |
| 2127 | AttributesImpl newAttrs = new AttributesImpl(list); |
| 2128 | int nAttributes = newAttrs.getLength(); |
| 2129 | for (int i = 0; i < nAttributes; ++i) { |
| 2130 | String value = newAttrs.getValue(i); |
| 2131 | try { |
| 2132 | newAttrs.setValue(i, |
| 2133 | IntrospectionUtils.replaceProperties(value, null, source, getClassLoader()).intern()); |
| 2134 | } catch (Exception e) { |
| 2135 | log.warn(sm.getString("digester.failedToUpdateAttributes", newAttrs.getLocalName(i), value), e); |
| 2136 | } |
| 2137 | } |
| 2138 | |
| 2139 | return newAttrs; |
| 2140 | } |
| 2141 | |
| 2142 | |
| 2143 | /** |
no test coverage detected