public class MacroDefinition extends Object
Modifier and Type | Field and Description |
---|---|
static int |
INITIAL_SCHEMA_VERSION |
static String |
STORAGE_VERSION_1 |
static String |
STORAGE_VERSION_2 |
Constructor and Description |
---|
MacroDefinition(MacroDefinition macroDefinition)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
static MacroDefinitionBuilder |
builder()
The correct way to construct a new MacroDefinition.
|
static MacroDefinitionBuilder |
builder(String macroName)
The correct way to construct a new MacroDefinition.
|
boolean |
equals(Object o) |
MacroBody |
getBody() |
Streamable |
getBodyStream() |
String |
getBodyText() |
Macro.BodyType |
getBodyType() |
String |
getDefaultParameterValue()
Equivalent to
getParameter(java.lang.String) or getTypedParameter(java.lang.String, java.lang.Class<T>) with "" |
com.atlassian.fugue.Option<MacroId> |
getMacroId()
Deprecated.
since 7.0.1. Use
getMacroIdentifier() |
Optional<MacroId> |
getMacroIdentifier()
Each macro definition is assigned a macroId when the page is stored, this can be used to identify macros within a
page.
|
String |
getName() |
String |
getParameter(String name) |
Map<String,String> |
getParameters() |
int |
getSchemaVersion()
The macro schema is the definition of the parameters and the macro body, an incompatible change of schema will
require an increase in the schema version and a corresponding macro-schema-migration module to migrate from the
old schema to the new schema.
|
Streamable |
getStorageBodyStream() |
String |
getStorageBodyText() |
String |
getStorageVersion() |
Streamable |
getTransformedBodyStream() |
<T> T |
getTypedParameter(String name,
Class<T> type) |
Map<String,Object> |
getTypedParameters() |
boolean |
hasBody() |
int |
hashCode() |
boolean |
isValid() |
String |
macroHash()
The macroHash is used to identify a macro if there is no macroId stored.
|
void |
setBody(MacroBody body) |
void |
setDefaultParameterValue(String defaultParameterValue) |
void |
setMacroId(com.atlassian.fugue.Option<MacroId> macroId)
Deprecated.
since 7.0.1. Use
setMacroIdentifier(MacroId) |
void |
setMacroIdentifier(@Nullable MacroId macroId) |
void |
setName(String name) |
void |
setParameter(String name,
String value) |
void |
setParameters(Map<String,String> parameters) |
void |
setSchemaVersion(int schemaVersion) |
void |
setStorageVersion(String storageVersion) |
void |
setTypedParameter(String name,
Object value) |
void |
setTypedParameters(Map<String,Object> typedParameters) |
String |
toString() |
public static final String STORAGE_VERSION_1
public static final String STORAGE_VERSION_2
public static final int INITIAL_SCHEMA_VERSION
public MacroDefinition(MacroDefinition macroDefinition)
macroDefinition
- copy the state of this macro definition into this new instancepublic static MacroDefinitionBuilder builder()
public static MacroDefinitionBuilder builder(String macroName)
public String getName()
public String getDefaultParameterValue()
getParameter(java.lang.String)
or getTypedParameter(java.lang.String, java.lang.Class<T>)
with ""public String getBodyText()
getStorageBodyStream()
,
getTransformedBodyStream()
,
RequiresFormat
public Streamable getBodyStream()
getStorageBodyStream()
,
getTransformedBodyStream()
,
RequiresFormat
public String getStorageBodyText()
getStorageBodyStream()
public Streamable getStorageBodyStream()
public Streamable getTransformedBodyStream()
public MacroBody getBody()
public Macro.BodyType getBodyType()
public boolean hasBody()
public void setName(String name)
public void setDefaultParameterValue(String defaultParameterValue)
public void setBody(MacroBody body)
public String getStorageVersion()
public void setStorageVersion(String storageVersion)
@Deprecated public com.atlassian.fugue.Option<MacroId> getMacroId()
getMacroIdentifier()
If there is no macroId specified for this macro, it means the page containing this macro has not yet been saved after the macro id changes were committed to Confluence.
public Optional<MacroId> getMacroIdentifier()
If there is no macroId specified for this macro, it means the page containing this macro has not yet been saved after the macro id changes were committed to Confluence.
@Deprecated public void setMacroId(com.atlassian.fugue.Option<MacroId> macroId)
setMacroIdentifier(MacroId)
public void setMacroIdentifier(@Nullable MacroId macroId)
public int getSchemaVersion()
public void setSchemaVersion(int schemaVersion)
public boolean isValid()
public String macroHash()
Copyright © 2003–2020 Atlassian. All rights reserved.