Class BaseAnnotations
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.node.BaseNodeItemContainer<io.github.mmm.code.api.annotation.CodeAnnotation>
io.github.mmm.code.base.node.BaseNodeItemContainerHierarchical<io.github.mmm.code.api.annotation.CodeAnnotation>
io.github.mmm.code.base.annoation.BaseAnnotations
- All Implemented Interfaces:
io.github.mmm.code.api.annotation.CodeAnnotations, io.github.mmm.code.api.CodeWithContext, io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.element.CodeElement, io.github.mmm.code.api.annotation.CodeAnnotations>, io.github.mmm.code.api.item.CodeItem, io.github.mmm.code.api.item.CodeMutableItem, io.github.mmm.code.api.merge.CodeMergeableItem<io.github.mmm.code.api.annotation.CodeAnnotations>, io.github.mmm.code.api.merge.CodeSimpleMergeableItem<io.github.mmm.code.api.annotation.CodeAnnotations>, io.github.mmm.code.api.node.CodeNode, io.github.mmm.code.api.node.CodeNodeContainer<io.github.mmm.code.api.annotation.CodeAnnotation>, io.github.mmm.code.api.node.CodeNodeItem, io.github.mmm.code.api.node.CodeNodeItemContainer<io.github.mmm.code.api.annotation.CodeAnnotation>, io.github.mmm.code.api.node.CodeNodeItemContainerHierarchical<io.github.mmm.code.api.annotation.CodeAnnotation>, io.github.mmm.code.api.object.CodeMutable, Iterable<io.github.mmm.code.api.annotation.CodeAnnotation>
public class BaseAnnotations
extends BaseNodeItemContainerHierarchical<io.github.mmm.code.api.annotation.CodeAnnotation>
implements io.github.mmm.code.api.annotation.CodeAnnotations
Base implementation of
CodeAnnotations.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
Field Summary
Fields inherited from interface io.github.mmm.code.api.item.CodeItem
DEFAULT_INDENT, DEFAULT_NEWLINE -
Constructor Summary
ConstructorsConstructorDescriptionBaseAnnotations(BaseAnnotations template, io.github.mmm.code.api.copy.CodeCopyMapper mapper) The copy-constructor.BaseAnnotations(BaseElement parent) The constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(io.github.mmm.code.api.annotation.CodeAnnotation item) io.github.mmm.code.api.annotation.CodeAnnotationadd(io.github.mmm.code.api.type.CodeType type) copy()copy(io.github.mmm.code.api.copy.CodeCopyMapper mapper) protected BaseAnnotationcreateAnnoation(io.github.mmm.code.api.type.CodeType type) protected voidCalled fromBaseMutableItem.initialize()on first invocation.protected voiddoWrite(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) protected io.github.mmm.code.api.annotation.CodeAnnotationensureParent(io.github.mmm.code.api.annotation.CodeAnnotation item) Iterable<? extends io.github.mmm.code.api.annotation.CodeAnnotation> getAll()io.github.mmm.code.api.annotation.CodeAnnotationgetDeclared(io.github.mmm.code.api.type.CodeType type) io.github.mmm.code.api.annotation.CodeAnnotationgetDeclaredOrAdd(io.github.mmm.code.api.type.CodeType type) io.github.mmm.code.api.annotation.CodeAnnotationsprotected booleanio.github.mmm.code.api.annotation.CodeAnnotationsmerge(io.github.mmm.code.api.annotation.CodeAnnotations other, io.github.mmm.code.api.merge.CodeMergeStrategy strategy) Methods inherited from class BaseNodeItemContainer
addInternal, clear, doSetImmutable, getByName, getDeclared, getItemCopyType, getKey, getList, getMap, isKeepListView, isNamed, remove, renameMethods inherited from class BaseNodeItem
getContainerItem, getContainerItemDeclared, getContext, getLanguage, getSource, toPathStringMethods inherited from class BaseMutableItem
doCopyNode, doCopyNodeUnsafe, doMapList, doneInitialize, getDefaultCopyMapper, getDefaultEncoding, getReflectiveObject, initialize, initialize, isImmutable, isInitialized, isInitializing, 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
getReflectiveObject, setImmutableMethods inherited from interface io.github.mmm.code.api.node.CodeNodeContainer
getDeclared, isEmpty, iteratorMethods inherited from interface io.github.mmm.code.api.node.CodeNodeItemContainer
removeMethods inherited from interface io.github.mmm.code.api.merge.CodeSimpleMergeableItem
mergeMethods inherited from interface io.github.mmm.code.api.CodeWithContext
getContext, getSourceMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
BaseAnnotations
-
BaseAnnotations
The copy-constructor.- Parameters:
template- theBaseAnnotationsto copy.mapper- theCodeCopyMapper.
-
-
Method Details
-
getParent
- Specified by:
getParentin interfaceio.github.mmm.code.api.annotation.CodeAnnotations- Specified by:
getParentin interfaceio.github.mmm.code.api.node.CodeNode- Specified by:
getParentin interfaceio.github.mmm.code.api.node.CodeNodeItemContainer<io.github.mmm.code.api.annotation.CodeAnnotation>- Specified by:
getParentin interfaceio.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.element.CodeElement, io.github.mmm.code.api.annotation.CodeAnnotations>
-
ensureParent
protected io.github.mmm.code.api.annotation.CodeAnnotation ensureParent(io.github.mmm.code.api.annotation.CodeAnnotation item) - Overrides:
ensureParentin classBaseNodeItemContainer<io.github.mmm.code.api.annotation.CodeAnnotation>- Parameters:
item- the item toadd.- Returns:
- the item itself or a
copywith this container as parent.
-
isSystemImmutable
protected boolean isSystemImmutable()- Overrides:
isSystemImmutablein classBaseNodeItemContainer<io.github.mmm.code.api.annotation.CodeAnnotation>- Returns:
trueif this is a system internal node item that is considered to beimmutablebut is technicallyset to immutableduring (lazy)initialization. Otherwisefalse.
-
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
-
getDeclared
public io.github.mmm.code.api.annotation.CodeAnnotation getDeclared(io.github.mmm.code.api.type.CodeType type) - Specified by:
getDeclaredin interfaceio.github.mmm.code.api.annotation.CodeAnnotations
-
add
public io.github.mmm.code.api.annotation.CodeAnnotation add(io.github.mmm.code.api.type.CodeType type) - Specified by:
addin interfaceio.github.mmm.code.api.annotation.CodeAnnotations
-
createAnnoation
- Parameters:
type- thetypeof theBaseAnnotationto create.- Returns:
- the new
BaseAnnotationinstance.
-
add
public void add(io.github.mmm.code.api.annotation.CodeAnnotation item) - Specified by:
addin interfaceio.github.mmm.code.api.annotation.CodeAnnotations- Overrides:
addin classBaseNodeItemContainer<io.github.mmm.code.api.annotation.CodeAnnotation>- Parameters:
item- the item to add.
-
getDeclaredOrAdd
public io.github.mmm.code.api.annotation.CodeAnnotation getDeclaredOrAdd(io.github.mmm.code.api.type.CodeType type) - Specified by:
getDeclaredOrAddin interfaceio.github.mmm.code.api.annotation.CodeAnnotations
-
getAll
- Specified by:
getAllin interfaceio.github.mmm.code.api.annotation.CodeAnnotations- Specified by:
getAllin interfaceio.github.mmm.code.api.node.CodeNodeItemContainerHierarchical<io.github.mmm.code.api.annotation.CodeAnnotation>
-
getSourceCodeObject
public io.github.mmm.code.api.annotation.CodeAnnotations getSourceCodeObject()- Overrides:
getSourceCodeObjectin classBaseMutableItem- Returns:
- the optional internal
CodeItemrepresenting the source-code (to merge). Otherwisenull. This is an internal API. Do not use or rely on it from outside.
-
merge
public io.github.mmm.code.api.annotation.CodeAnnotations merge(io.github.mmm.code.api.annotation.CodeAnnotations other, io.github.mmm.code.api.merge.CodeMergeStrategy strategy) - Specified by:
mergein interfaceio.github.mmm.code.api.merge.CodeSimpleMergeableItem<io.github.mmm.code.api.annotation.CodeAnnotations>
-
copy
- Specified by:
copyin interfaceio.github.mmm.code.api.annotation.CodeAnnotations- 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.node.CodeNodeItemContainer<io.github.mmm.code.api.annotation.CodeAnnotation>- Specified by:
copyin interfaceio.github.mmm.code.api.node.CodeNodeItemContainerHierarchical<io.github.mmm.code.api.annotation.CodeAnnotation>- Specified by:
copyin interfaceio.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.element.CodeElement, io.github.mmm.code.api.annotation.CodeAnnotations>
-
copy
- 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.node.CodeNodeItemContainer<io.github.mmm.code.api.annotation.CodeAnnotation>- Specified by:
copyin interfaceio.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.element.CodeElement, io.github.mmm.code.api.annotation.CodeAnnotations>
-
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:
-