public class Macro extends Object implements Cloneable
An ODS file can contain Basic macros organised in libraries. Each
Macro object corresponds to one module inside a library and holds
the module's name, source language, and source code.
The default language for programmatically-created macros is
"StarBasic", which is what LibreOffice uses for Basic macros.
| Constructor and Description |
|---|
Macro(String name,
String code)
Creates a new macro with StarBasic as the default language.
|
Macro(String name,
String language,
String code)
Creates a new macro with an explicit source language.
|
| Modifier and Type | Method and Description |
|---|---|
Macro |
clone() |
boolean |
equals(Object o) |
String |
getCode()
Returns the macro source code.
|
String |
getLanguage()
Returns the script language (e.g.
|
String |
getName()
Returns the module name.
|
int |
hashCode() |
void |
setCode(String code)
Sets the macro source code.
|
void |
setLanguage(String language)
Sets the script language.
|
void |
setName(String name)
Sets the module name.
|
String |
toString() |
public Macro(String name, String code)
name - Module name (e.g. "Module1"). Must not be null.code - Basic source code. Must not be null.NullPointerException - if name or code is null.public Macro(String name, String language, String code)
name - Module name. Must not be null.language - Script language (e.g. "StarBasic"). Must not be null.code - Source code. Must not be null.NullPointerException - if any argument is null.public String getName()
public void setName(String name)
name - module name, must not be null.public String getLanguage()
"StarBasic").public void setLanguage(String language)
language - script language, must not be null.public String getCode()
public void setCode(String code)
code - source code, must not be null.Copyright © 2026. All rights reserved.