Class BaseNodeItemContainer<I extends io.github.mmm.code.api.item.CodeItem>
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<I>
- Type Parameters:
I- the type of the containedCodeItem.
- All Implemented Interfaces:
io.github.mmm.code.api.CodeWithContext, io.github.mmm.code.api.item.CodeItem, io.github.mmm.code.api.item.CodeMutableItem, io.github.mmm.code.api.node.CodeNode, io.github.mmm.code.api.node.CodeNodeContainer<I>, io.github.mmm.code.api.node.CodeNodeItem, io.github.mmm.code.api.node.CodeNodeItemContainer<I>, io.github.mmm.code.api.object.CodeMutable, Iterable<I>
- Direct Known Subclasses:
BaseMembers, BaseNodeItemContainerFlat, BaseNodeItemContainerHierarchical, BaseNodeItemContainerWithName
public abstract class BaseNodeItemContainer<I extends io.github.mmm.code.api.item.CodeItem>
extends BaseNodeItem
implements io.github.mmm.code.api.node.CodeNodeItemContainer<I>
Base implementation of
CodeNodeItemContainer.- 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
ConstructorsModifierConstructorDescriptionprotectedThe constructor.BaseNodeItemContainer(BaseNodeItemContainer<I> template, io.github.mmm.code.api.copy.CodeCopyMapper mapper) The copy-constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidaddInternal(I item) voidclear()protected voidCalled on the first call ofBaseMutableItem.setImmutable().protected IensureParent(I item) protected Iprotected io.github.mmm.code.api.copy.CodeCopyTypeprotected StringgetList()getMap()protected booleanprotected booleanisNamed()protected booleanbooleanprotected voidMethods inherited from class BaseNodeItem
doInitialize, getContainerItem, getContainerItemDeclared, getContext, getLanguage, getSource, toPathStringMethods inherited from class BaseMutableItem
doCopyNode, doCopyNodeUnsafe, doMapList, doneInitialize, getDefaultCopyMapper, getDefaultEncoding, getReflectiveObject, getSourceCodeObject, initialize, initialize, isImmutable, isInitialized, isInitializing, isSystemImmutable, makeImmutable, makeImmutable, setImmutable, setImmutableIfNotSystemImmutable, verifyMutalbe, writeItemMethods inherited from class BaseItem
doWrite, 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
isEmpty, iteratorMethods inherited from interface io.github.mmm.code.api.node.CodeNodeItemContainer
copy, copy, getParentMethods inherited from interface io.github.mmm.code.api.CodeWithContext
getContext, getSourceMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
BaseNodeItemContainer
protected BaseNodeItemContainer()The constructor. -
BaseNodeItemContainer
public BaseNodeItemContainer(BaseNodeItemContainer<I> template, io.github.mmm.code.api.copy.CodeCopyMapper mapper) The copy-constructor.- Parameters:
template- theBaseNodeItemContainerto copy.mapper- theCodeCopyMapper.
-
-
Method Details
-
getItemCopyType
protected io.github.mmm.code.api.copy.CodeCopyType getItemCopyType()- Returns:
- the
CodeCopyTypefor the items in this container.
-
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
-
isSystemImmutable
protected boolean isSystemImmutable()- Overrides:
isSystemImmutablein classBaseMutableItem- Returns:
trueif this is a system internal node item that is considered to beimmutablebut is technicallyset to immutableduring (lazy)initialization. Otherwisefalse.
-
isKeepListView
-
isNamed
protected boolean isNamed()- Returns:
trueif this is a named container that requires amap,falseotherwise.
-
getDeclared
-
getList
-
getMap
-
clear
-
rename
-
getByName
-
add
- Parameters:
item- the item to add.
-
ensureParent
-
addInternal
- Parameters:
item- the item to add.
-
getKey
-
remove
-