Package org.omegat.util
Class VarExpansion<Param>
java.lang.Object
org.omegat.util.VarExpansion<Param>
- Direct Known Subclasses:
CommandVarExpansion,MatchesVarExpansion,ModificationInfoManager.ModificationInfoVarExpansion
This class is used to transform a string by expansion of variables it
contains. It can expand:
- Entries in Bundle.properties: see
expandBundleEntries(String)for syntax - Variables: see
expandVariables(Object)for syntax
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexpandFileName(String localTemplate, String filePath, String baseDir) expandFileNames(String localTemplate, String[] filePaths, String baseDir) Expands all variables relating to file name : ${filePath} = full file path ${fileShortPath} = file path relative to given root ${fileName} = full file name (w/o path but with extension) ${fileNameOnly} = file name without extension ${fileNameOnly-1}, ${fileNameOnly-2}, ...abstract StringexpandVariables(Param param)
-
Field Details
-
VAR_SOURCE_TEXT
- See Also:
-
VAR_TARGET_TEXT
- See Also:
-
VAR_PROJECT_SOURCE_LANG
- See Also:
-
VAR_PROJECT_SOURCE_LANG_CODE
- See Also:
-
VAR_PROJECT_TARGET_LANG
- See Also:
-
VAR_PROJECT_TARGET_LANG_CODE
- See Also:
-
VAR_FILE_NAME
- See Also:
-
VAR_FILE_NAME_ONLY
- See Also:
-
VAR_FILE_EXTENSION
- See Also:
-
VAR_FILE_PATH
- See Also:
-
VAR_FILE_SHORT_PATH
- See Also:
-
PATTERN_BUNDLE_ENTRY
-
-
Constructor Details
-
VarExpansion
-
-
Method Details
-
expandFileNames
Expands all variables relating to file name :- ${filePath} = full file path
- ${fileShortPath} = file path relative to given root
- ${fileName} = full file name (w/o path but with extension)
- ${fileNameOnly} = file name without extension
- ${fileNameOnly-1}, ${fileNameOnly-2}, ... = filename with 1, 2, ... extensions
- ${fileExtension} = all extensions after '.'
- ${fileExtension-1}, ${fileExtension-2}, ... = ${fileExtension} after removing 1, 2, ... extensions
- Parameters:
localTemplate- initial template. If null, use instance's template but does not modify itfilePaths- path used by variable ${fileShortPath}baseDir- base directory to expand against- Returns:
- Copy of the template with mentioned variables expanded. Other variables remain unchanged
-
expandFileName
-
expandVariables
-