Class SourceInformationImpl
- java.lang.Object
-
- cern.accsoft.steering.jmad.modeldefs.domain.SourceInformationImpl
-
- All Implemented Interfaces:
SourceInformation
public class SourceInformationImpl extends java.lang.Object implements SourceInformation
The default implementation for theSourceInformationinterface.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface cern.accsoft.steering.jmad.modeldefs.domain.SourceInformation
SourceInformation.SourceType
-
-
Constructor Summary
Constructors Constructor Description SourceInformationImpl(SourceInformation.SourceType sourceType, java.io.File rootPath, java.lang.String xmlFileName, java.lang.String pathOffsetWithinArchive)The constructor which requires both theSourceInformation.SourceTypeand the rootPath
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetFileName()if the model definition was loaded from an xml/json file (or a zip archive) then this returns the name of the xml/json file (or the name of the zip entry)java.lang.StringgetPathOffsetWithinArchive()java.io.FilegetRootPath()depending onSourceInformation.getSourceType()this either represents the name of zip archive or the base directory if local (i.e.SourceInformation.SourceTypegetSourceType()
-
-
-
Constructor Detail
-
SourceInformationImpl
public SourceInformationImpl(SourceInformation.SourceType sourceType, java.io.File rootPath, java.lang.String xmlFileName, java.lang.String pathOffsetWithinArchive)
The constructor which requires both theSourceInformation.SourceTypeand the rootPath- Parameters:
sourceType- defines the method how the model-file paths will be treated.rootPath- the path to the zip or base dir for the model definitionsxmlFileName- the name of the file from which the modelDefinition was loaded (usually fully qualified)pathOffsetWithinArchive- the path offset within an archive to use, when querying files. This is usually the parent path (within the offset) of the xml file.
-
-
Method Detail
-
getRootPath
public java.io.File getRootPath()
Description copied from interface:SourceInformationdepending onSourceInformation.getSourceType()this either represents the name of zip archive or the base directory if local (i.e. the path where the .jmd.xml file resides.)- Specified by:
getRootPathin interfaceSourceInformation- Returns:
- the path
-
getSourceType
public SourceInformation.SourceType getSourceType()
- Specified by:
getSourceTypein interfaceSourceInformation- Returns:
- The
SourceInformation.SourceTypewhich indicates from where the model definition was loaded.
-
getFileName
public java.lang.String getFileName()
Description copied from interface:SourceInformationif the model definition was loaded from an xml/json file (or a zip archive) then this returns the name of the xml/json file (or the name of the zip entry)- Specified by:
getFileNamein interfaceSourceInformation- Returns:
- the name of the xml/json file from which the model definition was loaded.
-
getPathOffsetWithinArchive
public java.lang.String getPathOffsetWithinArchive()
- Specified by:
getPathOffsetWithinArchivein interfaceSourceInformation- Returns:
- the path offset within the archive (if the model definition was loaded from an archive). Usually, this is
the parent path entry of
SourceInformation.getFileName()
-
-