All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.okworx.ilcd.validation.util.TransletCache Maven / Gradle / Ivy

Go to download

A Java library for performing technical validation of data in ILCD data format.

There is a newer version: 2.7.2
Show newest version
package com.okworx.ilcd.validation.util;

import org.apache.logging.log4j.Logger;

import javax.xml.transform.Templates;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamSource;

/**
 * 

TransletCache class.

* * @author oliver.kusche * @version $Id: $Id */ public class TransletCache { protected final Logger log = org.apache.logging.log4j.LogManager.getLogger( this.getClass() ); private static final TransletCache instance = new TransletCache(); private Templates translet; /** *

Getter for the field translet.

* * @return a {@link javax.xml.transform.Templates} object. */ public Templates getTranslet() { return this.translet; } /** *

Constructor for TransletCache.

*/ protected TransletCache() { TransformerFactory fact = TransformerFactory.newInstance(); try { this.translet = fact.newTemplates(new StreamSource(this.getClass() .getClassLoader() .getResourceAsStream("stylesheets/extractReferences.xsl"))); } catch (TransformerConfigurationException e) { log.error(e); } } /** *

Getter for the field instance.

* * @return a {@link com.okworx.ilcd.validation.util.TransletCache} object. */ public static TransletCache getInstance() { return instance; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy