Interface CodeNodeItemContainer<I extends CodeItem>
- Type Parameters:
I- the type of the containedCodeItems.
- All Superinterfaces:
CodeItem, CodeMutable, CodeMutableItem, CodeNode, CodeNodeContainer<I>, CodeNodeItem, CodeWithContext, Iterable<I>
- All Known Subinterfaces:
CodeAnnotations, CodeConstructors, CodeExceptions, CodeFields, CodeGenericTypeParameters<P>, CodeImports, CodeMembers<M>, CodeMethods, CodeNestedTypes, CodeNodeItemContainerFlat<I>, CodeNodeItemContainerFlatWithName<I>, CodeNodeItemContainerHierarchical<I>, CodeNodeItemContainerHierarchicalWithName<I>, CodeNodeItemContainerWithName<I>, CodeOperationArgs<A>, CodeOperations<O>, CodeParameters, CodePathElements, CodeProperties, CodeSuperTypes, CodeTypeParameters, CodeTypeVariables
public interface CodeNodeItemContainer<I extends CodeItem>
extends CodeNodeItem, CodeNodeContainer<I>
CodeItem containing CodeItems of a particular type. It groups these items and all the methods to
operate on them. This makes the API more structured as you do not get too much methods for top-level types such as
CodeType. Further it supports reuse and avoids redundant declaration of methods with
their JavaDoc. So instead of Class.getDeclaredMethods() you will do
CodeType.getMethods().getDeclared().- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
Field Summary
Fields inherited from interface CodeItem
DEFAULT_INDENT, DEFAULT_NEWLINE -
Method Summary
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 CodeNodeContainer
getDeclared, isEmpty, iteratorMethods inherited from interface CodeWithContext
getContext, getSourceMethods inherited from interface Iterable
forEach, spliterator
-
Method Details
-
getParent
CodeNodeItem getParent()- Specified by:
getParentin interfaceCodeNode- Returns:
- the parent of this
CodeNode. May only benullfor instances ofCodeContext.
-
remove
- Parameters:
item- the child item to remove.- Returns:
trueif successfully removed (inheritance not supported),falseotherwise.
-
copy
CodeNodeItemContainer<I> copy()- Specified by:
copyin interfaceCodeMutableItem- Specified by:
copyin interfaceCodeNodeItem- Returns:
- a new
mutablecopy of thisCodeMutableItem. Will be a deep-copy with copies of all childCodeMutableItems.
-
copy
- Specified by:
copyin interfaceCodeMutableItem- Specified by:
copyin interfaceCodeNodeItem- Parameters:
mapper- theCodeCopyMapperused to map involved nodes during copy.- Returns:
- a
CodeMutableItem.copy()with the related objects mapped using the givenCodeCopyMapper.
-