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, setStoredOnDisposalprotected 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 IModelEolModelLoadingExceptionprotected abstract void loadSpreadsheet()
throws Exception
Exceptionprotected abstract ISpreadsheetMetadata getSpreadsheetMetadata()
protected void loadConfigurationFile()
throws Exception
Exceptionprotected abstract boolean isMetadataConfigurationDefined()
protected void loadWorksheetFromConfigurationFile(ISpreadsheetMetadata metadata, ISpreadsheetMetadata.SpreadsheetWorksheetMetadata worksheetMetadata) throws Exception
Exceptionprotected abstract SpreadsheetWorksheet createWorksheet(ISpreadsheetMetadata.SpreadsheetWorksheetMetadata worksheetMetadata) throws Exception
worksheetMetadata - Exceptionprotected void loadColumnsFromMetadata(ISpreadsheetMetadata metadata, SpreadsheetWorksheet worksheet)
protected void loadReferenceFromConfigurationFile(ISpreadsheetMetadata.SpreadsheetReferenceMetadata referenceMetadata)
public Object getEnumerationValue(String enumeration, String label)
getEnumerationValue in interface IModelpublic List<SpreadsheetRow> allContents()
allContents in interface IModelpublic List<SpreadsheetRow> getAllOfType(String type) throws EolModelElementTypeNotFoundException
getAllOfType in interface IModelEolModelElementTypeNotFoundExceptionpublic Collection<SpreadsheetRow> getAllOfKind(String type) throws EolModelElementTypeNotFoundException
getAllOfKind in interface IModelEolModelElementTypeNotFoundExceptionpublic SpreadsheetWorksheet getTypeOf(Object instance)
public String getTypeNameOf(Object instance)
getTypeNameOf in interface IModelinstance - The model object whose type is to be determined.public Object createInstance(String type) throws EolModelElementTypeNotFoundException
createInstance in interface IModelEolModelElementTypeNotFoundExceptionpublic Object createInstance(String type, Collection<Object> parameters) throws EolModelElementTypeNotFoundException
createInstance in interface IModelcreateInstance in class ModelEolModelElementTypeNotFoundExceptionpublic 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 IModelpublic String getElementId(Object instance)
getElementId in interface IModelpublic void setElementId(Object instance, String newId)
setElementId in interface IModelpublic void deleteElement(Object instance) throws EolRuntimeException
deleteElement in interface IModelEolRuntimeExceptionpublic boolean owns(Object instance)
IModelpublic boolean isInstantiable(String type)
isInstantiable in interface IModelpublic IPropertyGetter getPropertyGetter()
getPropertyGetter in interface IModelgetPropertyGetter in class Modelpublic IPropertySetter getPropertySetter()
getPropertySetter in interface IModelgetPropertySetter in class Modelpublic 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 ISearchableModelEolRuntimeExceptionpublic abstract Collection<SpreadsheetRow> find(Variable iterator, ModuleElement ast, IEolContext context) throws EolRuntimeException
find in interface ISearchableModelEolRuntimeExceptionprotected abstract void deleteWorksheet(SpreadsheetWorksheet worksheet)
worksheet - Copyright © 2018. All rights reserved.