org.sonar.api.batch.fs.internal
Class DefaultFilePredicates

java.lang.Object
  extended by org.sonar.api.batch.fs.internal.DefaultFilePredicates
All Implemented Interfaces:
FilePredicates

public class DefaultFilePredicates
extends Object
implements FilePredicates

Factory of FilePredicate

Since:
4.2

Method Summary
 FilePredicate all()
          Returns a predicate that always evaluates to true
 FilePredicate and(Collection<FilePredicate> and)
           
 FilePredicate and(FilePredicate... and)
           
 FilePredicate and(FilePredicate first, FilePredicate second)
           
 FilePredicate doesNotMatchPathPattern(String exclusionPattern)
           
 FilePredicate doesNotMatchPathPatterns(String[] exclusionPatterns)
           
 FilePredicate hasAbsolutePath(String s)
          Warning - not efficient because absolute path is not indexed yet.
 FilePredicate hasLanguage(String language)
           
 FilePredicate hasLanguages(Collection<String> languages)
           
 FilePredicate hasPath(String s)
           
 FilePredicate hasRelativePath(String s)
          TODO document that non-normalized path and Windows-style path are supported
 FilePredicate hasStatus(InputFile.Status status)
           
 FilePredicate hasType(InputFile.Type type)
           
 FilePredicate is(File ioFile)
           
 FilePredicate matchesPathPattern(String inclusionPattern)
           
 FilePredicate matchesPathPatterns(String[] inclusionPatterns)
           
 FilePredicate none()
          Returns a predicate that always evaluates to false
 FilePredicate not(FilePredicate p)
           
 FilePredicate or(Collection<FilePredicate> or)
           
 FilePredicate or(FilePredicate... or)
           
 FilePredicate or(FilePredicate first, FilePredicate second)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

all

public FilePredicate all()
Returns a predicate that always evaluates to true

Specified by:
all in interface FilePredicates

none

public FilePredicate none()
Returns a predicate that always evaluates to false

Specified by:
none in interface FilePredicates

hasAbsolutePath

public FilePredicate hasAbsolutePath(String s)
Warning - not efficient because absolute path is not indexed yet.

Specified by:
hasAbsolutePath in interface FilePredicates

hasRelativePath

public FilePredicate hasRelativePath(String s)
TODO document that non-normalized path and Windows-style path are supported

Specified by:
hasRelativePath in interface FilePredicates

matchesPathPattern

public FilePredicate matchesPathPattern(String inclusionPattern)
Specified by:
matchesPathPattern in interface FilePredicates

matchesPathPatterns

public FilePredicate matchesPathPatterns(String[] inclusionPatterns)
Specified by:
matchesPathPatterns in interface FilePredicates

doesNotMatchPathPattern

public FilePredicate doesNotMatchPathPattern(String exclusionPattern)
Specified by:
doesNotMatchPathPattern in interface FilePredicates

doesNotMatchPathPatterns

public FilePredicate doesNotMatchPathPatterns(String[] exclusionPatterns)
Specified by:
doesNotMatchPathPatterns in interface FilePredicates

hasPath

public FilePredicate hasPath(String s)
Specified by:
hasPath in interface FilePredicates

is

public FilePredicate is(File ioFile)
Specified by:
is in interface FilePredicates

hasLanguage

public FilePredicate hasLanguage(String language)
Specified by:
hasLanguage in interface FilePredicates

hasLanguages

public FilePredicate hasLanguages(Collection<String> languages)
Specified by:
hasLanguages in interface FilePredicates

hasStatus

public FilePredicate hasStatus(InputFile.Status status)
Specified by:
hasStatus in interface FilePredicates

hasType

public FilePredicate hasType(InputFile.Type type)
Specified by:
hasType in interface FilePredicates

not

public FilePredicate not(FilePredicate p)
Specified by:
not in interface FilePredicates

or

public FilePredicate or(Collection<FilePredicate> or)
Specified by:
or in interface FilePredicates

or

public FilePredicate or(FilePredicate... or)
Specified by:
or in interface FilePredicates

or

public FilePredicate or(FilePredicate first,
                        FilePredicate second)
Specified by:
or in interface FilePredicates

and

public FilePredicate and(Collection<FilePredicate> and)
Specified by:
and in interface FilePredicates

and

public FilePredicate and(FilePredicate... and)
Specified by:
and in interface FilePredicates

and

public FilePredicate and(FilePredicate first,
                         FilePredicate second)
Specified by:
and in interface FilePredicates


Copyright © 2009-2014 SonarSource. All Rights Reserved.