public abstract class Extension extends Object
An extension is not necessarily tied to only one certain point. If all of the need return values are defined it can be used to extend any point. A module can contain many extensions for many different points.
Modifier and Type | Class and Description |
---|---|
static class |
Extension.MEDIA_TYPE
All media types allowed by the module extension system.
|
Modifier and Type | Field and Description |
---|---|
static String |
EXTENSION_ID_SEPARATOR
String separating the pointId and media type in an extension id
|
Constructor and Description |
---|
Extension()
default constructor
|
Modifier and Type | Method and Description |
---|---|
String |
getExtensionId()
Get the extension point id
|
abstract Extension.MEDIA_TYPE |
getMediaType()
Sets the content type of this extension.
|
String |
getModuleId()
Get this extension's module id
|
int |
getOrder()
If multiple extensions are added to the same extension point, set the order
of those extensions by overriding this property.
|
String |
getOverrideContent(String bodyContent)
If this method returns a non-null value then the return value will be used as the default
content for this extension at this extension point
|
Map<String,String> |
getParameterMap()
Get all of the parameters given to this extension point
|
String |
getPointId()
Get the point id
|
void |
initialize(Map<String,String> parameterMap)
Called before being displayed each time
|
void |
setModuleId(String moduleId)
Set the module id of this extension
|
void |
setParameterMap(Map<String,String> parameterMap)
Parameters given at the extension point This method is usually called only during extension
initialization
|
void |
setPointId(String pointId)
Set the point id
|
static String |
toExtensionId(String pointId,
Extension.MEDIA_TYPE mediaType)
Convert the given pointId and mediaType to an extensionId.
|
String |
toString()
Get the string representation of this extension
|
public static final String EXTENSION_ID_SEPARATOR
public void initialize(Map<String,String> parameterMap)
parameterMap
- public String getPointId()
String
Point Idpublic void setPointId(String pointId)
pointId
- public Map<String,String> getParameterMap()
public void setParameterMap(Map<String,String> parameterMap)
parameterMap
- key-value parameter mappublic abstract Extension.MEDIA_TYPE getMediaType()
public String getExtensionId()
String
Extension Idpublic String getOverrideContent(String bodyContent)
public final String getModuleId()
String
Module Idpublic final void setModuleId(String moduleId)
moduleId
- public int getOrder()
public final String toString()
toString
in class Object
Object.toString()
public static final String toExtensionId(String pointId, Extension.MEDIA_TYPE mediaType)
pointId
- mediaType
- Copyright © 2024 OpenMRS Inc.. All rights reserved.