Class DocumentName.Builder

java.lang.Object
org.apache.rat.document.DocumentName.Builder
Enclosing class:
DocumentName

public static final class DocumentName.Builder extends Object
The Builder for a DocumentName.
  • Method Details

    • directorySeparator

      public String directorySeparator()
      Get the directory separator for this builder.
      Returns:
      the directory separator fo this builder.
    • setRoot

      public DocumentName.Builder setRoot(String root)
      Sets the root for the DocumentName.
      Parameters:
      root - the root for the DocumentName.
      Returns:
      this.
    • setName

      public DocumentName.Builder setName(String name)
      Sets the name for this DocumentName relative to the baseName. If the name is null 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

      public DocumentName.Builder setName(File file)
      Sets the properties from the file. Will reset the baseName appropriately.
      Parameters:
      file - the file to set the properties from.
      Returns:
      this.
    • setBaseName

      public DocumentName.Builder setBaseName(String baseName)
      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

      public DocumentName.Builder setBaseName(DocumentName baseName)
      Sets the basename from the name 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

      public DocumentName.Builder setBaseName(File file)
      Sets the basename from a File. Sets root and the baseName Will set the root.
      Parameters:
      file - the file to set the base name from.
      Returns:
      this.
    • build

      public DocumentName build()
      Build a DocumentName from this builder.
      Returns:
      A new DocumentName.