Package org.apache.rat.document
Class DocumentName.Builder
java.lang.Object
org.apache.rat.document.DocumentName.Builder
- Enclosing class:
DocumentName
The Builder for a DocumentName.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build a DocumentName from this builder.Get the directory separator for this builder.setBaseName
(File file) Sets the basename from a File.setBaseName
(String baseName) Sets the baseName.setBaseName
(DocumentName baseName) Sets the basename from thename
of the specified DocumentName.Sets the properties from the file.Sets the name for this DocumentName relative to the baseName.Sets the root for the DocumentName.
-
Method Details
-
directorySeparator
Get the directory separator for this builder.- Returns:
- the directory separator fo this builder.
-
setRoot
Sets the root for the DocumentName.- Parameters:
root
- the root for the DocumentName.- Returns:
- this.
-
setName
Sets the name for this DocumentName relative to the baseName. If thename
isnull
an empty string is used.To correctly parse the string it must use the directory separator specified by this Document.
- Parameters:
name
- the name for this Document name. Will be made relative to the baseName.- Returns:
- this
-
setName
Sets the properties from the file. Will reset the baseName appropriately.- Parameters:
file
- the file to set the properties from.- Returns:
- this.
-
setBaseName
Sets the baseName. Will set the root if it is not set.To correctly parse the string it must use the directory separator specified by this builder.
- Parameters:
baseName
- the basename to use.- Returns:
- this.
-
setBaseName
Sets the basename from thename
of the specified DocumentName. Will set the root the baseName has the root set.- Parameters:
baseName
- the DocumentName to set the basename from.- Returns:
- this.
-
setBaseName
Sets the basename from a File. Setsroot
and thebaseName
Will set the root.- Parameters:
file
- the file to set the base name from.- Returns:
- this.
-
build
Build a DocumentName from this builder.- Returns:
- A new DocumentName.
-