Package com.igormaznitsa.jcp.utils
Class PreprocessorUtils
java.lang.Object
com.igormaznitsa.jcp.utils.PreprocessorUtils
It is an auxiliary class contains some useful methods
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
static void
static void
copyFileAttributes
(File from, File to) static String
extractTail
(String prefix, String value) static String
extractTrimmedTail
(String prefix, String value) static String
generateStringForChar
(char chr, int length) static String
getFileExtension
(File file) static String
getFilePath
(File file) static String
static boolean
isFileContentEquals
(File src, File dst) static String
static BufferedReader
makeFileReader
(File file, String charset, int bufferSize) static String
normalizeVariableName
(String name) static String
processMacroses
(String processingString, PreprocessorContext context) static byte[]
readFileAsByteArray
(File file) static String[]
readWholeTextFileIntoArray
(File file, String encoding, AtomicBoolean endedByNextLine) static String[]
replaceChar
(String[] source, char toBeReplaced, char replacement) static String
replacePartByChar
(String text, char chr, int startPosition, int length) static String[]
replaceStringPrefix
(String[] allowedPrefixesToBeReplaced, String replacement, String[] strings) static String[]
splitExtensionCommaList
(String extensions) static String[]
splitForChar
(String string, char delimiter) static String[]
splitForCharAndHoldEmptyLine
(String string, char delimiter) static String[]
splitForEqualChar
(String string) static void
throwPreprocessorException
(String msg, String processingString, File srcFile, int nextStringIndex, Throwable cause)
-
Field Details
-
PATTERN_MACROS_WITH_SPACES
-
LINE_END
-
-
Constructor Details
-
PreprocessorUtils
private PreprocessorUtils()
-
-
Method Details
-
getFileExtension
-
splitExtensionCommaList
@MustNotContainNull @ThrowsRuntimeException(value=java.lang.NullPointerException.class, reference="if extensions are null") public static String[] splitExtensionCommaList(String extensions) -
makeFileReader
public static BufferedReader makeFileReader(File file, String charset, int bufferSize) throws IOException - Throws:
IOException
-
replaceChar
@MustNotContainNull public static String[] replaceChar(@MustNotContainNull String[] source, char toBeReplaced, char replacement) -
extractTrimmedTail
-
extractTail
-
copyFile
- Throws:
IOException
-
copyFileAttributes
-
replacePartByChar
-
generateStringForChar
-
processMacroses
-
checkFile
- Throws:
IOException
-
readWholeTextFileIntoArray
@MustNotContainNull public static String[] readWholeTextFileIntoArray(File file, String encoding, AtomicBoolean endedByNextLine) throws IOException - Throws:
IOException
-
readFileAsByteArray
- Throws:
IOException
-
splitForEqualChar
-
splitForCharAndHoldEmptyLine
@MustNotContainNull public static String[] splitForCharAndHoldEmptyLine(String string, char delimiter) -
splitForChar
-
normalizeVariableName
-
getFilePath
-
throwPreprocessorException
-
replaceStringPrefix
@MustNotContainNull public static String[] replaceStringPrefix(@MustNotContainNull String[] allowedPrefixesToBeReplaced, String replacement, @MustNotContainNull String[] strings) -
getNextLineCodes
-
leftTrim
-
isFileContentEquals
- Throws:
IOException
-