Package org.eclipse.birt.report.model.api

# Class ModuleOption

java.lang.Object
org.eclipse.birt.report.model.api.ModuleOption

All Implemented Interfaces:
  `IModuleOption`

public class ModuleOption extends Object implements IModuleOption
Provide the way to do some setting about the module.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected Map<String,Object>`
`options`
Maps to store the key/value pairs.

### Fields inherited from interface org.eclipse.birt.report.model.api.IModuleOption

`BLANK_CREATION_KEY, CREATED_BY_KEY, LOCALE_KEY, MARK_LINE_NUMBER_KEY, PARSER_SEMANTIC_CHECK_KEY, READ_ONLY_MODULE_PROPERTIES, RESOURCE_FOLDER_KEY, RESOURCE_LOCATOR_KEY, SUPPORTED_UNKNOWN_VERSION_KEY, TO_LATEST_VERSION`

## Constructor Summary

Constructors
Constructor
Description
`ModuleOption()`
Default constructor.
`ModuleOption(Map options)`
Constructs the module options with mapping of the option settings.

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
Clears all options for non-primitive values.
`Object`
`copy()`
Returns the copy of the current options.
`com.ibm.icu.util.ULocale`
`getLocale()`
Gets the locale.
`Map`
`getOptions()`
Returns a read-only map for all options.
`Object`
`getProperty(String key)`
Gets the value in this setting.
`String`
`getResourceFolder()`
Gets the resource folder.
`IResourceLocator`
`getResourceLocator()`
Gets the resource locator.
`boolean`
`isSupportedUnknownVersion()`
return whether support unknown version
`boolean`
`markLineNumber()`
Determines whether to mark line number of element when opening/saving a module.
`void`
`setLocale(com.ibm.icu.util.ULocale locale)`
Sets the locale.
`void`
`setMarkLineNumber(boolean markLineNumber)`
Sets the marking line number control status.
`void`
`setOptions(Map options)`
`void`
`setProperty(String key, Object value)`
Sets an option of this setting.
`void`
`setResourceFolder(String resourceFolder)`
Sets the resource folder
`void`
`setResourceLocator(IResourceLocator locator)`
Sets the resource locator.
`void`
`setSemanticCheck(boolean useSemanticCheck)`
Sets the semantic check control status.
`void`
`setSupportedUnknownVersion(boolean isSupportedUnknownVersion)`
set whether support unknown version
`void`
`setToLatestVersion(boolean toSet)`
Sets the flag that is used to update the design to the latest version when creates.
`boolean`
`toLatestVersion()`
Returns the flag that indicates whether the report should be updated to the latest version when creates.
`boolean`
`useSemanticCheck()`
Determines whether to do some semantic checks when opening a module.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### options

protected Map<String,Object> options
Maps to store the key/value pairs.

## Constructor Details

### ModuleOption

public ModuleOption()
Default constructor.

### ModuleOption

public ModuleOption(Map options)
Constructs the module options with mapping of the option settings.

Parameters:
  `options` - the option settings to add

## Method Details

### useSemanticCheck

public boolean useSemanticCheck()
Determines whether to do some semantic checks when opening a module.

Returns:
  true if user wants to do the checks, otherwise false

### setSemanticCheck

public void setSemanticCheck(boolean useSemanticCheck)
Sets the semantic check control status. True if user wants to do the semantic checks when opening a module, otherwise false.

Parameters:
  `useSemanticCheck` - the control status

### getResourceFolder

public String getResourceFolder()
Gets the resource folder.

Returns:
  the resource folder

### setResourceFolder

public void setResourceFolder(String resourceFolder)
Sets the resource folder

Parameters:
  `resourceFolder` - the resource folder to set

### setProperty

public void setProperty(String key, Object value)
Sets an option of this setting.

Parameters:
  `key` - the option key
  `value` - the option value

### getProperty

public Object getProperty(String key)
Gets the value in this setting.

Parameters:
  `key` - the key to search
Returns:
  the value in this setting if found, otherwise `null`

### markLineNumber

public boolean markLineNumber()
Determines whether to mark line number of element when opening/saving a module. Note: if user switch semantic check off, this method will also return false.

Returns:
  true if user wants to mark line number of element and user switch semantic check on, otherwise false

### setMarkLineNumber

public void setMarkLineNumber(boolean markLineNumber)
Sets the marking line number control status. True if user wants to mark the line number of the element in xml source when opening/saving a module, otherwise false.

Parameters:
  `markLineNumber` - the control status

### getResourceLocator

public IResourceLocator getResourceLocator()
Gets the resource locator.

Returns:
  the resource locator

### setResourceLocator

public void setResourceLocator(IResourceLocator locator)
Sets the resource locator.

Parameters:
  `locator` - the resource locator to set

### getLocale

public com.ibm.icu.util.ULocale getLocale()
Gets the locale.

Returns:
  the locale

### setLocale

public void setLocale(com.ibm.icu.util.ULocale locale)
Sets the locale.

Parameters:
  `locale` - the locale

### setToLatestVersion

public void setToLatestVersion(boolean toSet)
Sets the flag that is used to update the design to the latest version when creates.

Parameters:
  `toSet` -

### toLatestVersion

public boolean toLatestVersion()
Returns the flag that indicates whether the report should be updated to the latest version when creates.

Returns:

### copy

public Object copy() throws CloneNotSupportedException
Returns the copy of the current options.

Returns:
  the copy of the current options
Throws:
  `CloneNotSupportedException`

### getOptions

public Map getOptions()
Returns a read-only map for all options.

Returns:
  the options

### setOptions

public void setOptions(Map options)

Parameters:
  `options` -

### close

public void close()
Clears all options for non-primitive values.

Since:
  4.7

### isSupportedUnknownVersion

public boolean isSupportedUnknownVersion()
return whether support unknown version

Returns:

### setSupportedUnknownVersion

public void setSupportedUnknownVersion(boolean isSupportedUnknownVersion)
set whether support unknown version

Parameters:
  `isSupportedUnknownVersion` -