Interface StructureMarkup<T>
- Type Parameters:
T
- structure mapped class
- All Known Implementing Classes:
GoArrayType
,GoChanType
,GoFuncData
,GoFuncType
,GoIMethod
,GoInterfaceType
,GoItab
,GoMapType
,GoMethod
,GoModuledata
,GoName
,GoPlainType
,GoPointerType
,GoSlice
,GoSliceType
,GoString
,GoStructType
,GoType
public interface StructureMarkup<T>
Optional interface that structure mapped classes can implement that allows them to control how
their class is marked up.
TODO: possibly refactor these methods to take a StructureContext parameter, which will allow removing the getStructureContext method.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
additionalMarkup
(MarkupSession session) Called to allow the implementor to perform custom markup of itself.default List
<?> Returns a list of items that should be recursively marked up.default String
Returns a string that can be used to place a label on the instance.default String
Returns the name of the instance, typically retrieved from data found inside the instance.default String
Returns the namespace that any labels should be placed in.
-
Method Details
-
getStructureContext
StructureContext<T> getStructureContext() -
getStructureName
Returns the name of the instance, typically retrieved from data found inside the instance.- Returns:
- string name, or null if this instance does not have a name
- Throws:
IOException
- if error getting name
-
getStructureLabel
Returns a string that can be used to place a label on the instance.This default implementation will query the
getStructureName()
method, and if it provides a value, will produce a string that looks like "name___mappingstructname", where "mappingstructname" will be thestructureName
value in the@StructureMapping
annotation.- Returns:
- string to be used as a label, or null if there is not a valid label for the instance
- Throws:
IOException
- if error getting label
-
getStructureNamespace
Returns the namespace that any labels should be placed in.- Returns:
- name of namespace to place the label for this structure mapped type, or null
- Throws:
IOException
- if error generating namespace name
-
additionalMarkup
Called to allow the implementor to perform custom markup of itself.- Parameters:
session
- state and methods to assist marking up the program- Throws:
IOException
- if error during markupCancelledException
- if cancelled
-
getExternalInstancesToMarkup
Returns a list of items that should be recursively marked up.- Returns:
- list of structure mapped object instances that should be marked up
- Throws:
IOException
- if error getting instances
-