Class AbstractModelFile
- java.lang.Object
-
- cern.accsoft.steering.jmad.domain.file.AbstractModelFile
-
- All Implemented Interfaces:
ModelFile
- Direct Known Subclasses:
CallableModelFileImpl
,TableModelFileImpl
public class AbstractModelFile extends java.lang.Object implements ModelFile
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface cern.accsoft.steering.jmad.domain.file.ModelFile
ModelFile.ModelFileLocation
-
-
Field Summary
Fields Modifier and Type Field Description static ModelFile.ModelFileLocation
DEFAULT_MODEL_FILE_LOCATION
The model file location we use when the location is null after reading.
-
Constructor Summary
Constructors Constructor Description AbstractModelFile(java.lang.String path)
the constructor with the name only.AbstractModelFile(java.lang.String path, ModelFile.ModelFileLocation location)
The constructor with filename and location
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
abstractReadResolve()
is called just after deserialization.CallableModelFileImpl
clone()
boolean
equals(java.lang.Object obj)
protected void
fillWriteReplace(AbstractModelFile writtenObj)
is called just before serialization.ModelFile.ModelFileLocation
getLocation()
java.lang.String
getName()
int
hashCode()
-
-
-
Field Detail
-
DEFAULT_MODEL_FILE_LOCATION
public static final ModelFile.ModelFileLocation DEFAULT_MODEL_FILE_LOCATION
The model file location we use when the location is null after reading.
-
-
Constructor Detail
-
AbstractModelFile
public AbstractModelFile(java.lang.String path)
the constructor with the name only. (location stays to default)- Parameters:
path
- the relative path of the file
-
AbstractModelFile
public AbstractModelFile(java.lang.String path, ModelFile.ModelFileLocation location)
The constructor with filename and location- Parameters:
path
- the relative path of the model filelocation
- the location (repository or resources) where to search for the file
-
-
Method Detail
-
getLocation
public ModelFile.ModelFileLocation getLocation()
- Specified by:
getLocation
in interfaceModelFile
- Returns:
- the location where to search for the file.
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceModelFile
- Returns:
- the name used by the
ModelFileFinder
to find the file.
-
clone
public CallableModelFileImpl clone() throws java.lang.CloneNotSupportedException
- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
fillWriteReplace
protected void fillWriteReplace(AbstractModelFile writtenObj)
is called just before serialization. Removes some information so that the default values are not written to xml
-
abstractReadResolve
protected void abstractReadResolve()
is called just after deserialization. It configures the object with default values, if none were stored in the serialized version.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-