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 theSourceInformation
interface.
-
-
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.SourceType
and the rootPath
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getFileName()
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.String
getPathOffsetWithinArchive()
java.io.File
getRootPath()
depending onSourceInformation.getSourceType()
this either represents the name of zip archive or the base directory if local (i.e.SourceInformation.SourceType
getSourceType()
-
-
-
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.SourceType
and 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:SourceInformation
depending 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:
getRootPath
in interfaceSourceInformation
- Returns:
- the path
-
getSourceType
public SourceInformation.SourceType getSourceType()
- Specified by:
getSourceType
in interfaceSourceInformation
- Returns:
- The
SourceInformation.SourceType
which indicates from where the model definition was loaded.
-
getFileName
public java.lang.String getFileName()
Description copied from interface:SourceInformation
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)- Specified by:
getFileName
in interfaceSourceInformation
- Returns:
- the name of the xml/json file from which the model definition was loaded.
-
getPathOffsetWithinArchive
public java.lang.String getPathOffsetWithinArchive()
- Specified by:
getPathOffsetWithinArchive
in 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()
-
-