Class BaseAnnotation
java.lang.Object
io.github.mmm.code.base.item.BaseItem
io.github.mmm.code.base.item.BaseMutableItem
io.github.mmm.code.base.node.BaseNodeItem
io.github.mmm.code.base.annoation.BaseAnnotation
- All Implemented Interfaces:
io.github.mmm.code.api.annotation.CodeAnnotation, io.github.mmm.code.api.CodeWithContext, io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.annotation.CodeAnnotations, io.github.mmm.code.api.annotation.CodeAnnotation>, io.github.mmm.code.api.item.CodeItem, io.github.mmm.code.api.item.CodeItemWithComment, io.github.mmm.code.api.item.CodeItemWithType, io.github.mmm.code.api.item.CodeMutableItem, io.github.mmm.code.api.item.CodeMutableItemWithComment, io.github.mmm.code.api.item.CodeMutableItemWithType, io.github.mmm.code.api.node.CodeNode, io.github.mmm.code.api.node.CodeNodeItem, io.github.mmm.code.api.object.CodeMutable
public class BaseAnnotation
extends BaseNodeItem
implements io.github.mmm.code.api.annotation.CodeAnnotation
Base implementation of
CodeAnnotation.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
Field Summary
Fields inherited from interface io.github.mmm.code.api.annotation.CodeAnnotation
PREFIX, PREFIX_CHARFields inherited from interface io.github.mmm.code.api.item.CodeItem
DEFAULT_INDENT, DEFAULT_NEWLINE -
Constructor Summary
ConstructorsConstructorDescriptionBaseAnnotation(io.github.mmm.code.api.annotation.CodeAnnotations parent, io.github.mmm.code.api.type.CodeType type) The constructor.BaseAnnotation(io.github.mmm.code.api.annotation.CodeAnnotations parent, Annotation reflectiveObject) The constructor.BaseAnnotation(io.github.mmm.code.api.annotation.CodeAnnotations parent, String typeName, String qualifiedTypeName) The constructor.BaseAnnotation(BaseAnnotation template, io.github.mmm.code.api.copy.CodeCopyMapper mapper) The copy-constructor. -
Method Summary
Modifier and TypeMethodDescriptioncopy()copy(io.github.mmm.code.api.copy.CodeCopyMapper mapper) protected voidCalled fromBaseMutableItem.initialize()on first invocation.protected voidCalled on the first call ofBaseMutableItem.setImmutable().protected voiddoWrite(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) io.github.mmm.code.api.comment.CodeCommentio.github.mmm.code.api.annotation.CodeAnnotationsio.github.mmm.code.api.type.CodeGenericTypegetType()voidsetComment(io.github.mmm.code.api.comment.CodeComment comment) voidsetType(io.github.mmm.code.api.type.CodeGenericType type) Methods inherited from class BaseNodeItem
getContainerItem, getContainerItemDeclared, getContext, getLanguage, getSource, toPathStringMethods inherited from class BaseMutableItem
doCopyNode, doCopyNodeUnsafe, doMapList, doneInitialize, getDefaultCopyMapper, getDefaultEncoding, getSourceCodeObject, initialize, initialize, isImmutable, isInitialized, isInitializing, isSystemImmutable, isSystemImmutable, makeImmutable, makeImmutable, setImmutable, setImmutableIfNotSystemImmutable, verifyMutalbe, writeItemMethods inherited from class BaseItem
getOwningType, getSourceCode, getSpaces, toString, writeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.mmm.code.api.item.CodeItem
getLanguage, getSourceCode, write, write, write, write, write, writeMethods inherited from interface io.github.mmm.code.api.object.CodeMutable
isImmutable, isMutableMethods inherited from interface io.github.mmm.code.api.item.CodeMutableItem
setImmutableMethods inherited from interface io.github.mmm.code.api.CodeWithContext
getContext, getSource
-
Constructor Details
-
BaseAnnotation
public BaseAnnotation(io.github.mmm.code.api.annotation.CodeAnnotations parent, Annotation reflectiveObject) The constructor.- Parameters:
parent- theparent.reflectiveObject- thereflective object.
-
BaseAnnotation
-
BaseAnnotation
-
BaseAnnotation
The copy-constructor.- Parameters:
template- theBaseAnnotationto copy.mapper- theCodeCopyMapper.
-
-
Method Details
-
doInitialize
protected void doInitialize()Description copied from class:BaseNodeItemCalled fromBaseMutableItem.initialize()on first invocation. May be overridden but never be called from anywhere else.- Overrides:
doInitializein classBaseNodeItem
-
doSetImmutable
protected void doSetImmutable()Description copied from class:BaseMutableItemCalled on the first call ofBaseMutableItem.setImmutable(). Has to be overridden to updateCollections, make child items immutable, etc.- Overrides:
doSetImmutablein classBaseMutableItem
-
getParent
public io.github.mmm.code.api.annotation.CodeAnnotations getParent()- Specified by:
getParentin interfaceio.github.mmm.code.api.annotation.CodeAnnotation- Specified by:
getParentin interfaceio.github.mmm.code.api.node.CodeNode- Specified by:
getParentin interfaceio.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.annotation.CodeAnnotations, io.github.mmm.code.api.annotation.CodeAnnotation>
-
getType
public io.github.mmm.code.api.type.CodeGenericType getType()- Specified by:
getTypein interfaceio.github.mmm.code.api.item.CodeItemWithType
-
setType
public void setType(io.github.mmm.code.api.type.CodeGenericType type) - Specified by:
setTypein interfaceio.github.mmm.code.api.item.CodeMutableItemWithType
-
getParameters
-
getComment
public io.github.mmm.code.api.comment.CodeComment getComment()- Specified by:
getCommentin interfaceio.github.mmm.code.api.item.CodeItemWithComment
-
setComment
public void setComment(io.github.mmm.code.api.comment.CodeComment comment) - Specified by:
setCommentin interfaceio.github.mmm.code.api.item.CodeMutableItemWithComment
-
getReflectiveObject
- Specified by:
getReflectiveObjectin interfaceio.github.mmm.code.api.annotation.CodeAnnotation- Specified by:
getReflectiveObjectin interfaceio.github.mmm.code.api.item.CodeMutableItem- Overrides:
getReflectiveObjectin classBaseMutableItem
-
doWrite
protected void doWrite(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) throws IOException - Specified by:
doWritein classBaseItem- Parameters:
sink- theAppendablewhere toappendthe code from thisCodeItem.newline- the newlineString.defaultIndent- theStringused for indentation (e.g. a number of spaces to insert per indent level).currentIndent- the current indent (number of spaces). Initially the empty string (""). Before a recursion thedefaultIndentwill be appended.language- theCodeLanguageto use.- Throws:
IOException- if thrown byAppendable.- See Also:
-
copy
- Specified by:
copyin interfaceio.github.mmm.code.api.annotation.CodeAnnotation- Specified by:
copyin interfaceio.github.mmm.code.api.item.CodeMutableItem- Specified by:
copyin interfaceio.github.mmm.code.api.node.CodeNodeItem- Specified by:
copyin interfaceio.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.annotation.CodeAnnotations, io.github.mmm.code.api.annotation.CodeAnnotation>
-
copy
- Specified by:
copyin interfaceio.github.mmm.code.api.annotation.CodeAnnotation- Specified by:
copyin interfaceio.github.mmm.code.api.item.CodeMutableItem- Specified by:
copyin interfaceio.github.mmm.code.api.node.CodeNodeItem- Specified by:
copyin interfaceio.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.annotation.CodeAnnotations, io.github.mmm.code.api.annotation.CodeAnnotation>
-