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.ModelFileLocationDEFAULT_MODEL_FILE_LOCATIONThe 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 voidabstractReadResolve()is called just after deserialization.CallableModelFileImplclone()booleanequals(java.lang.Object obj)protected voidfillWriteReplace(AbstractModelFile writtenObj)is called just before serialization.ModelFile.ModelFileLocationgetLocation()java.lang.StringgetName()inthashCode()
-
-
-
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:
getLocationin interfaceModelFile- Returns:
- the location where to search for the file.
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceModelFile- Returns:
- the name used by the
ModelFileFinderto find the file.
-
clone
public CallableModelFileImpl clone() throws java.lang.CloneNotSupportedException
- Overrides:
clonein 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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-