org.nuiton.i18n.plugin.parser
Class SourceEntry

java.lang.Object
  extended by 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 the basedir directory which respects the includes and/or excludes patterns using an internal DirectoryScanner object.

Note : The class does not extends DirectoryScanner since we DO not want to expose his methods.

Author:
tchemit

Field Summary
protected  File basedir
           
protected  String[] excludes
           
protected  String[] files
          Files to be find
protected  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 via setSpecificGoal(String).
protected  org.nuiton.io.FileUpdater updater
           
 
Constructor Summary
SourceEntry()
           
 
Method Summary
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

specificGoal

protected String specificGoal
If you want to restrict use of the entry, set the class name goal to this property via setSpecificGoal(String).

If let to null, 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
Constructor Detail

SourceEntry

public SourceEntry()
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)

toString

public String toString()
Overrides:
toString in class Object

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)

getFQN

protected String getFQN(String file)

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)


Copyright © 2007-2011 CodeLutin. All Rights Reserved.