Interface OptionModelInterface
- All Superinterfaces:
Remote,Serializable
- All Known Implementing Classes:
OptionModel,OptionModelSkeleton,OptionModelStub
Interface for option model.
- Version:
- 10.1.1
- Author:
- jmback
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd valid values for an existing option.booleanexistsOption(String iKey) Checks if option with key exists in this option model or in any imported option model.booleangetBooleanOption(String iKey) Get the value of a boolean option.org.jdom2.DocumentGet content of option model as a document.Get key for existing option from this option model or top option model.Get name for existing option in this option model or in any imported option model.getNames()Get names for all existing (non-internal) options of this model and imported models.Get the value of an option from this option model or from any imported option model.getStringOption(String iKey) Get the value of a string option from this option model or from any imported option model.booleanHas option model content changed since last save or load?importOption(org.jdom2.Document doc) Import the option model given as document into this option model and return the imported option model.voidinitialize(org.jdom2.Document iXMLText) Initialize option model from the XML text.voidremoveOption(String iKey) Remove the option with this key from the option model.voidsetDescription(String iKey, String sDescription) Set the description of the option with the given key.voidsetInternal(String iKey, boolean bInternal) Set the option with the given key to be internalvoidCreate a new option or modify the properties of an option.
-
Method Details
-
initialize
Initialize option model from the XML text.- Parameters:
iXMLText- XML text containing the configuration of a option model.- Throws:
M2MExceptionRemoteException
-
getDocument
Get content of option model as a document. Only non-internal options are saved. Only the options in this option model are saved, not from the imported. Important side effect: The option model is marked as unchanged because it is assumed that the reading into a document is used to save the model.- Returns:
- XML document containing the content of the option model
- Throws:
SevereExceptionM2MExceptionRemoteException
-
setOption
Create a new option or modify the properties of an option.- Parameters:
iKey- Key of optionsValue- Value of option- Throws:
M2MExceptionRemoteException
-
setInternal
Set the option with the given key to be internal- Parameters:
iKey- key of optionbInternal- true means internal. An option already set to internal cannot be set external again.- Throws:
M2MExceptionRemoteException
-
setDescription
Set the description of the option with the given key.- Parameters:
iKey- key of optionsDescription- new description- Throws:
M2MExceptionRemoteException
-
removeOption
Remove the option with this key from the option model.- Parameters:
iKey- key of option- Throws:
M2MExceptionRemoteException
-
addValues
Add valid values for an existing option.- Parameters:
iKey- key of optionlistValue- list of allowed values for the option, empty list means all values are allowed- Throws:
M2MExceptionRemoteException
-
getOption
Get the value of an option from this option model or from any imported option model.- Parameters:
iKey- key of the option- Returns:
- value value of the option, if the option has been set
- Throws:
SevereExceptionSevereException- if the option has not been setM2MExceptionRemoteException
-
getStringOption
Get the value of a string option from this option model or from any imported option model.- Parameters:
iKey- key of the option- Returns:
- value
- Throws:
SevereExceptionM2MExceptionRemoteException
-
getBooleanOption
Get the value of a boolean option.- Parameters:
iKey- key of the option- Returns:
- value value of the option, if the option has been set
- Throws:
SevereException- if the option has not been setM2MExceptionRemoteException
-
existsOption
Checks if option with key exists in this option model or in any imported option model.- Parameters:
iKey-- Returns:
- true if the option exists
- Throws:
M2MExceptionRemoteException
-
getNames
Get names for all existing (non-internal) options of this model and imported models.- Returns:
- List of names.
- Throws:
M2MExceptionRemoteException
-
getName
Get name for existing option in this option model or in any imported option model.- Parameters:
iKey- string key of option- Returns:
- option name
- Throws:
M2MExceptionRemoteException
-
getKey
Get key for existing option from this option model or top option model.- Parameters:
iKey- string key of option- Returns:
- option key
- Throws:
M2MExceptionRemoteException
-
hasChanged
Has option model content changed since last save or load?- Returns:
- true, if the content of the model has changed.
- Throws:
M2MExceptionRemoteException
-
importOption
Import the option model given as document into this option model and return the imported option model. If there is already an imported model, reload it from document. If no document is given, simply return the imported option model. If there is an option model, then any later read access to an option will be forwarded to the imported model,if the option is not in the option model.- Parameters:
doc- document describing the imported option model, maybe null to not import a new model but to only get the imported model- Returns:
- imported option model
- Throws:
M2MExceptionRemoteException
-