|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.chaosserver.bilbo.data.Directory
Directory object represents the mappings contained in a single directory.
Holds a collection of FilenameMapping objects that represent the files in the directory that need to be mapped.
Field Summary | |
protected Collection |
filenameMappings
Holds the collection of FilenameMappings in this directory. |
protected String |
name
Name of the directory. |
protected Collection |
subdirectories
Holds the collection of DirectoryMappings in this directory. |
Constructor Summary | |
Directory()
Default constructor. |
Method Summary | |
void |
addFilenameMapping(FilenameMapping filenameMapping)
Adds a new FilenameMapping object to this directory. |
void |
addSubdirectory(Directory subdirectory)
Adds a new directory object to this directory. |
FilenameMapping |
findFilenameMapping(String style,
String value)
Finds a FilenameMapping held in this Directory. |
FilenameMapping |
findFilenameMappingByValue(String value)
Finds a filenameMapping help in the directory. |
static Directory |
getDirectory(File mappingFile)
Unmarshall a directory object from a mapping file. |
Collection |
getFilenameMappings()
Getter method for the filename mappings. |
String |
getName()
Getter for the name of the directory. |
Collection |
getSubdirectories()
Getter method for the subdirectories. |
void |
removeFilenameMapping(FilenameMapping filenameMapping)
Removes a filenameMapping fromt the directory. |
void |
setFilenameMappings(Collection filenameMappings)
Setter method for the filename mappings. |
void |
setName(String name)
Setter for the name of the directory. |
void |
setSubdirectories(Collection subdirectories)
Setter method for the subdirectories. |
int |
size()
Returns the number of filenameMappings in this directory. |
String |
toString()
Converts the object to string representation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected String name
protected Collection filenameMappings
protected Collection subdirectories
Constructor Detail |
public Directory()
Method Detail |
public static Directory getDirectory(File mappingFile) throws NoMappingFileException, ReaderWriterException
mappingFile
- mapping file to unmarshall
NoMappingFileException
- if the mapping file does not exist
ReaderWriterException
- if an error occurs attempting
to unmarshall the filepublic void setName(String name)
name
- the name of the directory.public String getName()
public void setFilenameMappings(Collection filenameMappings)
filenameMappings
- the value of filenameMappingspublic Collection getFilenameMappings()
public void setSubdirectories(Collection subdirectories)
subdirectories
- the value of subdirectoriespublic Collection getSubdirectories()
public void addFilenameMapping(FilenameMapping filenameMapping)
filenameMapping
- the new FilenameMapping to addpublic void removeFilenameMapping(FilenameMapping filenameMapping) throws FilenameMappingNotFoundException
filenameMapping
- the mapping to remove from the directory
FilenameMappingNotFoundException
- indicates the mapping passed int
is not contained in the directorypublic void addSubdirectory(Directory subdirectory)
subdirectory
- the new directory to addpublic FilenameMapping findFilenameMappingByValue(String value) throws FilenameMappingNotFoundException
value
- the value of the mapping to find
FilenameMappingNotFoundException
- indicated the mapping
cannot be foundpublic FilenameMapping findFilenameMapping(String style, String value) throws FilenameMappingNotFoundException
style
- the style of the filename being searched forvalue
- the value of the filename being searched for
FilenameMappingNotFoundException
- if the mapping cannot be foundpublic int size()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |