Interface CodeDoc
- All Superinterfaces:
CodeItem, CodeMergeableItem<CodeDoc>, CodeMutable, CodeMutableItem, CodeNode, CodeNodeItem, CodeNodeItemCopyable<CodeElement, CodeDoc>, CodeSimpleMergeableItem<CodeDoc>, CodeWithContext
public interface CodeDoc
extends CodeSimpleMergeableItem<CodeDoc>, CodeNodeItemCopyable<CodeElement, CodeDoc>
CodeItem representing API documentation (e.g. JavaDoc or JSDoc). Please read documentation of
getLines() before using.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]Emptylines.static final StringDoc tagfor a code format.static final StringDoc tagfor a link.static final StringDoc tagfor a plain link.static final StringDoc tagfor an un-escaped literal.static final StringTag for the documentation of the parameter of a function.static final StringTag for the documentation of returned result of a function.static final StringTag for the documentation of an exception.static final StringDoc tagfor a value reference.Fields inherited from interface CodeItem
DEFAULT_INDENT, DEFAULT_NEWLINE -
Method Summary
Modifier and TypeMethodDescriptionvoidPlease read documentation ofgetLines()before using.voidadd(Collection<String> lines) Please read documentation ofgetLines()before using.default StringgetFormatted(CodeDocFormat format) getFormatted(CodeDocFormat format, String newline) getLines()Attention: Child elements such asCodeParameters,CodeExceptions,CodeReturn, andCodeTypeVariables hold their specificCodeDocthat is not included in theCodeDocof their parentCodeOperationorCodeType.default String[]booleanisEmpty()Methods inherited from interface CodeItem
getLanguage, getSourceCode, write, write, write, write, write, writeMethods inherited from interface CodeMutable
isImmutable, isMutableMethods inherited from interface CodeMutableItem
getReflectiveObject, setImmutableMethods inherited from interface CodeNodeItemCopyable
copy, copy, getParentMethods inherited from interface CodeSimpleMergeableItem
merge, mergeMethods inherited from interface CodeWithContext
getContext, getSource
-
Field Details
-
TAG_PARAM
Tag for the documentation of the parameter of a function. This tag will be invisible via this API as the according doc is accessed via the accordingCodeParameter.- See Also:
-
TAG_THROWS
Tag for the documentation of an exception. This tag will be invisible via this API as the according doc is accessed via the accordingCodeException.- See Also:
-
TAG_RETURN
Tag for the documentation of returned result of a function. This tag will be invisible via this API as the according doc is accessed via the accordingCodeReturn.- See Also:
-
TAG_LINK
-
TAG_LINKPLAIN
-
TAG_CODE
-
TAG_LITERAL
-
TAG_VALUE
-
NO_LINES
-
-
Method Details
-
getFormatted
- Parameters:
format- the requestedCodeDocFormat.- Returns:
- this documentation as
Stringin the givenCodeDocFormat. Will be theemptyStringif not available and therefore nevernull.
-
getFormatted
- Parameters:
format- the requestedCodeDocFormat.newline- the newlineString.- Returns:
- this documentation as
Stringin the givenCodeDocFormat. Will be theemptyStringif not available and therefore nevernull.
-
getLines
Attention: Child elements such asCodeParameters,CodeExceptions,CodeReturn, andCodeTypeVariables hold their specificCodeDocthat is not included in theCodeDocof their parentCodeOperationorCodeType. Therefore you shall not see oraddany lines with tags such as "@param", "@throws", or "@return". These will only be produced on-the-fly when thesource-codeis produced.- Returns:
- the
Listwith the raw lines of documentation without leading format prefix ("/**", "*", "/*").
-
getLinesAsArray
- Returns:
- the
documentation linesas array. - See Also:
-
add
Please read documentation ofgetLines()before using.- Parameters:
lines- the textual documentation lines to add togetLines().- Throws:
io.github.mmm.base.exception.ReadOnlyException- ifimmutable.
-
add
Please read documentation ofgetLines()before using.- Parameters:
lines- the textual documentation lines to add togetLines().- Throws:
io.github.mmm.base.exception.ReadOnlyException- ifimmutable.
-
isEmpty
boolean isEmpty()- Returns:
trueif this documentation is empty.
-