it.haefelinger.flaka.dep
Class Select

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.types.DataType
          extended by org.apache.tools.ant.types.selectors.BaseSelector
              extended by it.haefelinger.flaka.dep.Select
All Implemented Interfaces:
Cloneable, FileSelector

public class Select
extends BaseSelector


Field Summary
protected  Pattern alias
           
protected  String alias_regex
           
protected  Pattern bname
           
protected  String bname_regex
           
protected  String errmsg
           
protected  int flags
           
protected  Pattern gid
           
protected  String gid_regex
           
protected  boolean glob
           
protected static short GLOB
           
protected  boolean invert
           
protected  Pattern path
           
protected  String path_regex
           
protected  String refid
           
protected static short REGEX
           
protected  Pattern scope
           
protected  String scope_regex
           
protected  Pattern type
           
protected  String type_regex
           
protected  Pattern version
           
protected  String version_regex
           
 
Fields inherited from class org.apache.tools.ant.types.DataType
checked, ref
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
Select()
           
 
Method Summary
protected  Pattern compile(String S)
          compile a string a regular expression pattern.
protected  Dependency[] getdeps()
           
protected  Object getref()
           
protected  Object getref(String s)
          return s as reference.
 boolean hasattribs()
           
protected  Dependency haveDependency(String filename)
           
protected  void init()
          Init this instance.
 boolean isSelected(File basedir, String filename, File file)
          Implements a selector which can be used to restrict a given fileset.
protected  boolean match(Dependency d)
           
protected  boolean match(Pattern regex, String s)
          Match a string against a (precompiled) regular expression.
 void setAlias(String s)
           
 void setBasename(String s)
           
 void setCaseSensitive(boolean b)
           
 void setGlob(boolean b)
           
 void setGroup(String s)
           
 void setGroupid(String s)
           
 void setGroupname(String s)
           
 void setIgnore(boolean b)
           
 void setIgnoreCase(boolean b)
           
 void setInvert(boolean b)
           
 void setName(String s)
           
 void setPath(String s)
           
 void setRef(String s)
          Use attribute ref to change the reference holding all known dependencies.
 void setRefid(String s)
          Use attribute refid to change the reference holding all known dependencies.
 void setScope(String s)
           
 void setType(String s)
           
 void setVersion(String s)
           
 
Methods inherited from class org.apache.tools.ant.types.selectors.BaseSelector
getError, setError, validate, verifySettings
 
Methods inherited from class org.apache.tools.ant.types.DataType
checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, setChecked, setRefid, tooManyAttributes, toString
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GLOB

protected static final short GLOB
See Also:
Constant Field Values

REGEX

protected static final short REGEX
See Also:
Constant Field Values

invert

protected boolean invert

flags

protected int flags

glob

protected boolean glob

alias_regex

protected String alias_regex

scope_regex

protected String scope_regex

bname_regex

protected String bname_regex

type_regex

protected String type_regex

gid_regex

protected String gid_regex

path_regex

protected String path_regex

version_regex

protected String version_regex

alias

protected Pattern alias

scope

protected Pattern scope

bname

protected Pattern bname

type

protected Pattern type

gid

protected Pattern gid

path

protected Pattern path

version

protected Pattern version

errmsg

protected String errmsg

refid

protected String refid
Constructor Detail

Select

public Select()
Method Detail

setRefid

public void setRefid(String s)
Use attribute refid to change the reference holding all known dependencies.

Parameters:
s -

setRef

public void setRef(String s)
Use attribute ref to change the reference holding all known dependencies.

Parameters:
s -

setGlob

public void setGlob(boolean b)

setInvert

public void setInvert(boolean b)

setCaseSensitive

public void setCaseSensitive(boolean b)

setIgnore

public void setIgnore(boolean b)

setIgnoreCase

public void setIgnoreCase(boolean b)

setAlias

public void setAlias(String s)

setName

public void setName(String s)

setScope

public void setScope(String s)

setBasename

public void setBasename(String s)

setType

public void setType(String s)

setGroupid

public void setGroupid(String s)

setGroup

public void setGroup(String s)

setGroupname

public void setGroupname(String s)

setPath

public void setPath(String s)

setVersion

public void setVersion(String s)

init

protected void init()
Init this instance. Needs to be called before real execution, i.e isSelected(java.io.File, java.lang.String, java.io.File) takes place.

The method translates regular expressions given as string into precompiled pattern objects.


getref

protected Object getref(String s)
return s as reference.


getref

protected Object getref()

compile

protected final Pattern compile(String S)
compile a string a regular expression pattern. In case of an error, the internal variable errmsg is set.

Returns:
nil if s can't be translated.

getdeps

protected final Dependency[] getdeps()

haveDependency

protected final Dependency haveDependency(String filename)

match

protected final boolean match(Pattern regex,
                              String s)
Match a string against a (precompiled) regular expression.

Parameters:
regex - if null, true is returned regardless of s's value.
s - if null then true is returned if regex is null as well, otherwise false.

isSelected

public boolean isSelected(File basedir,
                          String filename,
                          File file)
Implements a selector which can be used to restrict a given fileset. When used without any attributes, a loc in a loc set is selected if that loc is the basename of a dependency. Further checks are carried out if given. For example, if a regular expression has been set to match the scope of a dependency, then the matching dependency must also match that regular expression.

Specified by:
isSelected in interface FileSelector
Specified by:
isSelected in class BaseSelector

hasattribs

public boolean hasattribs()

match

protected boolean match(Dependency d)
Parameters:
d - not null