public abstract class SpreadsheetModel extends Model implements ISearchableModel
Modifier and Type | Field and Description |
---|---|
protected List<SpreadsheetReference> |
references |
protected List<SpreadsheetWorksheet> |
worksheets |
aliases, name, PROPERTY_ALIASES, PROPERTY_NAME, PROPERTY_READONLOAD, PROPERTY_STOREONDISPOSAL, readOnLoad, storeOnDisposal
Constructor and Description |
---|
SpreadsheetModel() |
Modifier and Type | Method and Description |
---|---|
void |
addReference(SpreadsheetReference reference)
Associate the given reference with this spreadsheet.
|
void |
addWorksheet(SpreadsheetWorksheet worksheet)
The purpose of this method is to associate the given worksheet with this spreadsheet.
|
List<SpreadsheetRow> |
allContents()
This method returns all rows of all worksheets.
|
Object |
createInstance(String type)
This method creates a blank row in the worksheet identifiable by type.
|
Object |
createInstance(String type,
Collection<Object> parameters)
This method creates a new row in the worksheet identifiable by type.
|
Object |
createInstance(String type,
Map<String,Object> parameters)
This method creates a new row in the worksheet identifiable by type.
|
protected abstract SpreadsheetWorksheet |
createWorksheet(ISpreadsheetMetadata.SpreadsheetWorksheetMetadata worksheetMetadata)
The purpose of this method is to create a worksheet.
|
void |
deleteElement(Object instance)
This method deletes the given instance (row) from the worksheet it belongs to.
|
protected abstract void |
deleteWorksheet(SpreadsheetWorksheet worksheet)
The purpose of this method is to delete the given worksheet from this spreadsheet
|
abstract Collection<SpreadsheetRow> |
find(Variable iterator,
ModuleElement ast,
IEolContext context) |
Object |
findOne(Variable iterator,
ModuleElement ast,
IEolContext context) |
Collection<SpreadsheetRow> |
getAllOfKind(String type) |
List<SpreadsheetRow> |
getAllOfType(String type)
Returns every row contained by the worksheet identifiable by the given type.
|
Object |
getElementById(String id) |
String |
getElementId(Object instance) |
Object |
getEnumerationValue(String enumeration,
String label) |
IPropertyGetter |
getPropertyGetter() |
IPropertySetter |
getPropertySetter() |
List<SpreadsheetReference> |
getReferences() |
Set<SpreadsheetReference> |
getReferencesBySource(SpreadsheetWorksheet worksheet)
The purpose of this method is to find all references where the given worksheet is a source i.e.
|
Set<SpreadsheetReference> |
getReferencesBySource(SpreadsheetWorksheet worksheet,
SpreadsheetColumn column)
The purpose of this method is to find all references where the given worksheet and column is a source i.e.
|
Set<SpreadsheetReference> |
getReferencesByTarget(SpreadsheetWorksheet worksheet)
The purpose of this method is to find all references where the given worksheet is a target i.e.
|
Set<SpreadsheetReference> |
getReferencesByTarget(SpreadsheetWorksheet worksheet,
SpreadsheetColumn column)
The purpose of this method is to find all references where the given worksheet and column is a target i.e.
|
protected abstract ISpreadsheetMetadata |
getSpreadsheetMetadata()
The purpose of this method is to return an instance of the ISpreadsheetMetadata implementation for retrieving
metadata for this spreadsheet model
|
String |
getTypeNameOf(Object instance)
This method returns the name of the worksheet that the instance (row) belongs to.
|
SpreadsheetWorksheet |
getTypeOf(Object instance)
This method returns the worksheet that the given instance (row) belongs to.
|
SpreadsheetWorksheet |
getWorksheetByType(String type)
This method returns the first worksheet of the given type as determined by
SpreadsheetWorksheet.isIdentifiablyBy(String) method. |
List<SpreadsheetWorksheet> |
getWorksheets() |
boolean |
hasType(String type) |
boolean |
isInstantiable(String type) |
protected abstract boolean |
isMetadataConfigurationDefined() |
void |
load() |
protected void |
loadColumnsFromMetadata(ISpreadsheetMetadata metadata,
SpreadsheetWorksheet worksheet) |
protected void |
loadConfigurationFile()
The purpose of this method is to load the configuration file
|
protected void |
loadReferenceFromConfigurationFile(ISpreadsheetMetadata.SpreadsheetReferenceMetadata referenceMetadata) |
protected abstract void |
loadSpreadsheet()
The purpose of this method is to load the spreadsheet.
|
protected void |
loadWorksheetFromConfigurationFile(ISpreadsheetMetadata metadata,
ISpreadsheetMetadata.SpreadsheetWorksheetMetadata worksheetMetadata) |
boolean |
owns(Object instance)
Used to test whether an object is contained in this model.
|
void |
setElementId(Object instance,
String newId) |
boolean |
store() |
boolean |
store(String location) |
allInstances, dispose, getAliases, getFullyQualifiedTypeNameOf, getMetamodel, getName, getTransactionSupport, isModelElement, isOfKind, isOfType, isPropertySet, isReadOnLoad, isStoredOnDisposal, knowsAboutProperty, load, load, load, setName, setReadOnLoad, setStoredOnDisposal
protected List<SpreadsheetWorksheet> worksheets
protected List<SpreadsheetReference> references
public List<SpreadsheetWorksheet> getWorksheets()
public void addWorksheet(SpreadsheetWorksheet worksheet)
worksheet
- public List<SpreadsheetReference> getReferences()
public void addReference(SpreadsheetReference reference)
reference
- public void load() throws EolModelLoadingException
load
in interface IModel
EolModelLoadingException
protected abstract void loadSpreadsheet() throws Exception
Exception
protected abstract ISpreadsheetMetadata getSpreadsheetMetadata()
protected void loadConfigurationFile() throws Exception
Exception
protected abstract boolean isMetadataConfigurationDefined()
protected void loadWorksheetFromConfigurationFile(ISpreadsheetMetadata metadata, ISpreadsheetMetadata.SpreadsheetWorksheetMetadata worksheetMetadata) throws Exception
Exception
protected abstract SpreadsheetWorksheet createWorksheet(ISpreadsheetMetadata.SpreadsheetWorksheetMetadata worksheetMetadata) throws Exception
worksheetMetadata
- Exception
protected void loadColumnsFromMetadata(ISpreadsheetMetadata metadata, SpreadsheetWorksheet worksheet)
protected void loadReferenceFromConfigurationFile(ISpreadsheetMetadata.SpreadsheetReferenceMetadata referenceMetadata)
public Object getEnumerationValue(String enumeration, String label)
getEnumerationValue
in interface IModel
public List<SpreadsheetRow> allContents()
allContents
in interface IModel
public List<SpreadsheetRow> getAllOfType(String type) throws EolModelElementTypeNotFoundException
getAllOfType
in interface IModel
EolModelElementTypeNotFoundException
public Collection<SpreadsheetRow> getAllOfKind(String type) throws EolModelElementTypeNotFoundException
getAllOfKind
in interface IModel
EolModelElementTypeNotFoundException
public SpreadsheetWorksheet getTypeOf(Object instance)
public String getTypeNameOf(Object instance)
getTypeNameOf
in interface IModel
instance
- The model object whose type is to be determined.public Object createInstance(String type) throws EolModelElementTypeNotFoundException
createInstance
in interface IModel
EolModelElementTypeNotFoundException
public Object createInstance(String type, Collection<Object> parameters) throws EolModelElementTypeNotFoundException
createInstance
in interface IModel
createInstance
in class Model
EolModelElementTypeNotFoundException
public Object createInstance(String type, Map<String,Object> parameters) throws EolModelElementTypeNotFoundException
type
- parameters
- EolModelElementTypeNotFoundException
- if worksheet cannot be foundpublic Object getElementById(String id)
getElementById
in interface IModel
public String getElementId(Object instance)
getElementId
in interface IModel
public void setElementId(Object instance, String newId)
setElementId
in interface IModel
public void deleteElement(Object instance) throws EolRuntimeException
deleteElement
in interface IModel
EolRuntimeException
public boolean owns(Object instance)
IModel
public boolean isInstantiable(String type)
isInstantiable
in interface IModel
public IPropertyGetter getPropertyGetter()
getPropertyGetter
in interface IModel
getPropertyGetter
in class Model
public IPropertySetter getPropertySetter()
getPropertySetter
in interface IModel
getPropertySetter
in class Model
public SpreadsheetWorksheet getWorksheetByType(String type)
SpreadsheetWorksheet.isIdentifiablyBy(String)
method.type
- public Set<SpreadsheetReference> getReferencesBySource(SpreadsheetWorksheet worksheet)
worksheet
- public Set<SpreadsheetReference> getReferencesBySource(SpreadsheetWorksheet worksheet, SpreadsheetColumn column)
worksheet
- column
- public Set<SpreadsheetReference> getReferencesByTarget(SpreadsheetWorksheet worksheet)
worksheet
- public Set<SpreadsheetReference> getReferencesByTarget(SpreadsheetWorksheet worksheet, SpreadsheetColumn column)
worksheet
- column
- public Object findOne(Variable iterator, ModuleElement ast, IEolContext context) throws EolRuntimeException
findOne
in interface ISearchableModel
EolRuntimeException
public abstract Collection<SpreadsheetRow> find(Variable iterator, ModuleElement ast, IEolContext context) throws EolRuntimeException
find
in interface ISearchableModel
EolRuntimeException
protected abstract void deleteWorksheet(SpreadsheetWorksheet worksheet)
worksheet
- Copyright © 2018. All rights reserved.