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 thebasedir
directory which respects theincludes
and/orexcludes
patterns using an internalDirectoryScanner
object. Note : The class does not extendsDirectoryScanner
since we DO not want to expose his methods.- Author:
- Tony Chemit - chemit@codelutin.com
-
-
Field Summary
Fields Modifier and Type Field Description protected File
basedir
protected String[]
excludes
protected String[]
files
Files to be findprotected String[]
includes
protected String[]
skipFiles
protected String
skipMessage
protected String
specificGoal
If you want to restrict use of the entry, set the class name goal to this property viasetSpecificGoal(String)
.protected org.nuiton.io.FileUpdater
updater
-
Constructor Summary
Constructors Constructor Description SourceEntry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
filterByAnnotation(String file, URLClassLoader loader, List<String> annotationClass, org.apache.maven.plugin.logging.Log log)
Annotation
getAnnotation(File file, URLClassLoader loader, List<String> annotationClass, org.apache.maven.plugin.logging.Log log)
Annotation
getAnnotation(String file, URLClassLoader loader, List<String> annotationClass, org.apache.maven.plugin.logging.Log log)
File
getBasedir()
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()
int
getFoudFiles()
protected String
getFQN(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()
String
getSkipMessage()
String
getSpecificGoal()
org.nuiton.io.FileUpdater
getUpdater()
boolean
hasExcludes()
boolean
hasIncludes()
boolean
hasSrc()
boolean
isFileUptodate(File file)
Test if a file is up to date and not to be treated.void
setBasedir(File basedir)
void
setExcludes(String[] excludes)
void
setIncludes(String[] includes)
void
setSpecificGoal(String specificGoal)
void
setUpdater(org.nuiton.io.FileUpdater updater)
String
toString()
boolean
useForGoal(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:
true
if 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)
-
-