Class Output
java.lang.Object
org.apache.torque.generator.configuration.controller.Output
The configuration for an output (typically one or more files).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the reference to the outlet which should produce the content.Returns the character encoding of the generated file(s).Returns the strategy how existing target files should be handled.Returns the name of the file to generate.Returns the reference to the outlet which should produce the file name.getName()Returns the name by which this output can be identified.getOrDetermineLineBreak(String content) Returns the line break character(s) for this Output.Returns the key for the output directory into which the output is written.Returns the list of postprocessors which should be applied to the generation result.Returns how the sources should be post-processed before generation.Returns the source provider which provides the input for generating the output file's contents.getType()Returns the type of the produced output, e.g. java, xml.voidsetContentOutlet(OutletReference contentOutlet) Sets the reference to the outlet which should produce the content.voidsetEncoding(Charset charSet) Sets the character encoding of the generated file(s).voidsetExistingTargetStrategy(String existingTargetStrategy) Sets the strategy how existing target files should be handled.voidsetFilename(String filename) Sets the name of the file to generate.voidsetFilenameOutlet(Outlet filenameOutlet) Sets the reference to the outlet which should produce the file name.voidsetOutputDirKey(String outputKeyDir) Sets the key for the output directory into which the output is written.voidsetSourceProcessConfiguration(SourceProcessConfiguration sourceProcessConfiguration) Sets how the sources should be post-processed before generation.voidsetSourceProvider(SourceProvider sourceProvider) Sets the source provider which provides the input for generating the output file's contents.voidSets the type of the produced output, e.g. java, xml.toString()
-
Constructor Details
-
Output
Constructor.- Parameters:
name- the name by which this output can be identified.
-
-
Method Details
-
getName
Returns the name by which this output can be identified.- Returns:
- the name by which this output can be identified, not null.
-
getSourceProvider
Returns the source provider which provides the input for generating the output file's contents.- Returns:
- the source provider which provides the input for generation.
-
setSourceProvider
Sets the source provider which provides the input for generating the output file's contents.- Parameters:
sourceProvider- the source provider which provides the input for generation.
-
getSourceProcessConfiguration
Returns how the sources should be post-processed before generation.- Returns:
- the information about post-processing the sources.
-
setSourceProcessConfiguration
Sets how the sources should be post-processed before generation.- Parameters:
sourceProcessConfiguration- the information about post-processing the sources.
-
getPostprocessorDefinitions
Returns the list of postprocessors which should be applied to the generation result.- Returns:
- the modifiable list of postprocessors, not null. Changes to the returned list change this object as well.
-
setFilename
Sets the name of the file to generate. This is also used to store the generated filename if it was generated using the filenameOutlet.- Parameters:
filename- the name of the file to generate.
-
getFilename
Returns the name of the file to generate. Either this name was given explicitly or it was set using the filenameOutlet.- Returns:
- the name of the file to generate.
-
getContentOutlet
Returns the reference to the outlet which should produce the content.- Returns:
- the reference to the outlet responsible for producing the content.
-
setContentOutlet
Sets the reference to the outlet which should produce the content.- Parameters:
contentOutlet- the reference to the outlet responsible for producing the content.
-
getFilenameOutlet
Returns the reference to the outlet which should produce the file name. If this attribute is set, it takes precedence over a set filename.- Returns:
- the reference to the outlet responsible for producing the file name, or null if the file name is explicitly given.
-
setFilenameOutlet
Sets the reference to the outlet which should produce the file name.- Parameters:
filenameOutlet- the reference to the outlet responsible for producing the file name.
-
getExistingTargetStrategy
Returns the strategy how existing target files should be handled.- Returns:
- the strategy name.
-
setExistingTargetStrategy
Sets the strategy how existing target files should be handled.- Parameters:
existingTargetStrategy- the strategy name.
-
getOutputDirKey
Returns the key for the output directory into which the output is written.- Returns:
- the key for the output directory, or null for the default output directory.
-
setOutputDirKey
Sets the key for the output directory into which the output is written.- Parameters:
outputKeyDir- the key for the output directory, or null for the default output directory.
-
getEncoding
Returns the character encoding of the generated file(s).- Returns:
- The character encoding of the generated file, or null for the platform default encoding.
-
setEncoding
Sets the character encoding of the generated file(s).- Parameters:
charSet- The character encoding of the generated file, or null for the platform default encoding.
-
setType
Sets the type of the produced output, e.g. java, xml.- Parameters:
type- the type, not null.- Throws:
NullPointerException- if type is null.
-
getType
Returns the type of the produced output, e.g. java, xml.- Returns:
- the type, not null.
-
getOrDetermineLineBreak
Returns the line break character(s) for this Output.If the line break was already determined, the already determined line break character(s) are returned, and content is ignored.
If the line break character was not already determined, the occurrence of the different line break characters is counted and the largest is returned ("\r\n" for equal count)
If one of them is > 0, the result is cached and stored; if all occurrences are 0, the result is not cached and will be determined anew if the method is called another time for the same output.
- Parameters:
content- the already produced content.- Returns:
- the line break character(s), one of "\r", "\n", "\r\n".
-
toString
-