gate.util.ant.packager
Class GazetteerLists

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.types.DataType
          extended by gate.util.ant.packager.GazetteerLists
All Implemented Interfaces:
Cloneable, org.apache.tools.ant.types.ResourceCollection

public class GazetteerLists
extends org.apache.tools.ant.types.DataType
implements org.apache.tools.ant.types.ResourceCollection

Class that extracts the list of gazetteer .lst files from a .def. This class extends Path so it can be used as a nested element within the extraresourcespath of a packagegapp task.


Field Summary
private  File definition
          The gazetteer list definition file (.def).
private  String encoding
          The encoding used to read the def file.
private  String[] listNames
          The names of the gazetteer lists referenced by the definition.
 
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
GazetteerLists()
           
 
Method Summary
 boolean isFilesystemOnly()
          ResourceCollection interface: returns true (this collection always exposes only filesystem resources).
 Iterator iterator()
          ResourceCollection interface: returns an iterator over the list files.
private  void load()
          Parse the definition and populate the array of list names.
 void setDefinition(File definition)
          Set the location of the definition file from which the lists should be extracted.
 void setEncoding(String encoding)
          Set the encoding used to read the definition file.
 int size()
          ResourceCollection interface: returns the number of list files referenced by this definition.
 
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, pushAndInvokeCircularReferenceCheck, 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

definition

private File definition
The gazetteer list definition file (.def).


encoding

private String encoding
The encoding used to read the def file. If null, the platform default encoding will be used.


listNames

private String[] listNames
The names of the gazetteer lists referenced by the definition.

Constructor Detail

GazetteerLists

public GazetteerLists()
Method Detail

setDefinition

public void setDefinition(File definition)
Set the location of the definition file from which the lists should be extracted. The list definition file is parsed and the .lst files found are added as pathelements to this path.

Throws:
org.apache.tools.ant.BuildException - if an error occurs parsing the definition file.

iterator

public Iterator iterator()
ResourceCollection interface: returns an iterator over the list files.

Specified by:
iterator in interface org.apache.tools.ant.types.ResourceCollection

isFilesystemOnly

public boolean isFilesystemOnly()
ResourceCollection interface: returns true (this collection always exposes only filesystem resources).

Specified by:
isFilesystemOnly in interface org.apache.tools.ant.types.ResourceCollection

size

public int size()
ResourceCollection interface: returns the number of list files referenced by this definition.

Specified by:
size in interface org.apache.tools.ant.types.ResourceCollection

load

private void load()
Parse the definition and populate the array of list names.


setEncoding

public void setEncoding(String encoding)
Set the encoding used to read the definition file. If this is not set, the platform default encoding is used.