Class SourceEntry

java.lang.Object
org.nuiton.i18n.plugin.parser.SourceEntry
Direct Known Subclasses:
I18nSourceEntry

public class SourceEntry
extends java.lang.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:
Tony Chemit - chemit@codelutin.com
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.io.File basedir  
    protected java.lang.String[] excludes  
    protected java.lang.String[] files
    Files to be find
    protected java.lang.String[] includes  
    protected java.lang.String[] skipFiles  
    protected java.lang.String skipMessage  
    protected java.lang.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

    Constructors 
    Constructor Description
    SourceEntry()  
  • Method Summary

    Modifier and Type Method Description
    protected boolean filterByAnnotation​(java.lang.String file, java.net.URLClassLoader loader, java.util.List<java.lang.String> annotationClass, org.apache.maven.plugin.logging.Log log)  
    java.lang.annotation.Annotation getAnnotation​(java.io.File file, java.net.URLClassLoader loader, java.util.List<java.lang.String> annotationClass, org.apache.maven.plugin.logging.Log log)  
    java.lang.annotation.Annotation getAnnotation​(java.lang.String file, java.net.URLClassLoader loader, java.util.List<java.lang.String> annotationClass, org.apache.maven.plugin.logging.Log log)  
    java.io.File getBasedir()  
    java.lang.Class<?> getClass​(java.io.File file, java.net.URLClassLoader loader, org.apache.maven.plugin.logging.Log log)  
    java.lang.Class<?> getClass​(java.lang.String file, java.net.URLClassLoader loader, org.apache.maven.plugin.logging.Log log)  
    java.lang.String[] getExcludes()  
    java.lang.String[] getFiles()  
    int getFoudFiles()  
    protected java.lang.String getFQN​(java.lang.String file)  
    java.lang.String[] getIncludedFiles​(java.io.File defaultBasedir, java.lang.String[] defaultIncludes, java.lang.String[] defaultExcludes)  
    java.lang.String[] getIncludedFiles​(java.io.File basedir, java.lang.String[] defaultIncludes, java.lang.String[] defaultExcludes, java.net.URLClassLoader loader, java.util.List<java.lang.String> annotationClass, org.apache.maven.plugin.logging.Log log)  
    java.lang.String[] getIncludes()  
    java.lang.String[] getSkipFiles()  
    java.lang.String getSkipMessage()  
    java.lang.String getSpecificGoal()  
    org.nuiton.io.FileUpdater getUpdater()  
    boolean hasExcludes()  
    boolean hasIncludes()  
    boolean hasSrc()  
    boolean isFileUptodate​(java.io.File file)
    Test if a file is up to date and not to be treated.
    void setBasedir​(java.io.File basedir)  
    void setExcludes​(java.lang.String[] excludes)  
    void setIncludes​(java.lang.String[] includes)  
    void setSpecificGoal​(java.lang.String specificGoal)  
    void setUpdater​(org.nuiton.io.FileUpdater updater)  
    java.lang.String toString()  
    boolean useForGoal​(java.lang.String goal)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • specificGoal

      protected java.lang.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 java.io.File basedir
    • includes

      protected java.lang.String[] includes
    • excludes

      protected java.lang.String[] excludes
    • files

      protected java.lang.String[] files
      Files to be find
    • skipFiles

      protected java.lang.String[] skipFiles
    • skipMessage

      protected java.lang.String skipMessage
    • updater

      protected org.nuiton.io.FileUpdater updater
  • Constructor Details

  • Method Details

    • getExcludes

      public java.lang.String[] getExcludes()
    • setExcludes

      public void setExcludes​(java.lang.String[] excludes)
    • getIncludes

      public java.lang.String[] getIncludes()
    • setIncludes

      public void setIncludes​(java.lang.String[] includes)
    • getBasedir

      public java.io.File getBasedir()
    • setBasedir

      public void setBasedir​(java.io.File basedir)
    • getSpecificGoal

      public java.lang.String getSpecificGoal()
    • setSpecificGoal

      public void setSpecificGoal​(java.lang.String specificGoal)
    • useForGoal

      public boolean useForGoal​(java.lang.String goal)
    • hasSrc

      public boolean hasSrc()
    • hasIncludes

      public boolean hasIncludes()
    • hasExcludes

      public boolean hasExcludes()
    • isFileUptodate

      public final boolean isFileUptodate​(java.io.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 java.lang.String[] getIncludedFiles​(java.io.File defaultBasedir, java.lang.String[] defaultIncludes, java.lang.String[] defaultExcludes)
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • getIncludedFiles

      public java.lang.String[] getIncludedFiles​(java.io.File basedir, java.lang.String[] defaultIncludes, java.lang.String[] defaultExcludes, java.net.URLClassLoader loader, java.util.List<java.lang.String> annotationClass, org.apache.maven.plugin.logging.Log log)
    • filterByAnnotation

      protected boolean filterByAnnotation​(java.lang.String file, java.net.URLClassLoader loader, java.util.List<java.lang.String> annotationClass, org.apache.maven.plugin.logging.Log log)
    • getFQN

      protected java.lang.String getFQN​(java.lang.String file)
    • getClass

      public java.lang.Class<?> getClass​(java.lang.String file, java.net.URLClassLoader loader, org.apache.maven.plugin.logging.Log log)
    • getAnnotation

      public java.lang.annotation.Annotation getAnnotation​(java.lang.String file, java.net.URLClassLoader loader, java.util.List<java.lang.String> annotationClass, org.apache.maven.plugin.logging.Log log)
    • getClass

      public java.lang.Class<?> getClass​(java.io.File file, java.net.URLClassLoader loader, org.apache.maven.plugin.logging.Log log)
    • getAnnotation

      public java.lang.annotation.Annotation getAnnotation​(java.io.File file, java.net.URLClassLoader loader, java.util.List<java.lang.String> annotationClass, org.apache.maven.plugin.logging.Log log)
    • getSkipMessage

      public java.lang.String getSkipMessage()
    • getFiles

      public java.lang.String[] getFiles()
    • getSkipFiles

      public java.lang.String[] getSkipFiles()
    • getFoudFiles

      public int getFoudFiles()
    • getUpdater

      public org.nuiton.io.FileUpdater getUpdater()
    • setUpdater

      public void setUpdater​(org.nuiton.io.FileUpdater updater)