Interface CodeField
- All Superinterfaces:
CodeAdvancedMergeableItem<CodeField>, CodeElement, CodeElementWithDeclaringType, CodeElementWithModifiers, CodeElementWithName, CodeExpression, CodeItem, CodeItemWithComment, CodeItemWithDeclaration, CodeItemWithDeclaringType, CodeItemWithModifiers, CodeItemWithName, CodeItemWithType, CodeMember, CodeMergeableItem<CodeField>, CodeMutable, CodeMutableItem, CodeMutableItemWithComment, CodeMutableItemWithType, CodeNode, CodeNodeItem, CodeNodeItemCopyable<CodeFields, CodeField>, CodeVariable, CodeWithContext
public interface CodeField
extends CodeMember, CodeMutableItemWithType, CodeVariable, CodeAdvancedMergeableItem<CodeField>, CodeNodeItemCopyable<CodeFields, CodeField>
CodeMember for a field of a CodeType.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
- See Also:
-
Field Summary
Fields inherited from interface CodeItem
DEFAULT_INDENT, DEFAULT_NEWLINE -
Method Summary
Methods inherited from interface CodeAdvancedMergeableItem
merge, merge, mergeMethods inherited from interface CodeElement
getAnnotations, getDoc, removeFromParentMethods inherited from interface CodeElementWithModifiers
setModifiersMethods inherited from interface CodeElementWithName
setNameMethods inherited from interface CodeExpression
evaluateMethods inherited from interface CodeItem
getLanguage, getSourceCode, write, write, write, write, write, writeMethods inherited from interface CodeItemWithComment
getCommentMethods inherited from interface CodeItemWithDeclaration
writeReferenceMethods inherited from interface CodeItemWithDeclaringType
getDeclaringTypeMethods inherited from interface CodeItemWithModifiers
getModifiersMethods inherited from interface CodeItemWithName
getNameMethods inherited from interface CodeItemWithType
getTypeMethods inherited from interface CodeMember
getParentMethods inherited from interface CodeMutable
isImmutable, isMutableMethods inherited from interface CodeMutableItem
setImmutableMethods inherited from interface CodeMutableItemWithComment
setCommentMethods inherited from interface CodeMutableItemWithType
setTypeMethods inherited from interface CodeNodeItemCopyable
copy, getParentMethods inherited from interface CodeVariable
writeReferenceMethods inherited from interface CodeWithContext
getContext, getSource
-
Method Details
-
getInitializer
CodeExpression getInitializer()- Returns:
- the
CodeExpressionassigned to this field on initialization ornullfor none.
-
setInitializer
- Parameters:
initializer- the newinitializer.- Throws:
io.github.mmm.base.exception.ReadOnlyException- ifimmutable.
-
getReflectiveObject
Field getReflectiveObject()- Specified by:
getReflectiveObjectin interfaceCodeMember- Specified by:
getReflectiveObjectin interfaceCodeMutableItem- Returns:
- the optional reflective object of this item such as
Class. May benull(e.g. if this object was created from source-code only or has been created dynamically). However, if available it can be helpful for analysis especially in case of type-safeAnnotationprocessing. In most cases the generic type will be derived fromAnnotatedElementbut in specific cases it can also beProtectionDomainor other types that have no common parent-type. Therefore this generic type is unbounded here. - See Also:
-
getGetter
CodeMethod getGetter()- Returns:
- the
CodeMethodthat acts as getter to read this field ornullif there is no such method.
-
getOrCreateGetter
CodeMethod getOrCreateGetter()- Returns:
- the
CodeMethodthat acts as getter to read this field. If it does not yet exist, it will be created.
-
getSetter
CodeMethod getSetter()- Returns:
- the
CodeMethodthat acts as setter to write this field ornullif there is no such method.
-
getOrCreateSetter
CodeMethod getOrCreateSetter()- Returns:
- the
CodeMethodthat acts as setter to write this field. If it does not yet exist, it will be created.
-
copy
CodeField copy()- Specified by:
copyin interfaceCodeElement- Specified by:
copyin interfaceCodeElementWithDeclaringType- Specified by:
copyin interfaceCodeElementWithModifiers- Specified by:
copyin interfaceCodeElementWithName- Specified by:
copyin interfaceCodeMember- Specified by:
copyin interfaceCodeMutableItem- Specified by:
copyin interfaceCodeNodeItem- Specified by:
copyin interfaceCodeNodeItemCopyable<CodeFields, CodeField>- Returns:
- a new
mutablecopy of thisCodeMutableItem. Will be a deep-copy with copies of all childCodeMutableItems.
-