Package org.nuiton.i18n.plugin.parser
Class SourceEntry
- java.lang.Object
-
- org.nuiton.i18n.plugin.parser.SourceEntry
-
- Direct Known Subclasses:
I18nSourceEntry
public class SourceEntry extends Object
A simple model for a sourceEntry represents by a basedir and includes and/or exlucdes pattern. The class offers the usefull method :getIncludedFiles(File, String[], String[])to obtain the list of files from thebasedirdirectory which respects theincludesand/orexcludespatterns using an internalDirectoryScannerobject. Note : The class does not extendsDirectoryScannersince we DO not want to expose his methods.- Author:
- Tony Chemit - chemit@codelutin.com
-
-
Field Summary
Fields Modifier and Type Field Description protected Filebasedirprotected String[]excludesprotected String[]filesFiles to be findprotected String[]includesprotected String[]skipFilesprotected StringskipMessageprotected StringspecificGoalIf you want to restrict use of the entry, set the class name goal to this property viasetSpecificGoal(String).protected org.nuiton.io.FileUpdaterupdater
-
Constructor Summary
Constructors Constructor Description SourceEntry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanfilterByAnnotation(String file, URLClassLoader loader, List<String> annotationClass, org.apache.maven.plugin.logging.Log log)AnnotationgetAnnotation(File file, URLClassLoader loader, List<String> annotationClass, org.apache.maven.plugin.logging.Log log)AnnotationgetAnnotation(String file, URLClassLoader loader, List<String> annotationClass, org.apache.maven.plugin.logging.Log log)FilegetBasedir()Class<?>getClass(File file, URLClassLoader loader, org.apache.maven.plugin.logging.Log log)Class<?>getClass(String file, URLClassLoader loader, org.apache.maven.plugin.logging.Log log)String[]getExcludes()String[]getFiles()intgetFoudFiles()protected StringgetFQN(String file)String[]getIncludedFiles(File defaultBasedir, String[] defaultIncludes, String[] defaultExcludes)String[]getIncludedFiles(File basedir, String[] defaultIncludes, String[] defaultExcludes, URLClassLoader loader, List<String> annotationClass, org.apache.maven.plugin.logging.Log log)String[]getIncludes()String[]getSkipFiles()StringgetSkipMessage()StringgetSpecificGoal()org.nuiton.io.FileUpdatergetUpdater()booleanhasExcludes()booleanhasIncludes()booleanhasSrc()booleanisFileUptodate(File file)Test if a file is up to date and not to be treated.voidsetBasedir(File basedir)voidsetExcludes(String[] excludes)voidsetIncludes(String[] includes)voidsetSpecificGoal(String specificGoal)voidsetUpdater(org.nuiton.io.FileUpdater updater)StringtoString()booleanuseForGoal(String goal)
-
-
-
Field Detail
-
specificGoal
protected String specificGoal
If you want to restrict use of the entry, set the class name goal to this property viasetSpecificGoal(String). If let tonull, all goals can use this entry.
-
basedir
protected File basedir
-
includes
protected String[] includes
-
excludes
protected String[] excludes
-
files
protected String[] files
Files to be find
-
skipFiles
protected String[] skipFiles
-
skipMessage
protected String skipMessage
-
updater
protected org.nuiton.io.FileUpdater updater
-
-
Method Detail
-
getExcludes
public String[] getExcludes()
-
setExcludes
public void setExcludes(String[] excludes)
-
getIncludes
public String[] getIncludes()
-
setIncludes
public void setIncludes(String[] includes)
-
getBasedir
public File getBasedir()
-
setBasedir
public void setBasedir(File basedir)
-
getSpecificGoal
public String getSpecificGoal()
-
setSpecificGoal
public void setSpecificGoal(String specificGoal)
-
useForGoal
public boolean useForGoal(String goal)
-
hasSrc
public boolean hasSrc()
-
hasIncludes
public boolean hasIncludes()
-
hasExcludes
public boolean hasExcludes()
-
isFileUptodate
public final boolean isFileUptodate(File file)
Test if a file is up to date and not to be treated.- Parameters:
file- the file path to test- Returns:
trueif file is up to date and do not need to be parsed- See Also:
FileUpdater
-
getIncludedFiles
public String[] getIncludedFiles(File defaultBasedir, String[] defaultIncludes, String[] defaultExcludes)
-
getIncludedFiles
public String[] getIncludedFiles(File basedir, String[] defaultIncludes, String[] defaultExcludes, URLClassLoader loader, List<String> annotationClass, org.apache.maven.plugin.logging.Log log)
-
filterByAnnotation
protected boolean filterByAnnotation(String file, URLClassLoader loader, List<String> annotationClass, org.apache.maven.plugin.logging.Log log)
-
getClass
public Class<?> getClass(String file, URLClassLoader loader, org.apache.maven.plugin.logging.Log log)
-
getAnnotation
public Annotation getAnnotation(String file, URLClassLoader loader, List<String> annotationClass, org.apache.maven.plugin.logging.Log log)
-
getClass
public Class<?> getClass(File file, URLClassLoader loader, org.apache.maven.plugin.logging.Log log)
-
getAnnotation
public Annotation getAnnotation(File file, URLClassLoader loader, List<String> annotationClass, org.apache.maven.plugin.logging.Log log)
-
getSkipMessage
public String getSkipMessage()
-
getFiles
public String[] getFiles()
-
getSkipFiles
public String[] getSkipFiles()
-
getFoudFiles
public int getFoudFiles()
-
getUpdater
public org.nuiton.io.FileUpdater getUpdater()
-
setUpdater
public void setUpdater(org.nuiton.io.FileUpdater updater)
-
-