Klasse FileSourceProvider
java.lang.Object
org.apache.torque.generator.source.SourceProvider
org.apache.torque.generator.source.stream.FileSourceProvider
Contains sources which are read from files in the file system.
$Id: FileSourceProvider.java 1917241 2024-04-21 13:29:41Z tv $
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungFileSourceProvider
(StreamSourceFormat sourceFormat, Fileset sourceFileset, Boolean combineFiles) Constructor. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungcopy()
Returns a copy of this source provider in its initial state.void
copyNotSetSettingsFrom
(SourceProvider sourceProvider) Copies settings which are not set in this source provider from another source provider.Returns whether source files are combined into one source tree.getPaths()
Returns all paths in the source Fileset.Returns the fileset which determines the source files to read.Returns the source format for this provider.boolean
hasNext()
protected void
initInternal
(ConfigurationHandlers configurationHandlers, ControllerState controllerState) Determines the files which match the source fileset.next()
void
remove()
void
resetInternal
(ConfigurationHandlers configurationHandlers, ControllerState controllerState) Resets the sources provided by this SourceProvider.void
setSourceFileset
(Fileset sourceFileset) Sets the fileset which determines the source files to read.toString()
Von Klasse geerbte Methoden org.apache.torque.generator.source.SourceProvider
init, isInit, reset
Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden java.util.Iterator
forEachRemaining
-
Konstruktordetails
-
FileSourceProvider
public FileSourceProvider(StreamSourceFormat sourceFormat, Fileset sourceFileset, Boolean combineFiles) throws ConfigurationException Constructor.- Parameter:
sourceFormat
- the source format, or null if the source format should be determined from the file extension.sourceFileset
- the fileset defining the source files, not null.combineFiles
- whether all files should be combined into one source tree.- Löst aus:
IllegalArgumentException
- if the source type is unknown.NullPointerException
- if path is null.ConfigurationException
- if the source filter cannot be instantiated.
-
-
Methodendetails
-
initInternal
protected void initInternal(ConfigurationHandlers configurationHandlers, ControllerState controllerState) throws ConfigurationException Determines the files which match the source fileset.- Angegeben von:
initInternal
in KlasseSourceProvider
- Parameter:
configurationHandlers
- the configuration handlers, not null.controllerState
- the current controller state, not null.- Löst aus:
ConfigurationException
- if the sourceFileset has no basedir or if the files cannot be determined.
-
resetInternal
public void resetInternal(ConfigurationHandlers configurationHandlers, ControllerState controllerState) Beschreibung aus Klasse kopiert:SourceProvider
Resets the sources provided by this SourceProvider.- Angegeben von:
resetInternal
in KlasseSourceProvider
- Parameter:
configurationHandlers
- the configuration handlers, not null.controllerState
- the current controller state, not null.
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove() -
toString
-
getSourceFormat
Returns the source format for this provider.- Gibt zurück:
- the source format, or null if the format is determined from file extensions.
-
getSourceFileset
Returns the fileset which determines the source files to read.- Gibt zurück:
- the fileset which determines the source files to read.
-
setSourceFileset
Sets the fileset which determines the source files to read.- Parameter:
sourceFileset
- the new source fileset, not null.- Löst aus:
NullPointerException
- if sourceFileset is null.IllegalStateException
- if init() was called before.
-
getPaths
Returns all paths in the source Fileset. The method init() must be called beforehand.- Gibt zurück:
- all Paths in the source fileset, not null.
- Löst aus:
IllegalStateException
- if the init method was not yet called.
-
getCombineFiles
Returns whether source files are combined into one source tree.- Gibt zurück:
- true if the source files are combined into one source tree, false otherwise, null to allow overriding this property (but will count as false if not overridden).
-
copy
Returns a copy of this source provider in its initial state. This means theSourceProvider.init(ConfigurationHandlers, ControllerState)
method of the new source provider must be called before it can be used.- Angegeben von:
copy
in KlasseSourceProvider
- Gibt zurück:
- the SourceProvider
- Löst aus:
ConfigurationException
- if the new SourceProvider cannot be initialized.
-
copyNotSetSettingsFrom
Copies settings which are not set in this source provider from another source provider. This only works if the type of the other source provider is known to this source provider. Only a subset of all properties are typically used for overwriting. No Properties which are already set are overwritten.- Angegeben von:
copyNotSetSettingsFrom
in KlasseSourceProvider
- Parameter:
sourceProvider
- the source provoder to copy the settings from.
-