Class OptionModel
java.lang.Object
de.mid.innovator.m2msdk.model.option.OptionModel
- All Implemented Interfaces:
OptionModelInterface,Serializable,Remote
Option model keeping all options and their values.
- Version:
- 10.1.1
- Author:
- prhuettn
- See Also:
-
Constructor Summary
Constructors -
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.voidsetChanged(boolean ibChanged) 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.toString()
-
Constructor Details
-
OptionModel
Create an option model.- Parameters:
iSession- current session
-
-
Method Details
-
initialize
Description copied from interface:OptionModelInterfaceInitialize option model from the XML text.- Specified by:
initializein interfaceOptionModelInterface- Parameters:
iXMLText- XML text containing the configuration of a option model.- Throws:
RemoteExceptionM2MException
-
getDocument
Description copied from interface:OptionModelInterfaceGet 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.- Specified by:
getDocumentin interfaceOptionModelInterface- Returns:
- XML document containing the content of the option model
- Throws:
RemoteExceptionM2MException
-
existsOption
Description copied from interface:OptionModelInterfaceChecks if option with key exists in this option model or in any imported option model.- Specified by:
existsOptionin interfaceOptionModelInterface- Parameters:
iKey-- Returns:
- true if the option exists
- Throws:
RemoteExceptionM2MException
-
setOption
Description copied from interface:OptionModelInterfaceCreate a new option or modify the properties of an option.- Specified by:
setOptionin interfaceOptionModelInterface- Parameters:
iKey- Key of optionsValue- Value of option- Throws:
RemoteExceptionM2MException
-
addValues
Description copied from interface:OptionModelInterfaceAdd valid values for an existing option.- Specified by:
addValuesin interfaceOptionModelInterface- Parameters:
iKey- key of optionlistValue- list of allowed values for the option, empty list means all values are allowed- Throws:
M2MExceptionRemoteException
-
getOption
Description copied from interface:OptionModelInterfaceGet the value of an option from this option model or from any imported option model.- Specified by:
getOptionin interfaceOptionModelInterface- Parameters:
iKey- key of the option- Returns:
- value value of the option, if the option has been set
- Throws:
RemoteExceptionM2MException
-
getStringOption
Description copied from interface:OptionModelInterfaceGet the value of a string option from this option model or from any imported option model.- Specified by:
getStringOptionin interfaceOptionModelInterface- Parameters:
iKey- key of the option- Returns:
- value
- Throws:
RemoteExceptionM2MException
-
getBooleanOption
Description copied from interface:OptionModelInterfaceGet the value of a boolean option.- Specified by:
getBooleanOptionin interfaceOptionModelInterface- Parameters:
iKey- key of the option- Returns:
- value value of the option, if the option has been set
- Throws:
RemoteExceptionM2MException
-
getNames
Description copied from interface:OptionModelInterfaceGet names for all existing (non-internal) options of this model and imported models.- Specified by:
getNamesin interfaceOptionModelInterface- Returns:
- List of names.
- Throws:
RemoteExceptionM2MException
-
getKey
Description copied from interface:OptionModelInterfaceGet key for existing option from this option model or top option model.- Specified by:
getKeyin interfaceOptionModelInterface- Parameters:
iKey- string key of option- Returns:
- option key
- Throws:
RemoteExceptionM2MException
-
hasChanged
Description copied from interface:OptionModelInterfaceHas option model content changed since last save or load?- Specified by:
hasChangedin interfaceOptionModelInterface- Returns:
- true, if the content of the model has changed.
- Throws:
M2MExceptionRemoteException
-
setChanged
public void setChanged(boolean ibChanged) -
importOption
public OptionModelInterface importOption(org.jdom2.Document doc) throws M2MException, RemoteException Description copied from interface:OptionModelInterfaceImport 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.- Specified by:
importOptionin interfaceOptionModelInterface- 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
-
removeOption
Description copied from interface:OptionModelInterfaceRemove the option with this key from the option model.- Specified by:
removeOptionin interfaceOptionModelInterface- Parameters:
iKey- key of option- Throws:
M2MExceptionRemoteException
-
getName
Description copied from interface:OptionModelInterfaceGet name for existing option in this option model or in any imported option model.- Specified by:
getNamein interfaceOptionModelInterface- Parameters:
iKey- string key of option- Returns:
- option name
- Throws:
M2MExceptionRemoteException
-
setInternal
Description copied from interface:OptionModelInterfaceSet the option with the given key to be internal- Specified by:
setInternalin interfaceOptionModelInterface- Parameters:
iKey- key of optionbInternal- true means internal. An option already set to internal cannot be set external again.- Throws:
M2MExceptionRemoteException
-
setDescription
Description copied from interface:OptionModelInterfaceSet the description of the option with the given key.- Specified by:
setDescriptionin interfaceOptionModelInterface- Parameters:
iKey- key of optionsDescription- new description- Throws:
M2MExceptionRemoteException
-
toString
-