Interface CodeMutable
- All Known Subinterfaces:
CodeAnnotation, CodeAnnotations, CodeArrayType, CodeBlock, CodeBlockBody, CodeBlockDoWhile, CodeBlockFor, CodeBlockIf, CodeBlockInitializer, CodeBlockStatement, CodeBlockWhileDo, CodeBlockWithCondition, CodeComposedType, CodeConstructor, CodeConstructors, CodeDoc, CodeElement, CodeElementWithDeclaringType, CodeElementWithModifiers, CodeElementWithName, CodeElementWithTypeVariables, CodeException, CodeExceptions, CodeField, CodeFields, CodeFile, CodeFunction, CodeGenericType, CodeGenericTypeParameters<P>, CodeImports, CodeLambdaExpression, CodeMember, CodeMembers<M>, CodeMethod, CodeMethods, CodeMutableItem, CodeMutableItemWithComment, CodeMutableItemWithQualifiedName, CodeMutableItemWithType, CodeNestedTypes, CodeNodeItem, CodeNodeItemContainer<I>, CodeNodeItemContainerFlat<I>, CodeNodeItemContainerFlatWithName<I>, CodeNodeItemContainerHierarchical<I>, CodeNodeItemContainerHierarchicalWithName<I>, CodeNodeItemContainerWithName<I>, CodeNodeItemCopyable<P,SELF>, CodeNodeItemWithDeclaringMember, CodeOperation, CodeOperationArg, CodeOperationArgs<A>, CodeOperations<O>, CodePackage, CodeParameter, CodeParameterizedType, CodeParameters, CodePathElement, CodePathElements, CodeProperties, CodeProperty, CodeReturn, CodeSource, CodeSuperTypes, CodeType, CodeTypeParameters, CodeTypePlaceholder, CodeTypeVariable, CodeTypeVariables, CodeTypeWildcard
-
Method Summary
Modifier and TypeMethodDescriptionbooleanBy default aCodeNoderetrieved from an existing source (e.g. viaCodeLoader.getType(String)) is immutable.default boolean
-
Method Details
-
isImmutable
boolean isImmutable()By default aCodeNoderetrieved from an existing source (e.g. viaCodeLoader.getType(String)) is immutable. Use an accordingedit()method to get a new mutable copy of the object before you do any changes. A newly createdCodeItemwill however always be mutable. In case aCodeMutableobject is immutable, all setter methods will throw aReadOnlyExceptionand allCollections returned by getters will beunmodifiable.- Returns:
trueif this item itself (not the reflected code) is immutable and can not be edited (setters may be called without getting exceptions),falseotherwise (if mutable).
-
isMutable
default boolean isMutable()- Returns:
trueif mutable (notimmutable)
-