Package com.igormaznitsa.jcp
Class JCPreprocessor
- java.lang.Object
-
- com.igormaznitsa.jcp.JCPreprocessor
-
public final class JCPreprocessor extends java.lang.ObjectThe main class implements the Java Comment Preprocessor, it has the main method and can be started from a command string
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJCPreprocessor.PreprocessingStatistics
-
Field Summary
Fields Modifier and Type Field Description (package private) static CommandLineHandler[]COMMAND_LINE_HANDLERSprivate PreprocessorContextcontext
-
Constructor Summary
Constructors Constructor Description JCPreprocessor(PreprocessorContext context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcreateDestinationDirectory()JCPreprocessor.PreprocessingStatisticsexecute()private java.util.Set<java.io.File>findAllFiles(java.lang.String baseFolderCanonicalPath, java.io.File dir, AntPathMatcher antPathMatcher, java.lang.String[] excludedFolderPatterns)private java.util.Collection<FileInfoContainer>findAllFilesToBePreprocessed(java.io.File[] srcDirs, java.lang.String[] excludedFolderPatterns)static java.lang.Iterable<CommandLineHandler>getCommandLineHandlers()PreprocessorContextgetContext()private static voidhelp()static voidmain(java.lang.String... args)private JCPreprocessor.PreprocessingStatisticspreprocessFiles(java.util.Collection<FileInfoContainer> files)private static voidprintHeader()(package private) voidprocessCfgFiles()private static PreprocessorContextprocessCommandString(PreprocessorContext context, java.lang.String[] originalStrings, java.lang.String[] normalizedStrings)private voidprocessFileExclusion(java.util.List<PreprocessingState.ExcludeIfInfo> foundExcludeIf)private java.util.List<PreprocessingState.ExcludeIfInfo>processGlobalDirectives(java.util.Collection<FileInfoContainer> files)
-
-
-
Field Detail
-
context
private final PreprocessorContext context
-
COMMAND_LINE_HANDLERS
static final CommandLineHandler[] COMMAND_LINE_HANDLERS
-
-
Constructor Detail
-
JCPreprocessor
public JCPreprocessor(PreprocessorContext context)
-
-
Method Detail
-
getCommandLineHandlers
public static java.lang.Iterable<CommandLineHandler> getCommandLineHandlers()
-
getContext
public PreprocessorContext getContext()
-
execute
public JCPreprocessor.PreprocessingStatistics execute() throws java.io.IOException
- Throws:
java.io.IOException
-
processFileExclusion
private void processFileExclusion(@MustNotContainNull java.util.List<PreprocessingState.ExcludeIfInfo> foundExcludeIf)
-
processGlobalDirectives
@MustNotContainNull private java.util.List<PreprocessingState.ExcludeIfInfo> processGlobalDirectives(@MustNotContainNull java.util.Collection<FileInfoContainer> files) throws java.io.IOException
- Throws:
java.io.IOException
-
preprocessFiles
private JCPreprocessor.PreprocessingStatistics preprocessFiles(@MustNotContainNull java.util.Collection<FileInfoContainer> files) throws java.io.IOException
- Throws:
java.io.IOException
-
createDestinationDirectory
private void createDestinationDirectory() throws java.io.IOException- Throws:
java.io.IOException
-
findAllFilesToBePreprocessed
@MustNotContainNull private java.util.Collection<FileInfoContainer> findAllFilesToBePreprocessed(@MustNotContainNull java.io.File[] srcDirs, @MustNotContainNull java.lang.String[] excludedFolderPatterns) throws java.io.IOException
- Throws:
java.io.IOException
-
findAllFiles
private java.util.Set<java.io.File> findAllFiles(java.lang.String baseFolderCanonicalPath, java.io.File dir, AntPathMatcher antPathMatcher, @MustNotContainNull java.lang.String[] excludedFolderPatterns) throws java.io.IOException- Throws:
java.io.IOException
-
main
public static void main(@MustNotContainNull java.lang.String... args)
-
processCommandString
private static PreprocessorContext processCommandString(PreprocessorContext context, @MustNotContainNull java.lang.String[] originalStrings, @MustNotContainNull java.lang.String[] normalizedStrings) throws java.io.IOException
- Throws:
java.io.IOException
-
processCfgFiles
void processCfgFiles() throws java.io.IOException- Throws:
java.io.IOException
-
printHeader
private static void printHeader()
-
help
private static void help()
-
-