Fix Checkstyle issues
[clamp.git] / src / main / java / org / onap / clamp / clds / transform / XslTransformer.java
index 4c4d379..85b3f5c 100644 (file)
  * limitations under the License.
  * ============LICENSE_END============================================
  * ===================================================================
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * 
  */
 
 package org.onap.clamp.clds.transform;
 
+import com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl;
 import java.io.StringReader;
 import java.io.StringWriter;
 
@@ -44,8 +45,14 @@ public class XslTransformer {
 
     private Templates templates;
 
+    /**
+     * Sets Xsl Resource name.
+     *
+     * @param xslResourceName xsl resource name
+     * @throws TransformerConfigurationException exception if there is configuration error
+     */
     public void setXslResourceName(String xslResourceName) throws TransformerConfigurationException {
-        TransformerFactory tfactory = TransformerFactory.newInstance();
+        TransformerFactory tfactory = new TransformerFactoryImpl();
         tfactory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
         tfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
         templates = tfactory.newTemplates(new StreamSource(ResourceFileUtil.getResourceAsStream(xslResourceName)));
@@ -54,8 +61,8 @@ public class XslTransformer {
     /**
      * Given xml input, return the transformed result.
      *
-     * @param xml
-     * @throws TransformerException
+     * @param xml xml string
+     * @throws TransformerException exception during transformation
      */
     public String doXslTransformToString(String xml) throws TransformerException {
         StringWriter output = new StringWriter(4096);