Package org.jxls.util
Class JxlsNationalLanguageSupport
java.lang.Object
org.jxls.util.JxlsNationalLanguageSupport
With R{key} in the Excel XLSX template file, resource bundles can be accessed to realize multilingualism.
This is the JXLS standard solution since 2.8.0. It is particularly necessary when using PivotTables.
Usually this class is called before the actual JXLS processing in order to create
a modified temporary template file from the given template file.
With R{key=defaultValue}, a default value can be specified for the case that there is no value for the key.
Otherwise key is the fallback value.
The notation can be adjusted using setStart, setEnd and setDefaultValueDelimiter.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetEnd()getStart()protected voidinit()process(InputStream in) voidprocess(InputStream in, OutputStream out) protected voidprocessZipEntry(ZipEntry zipEntry, InputStream in, ZipOutputStream zipout) voidsetDefaultValueDelimiter(String defaultValueDelimiter) voidvoidprotected voidtransfer(InputStream in, OutputStream out) protected abstract Stringprotected StringtranslateAll(String text) voidtranslateSet(Set<String> sheetNames)
-
Constructor Details
-
JxlsNationalLanguageSupport
public JxlsNationalLanguageSupport()
-
-
Method Details
-
process
- Parameters:
in- XLSX input stream- Returns:
- new temp file. Caller must delete it.
-
process
public void process(InputStream in, OutputStream out) throws IOException, TransformerConfigurationException, ParserConfigurationException, SAXException, TransformerException, TransformerFactoryConfigurationError - Parameters:
in- XLSX input stream that contain R{key} elementsout- XLSX output stream for writing the result that contains translated R{key} elements- Throws:
IOException- -TransformerConfigurationException- -ParserConfigurationException- -SAXException- -TransformerException- -TransformerFactoryConfigurationError- -
-
init
protected void init() -
processZipEntry
protected void processZipEntry(ZipEntry zipEntry, InputStream in, ZipOutputStream zipout) throws IOException, ParserConfigurationException, SAXException, TransformerException -
translateAll
-
translate
-
translateSet
-
transfer
- Throws:
IOException
-
getStart
-
setStart
-
getEnd
-
setEnd
-
getDefaultValueDelimiter
-
setDefaultValueDelimiter
-