de.unkrig.commons.file.filetransformation
Enum FileTransformer.Mode

java.lang.Object
  extended by java.lang.Enum<FileTransformer.Mode>
      extended by de.unkrig.commons.file.filetransformation.FileTransformer.Mode
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<FileTransformer.Mode>
Enclosing interface:
FileTransformer

public static enum FileTransformer.Mode
extends java.lang.Enum<FileTransformer.Mode>

See Also:
FileTransformer.transform(String, File, File, Mode), TRANSFORM, CHECK, CHECK_AND_TRANSFORM

Enum Constant Summary
CHECK
          Execute the operation, but do not create or modify any files, and throw FileTransformer.NOT_IDENTICAL iff the operation does not produce an identical result.
CHECK_AND_TRANSFORM
          Before executing the actual transformation, verify that it will actually modify any files.
TRANSFORM
          Execute the operation without previously checking if it actually changes any files.
 
Method Summary
static FileTransformer.Mode valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static FileTransformer.Mode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

TRANSFORM

public static final FileTransformer.Mode TRANSFORM
Execute the operation without previously checking if it actually changes any files.


CHECK

public static final FileTransformer.Mode CHECK
Execute the operation, but do not create or modify any files, and throw FileTransformer.NOT_IDENTICAL iff the operation does not produce an identical result. Since FileTransformer.transform(String, File, File, Mode) is typically much cheaper in this mode than in mode TRANSFORM, it may be efficient to execute the FileTransformer in this mode first to check whether the transformation would modify and files, before executing it in TRANSFORM mode, particularly if you do not expect any modifications.


CHECK_AND_TRANSFORM

public static final FileTransformer.Mode CHECK_AND_TRANSFORM
Before executing the actual transformation, verify that it will actually modify any files.

Since checking whether a transformation would actually change any files is typically much cheaper than the executing the actual transformation, this mode may be more efficient than TRANSFORM, particularly if you expect few or no modifications.

Method Detail

values

public static FileTransformer.Mode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (FileTransformer.Mode c : FileTransformer.Mode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static FileTransformer.Mode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null