Class BaseField
- All Implemented Interfaces:
io.github.mmm.code.api.CodeWithContext, io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.member.CodeFields, io.github.mmm.code.api.member.CodeField>, io.github.mmm.code.api.element.CodeElement, io.github.mmm.code.api.element.CodeElementWithDeclaringType, io.github.mmm.code.api.element.CodeElementWithModifiers, io.github.mmm.code.api.element.CodeElementWithName, io.github.mmm.code.api.expression.CodeExpression, io.github.mmm.code.api.expression.CodeVariable, io.github.mmm.code.api.item.CodeItem, io.github.mmm.code.api.item.CodeItemWithComment, io.github.mmm.code.api.item.CodeItemWithDeclaration, io.github.mmm.code.api.item.CodeItemWithDeclaringType, io.github.mmm.code.api.item.CodeItemWithModifiers, io.github.mmm.code.api.item.CodeItemWithName, io.github.mmm.code.api.item.CodeItemWithType, io.github.mmm.code.api.item.CodeMutableItem, io.github.mmm.code.api.item.CodeMutableItemWithComment, io.github.mmm.code.api.item.CodeMutableItemWithType, io.github.mmm.code.api.member.CodeField, io.github.mmm.code.api.member.CodeMember, io.github.mmm.code.api.merge.CodeAdvancedMergeableItem<io.github.mmm.code.api.member.CodeField>, io.github.mmm.code.api.merge.CodeMergeableItem<io.github.mmm.code.api.member.CodeField>, io.github.mmm.code.api.node.CodeNode, io.github.mmm.code.api.node.CodeNodeItem, io.github.mmm.code.api.object.CodeMutable
Base implementation of
CodeField.- 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
ConstructorsConstructorDescriptionThe copy-constructor.BaseField(BaseFields parent, Field reflectiveObject) The constructor.BaseField(BaseFields parent, String name) The constructor. -
Method Summary
Modifier and TypeMethodDescriptioncopy()copy(io.github.mmm.code.api.copy.CodeCopyMapper mapper) 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) io.github.mmm.code.api.expression.CodeConstantevaluate()io.github.mmm.code.api.member.CodeMethodio.github.mmm.code.api.expression.CodeExpressionio.github.mmm.code.api.member.CodeMethodio.github.mmm.code.api.member.CodeMethodio.github.mmm.code.api.member.CodeMethodio.github.mmm.code.api.member.CodeFieldio.github.mmm.code.api.type.CodeGenericTypegetType()io.github.mmm.code.api.member.CodeFieldmerge(io.github.mmm.code.api.member.CodeField other, io.github.mmm.code.api.merge.CodeMergeStrategyDecider decider, io.github.mmm.code.api.merge.CodeMergeStrategy parentStrategy) voidsetInitializer(io.github.mmm.code.api.expression.CodeExpression initializer) voidsetType(io.github.mmm.code.api.type.CodeGenericType type) Methods inherited from class BaseMember
getDeclaringType, getName, setNameMethods inherited from class BaseElementWithModifiers
getModifiers, setModifiersMethods inherited from class BaseElement
doMerge, doSetImmutable, doWriteAnnotations, doWriteComment, doWriteDoc, getAnnotations, getComment, getDoc, removeFromParent, setCommentMethods inherited from class BaseNodeItem
getContainerItem, getContainerItemDeclared, getContext, getLanguage, getSource, toPathStringMethods inherited from class BaseMutableItem
doCopyNode, doCopyNodeUnsafe, doMapList, doneInitialize, getDefaultCopyMapper, getDefaultEncoding, initialize, initialize, isImmutable, isInitialized, isInitializing, isSystemImmutable, 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.merge.CodeAdvancedMergeableItem
merge, mergeMethods inherited from interface io.github.mmm.code.api.element.CodeElement
getAnnotations, getDoc, removeFromParentMethods inherited from interface io.github.mmm.code.api.element.CodeElementWithModifiers
setModifiersMethods inherited from interface io.github.mmm.code.api.element.CodeElementWithName
setNameMethods 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.item.CodeItemWithComment
getCommentMethods inherited from interface io.github.mmm.code.api.item.CodeItemWithDeclaration
writeReferenceMethods inherited from interface io.github.mmm.code.api.item.CodeItemWithDeclaringType
getDeclaringTypeMethods inherited from interface io.github.mmm.code.api.item.CodeItemWithModifiers
getModifiersMethods inherited from interface io.github.mmm.code.api.item.CodeItemWithName
getNameMethods inherited from interface io.github.mmm.code.api.object.CodeMutable
isImmutable, isMutableMethods inherited from interface io.github.mmm.code.api.item.CodeMutableItem
setImmutableMethods inherited from interface io.github.mmm.code.api.item.CodeMutableItemWithComment
setCommentMethods inherited from interface io.github.mmm.code.api.expression.CodeVariable
writeReferenceMethods inherited from interface io.github.mmm.code.api.CodeWithContext
getContext, getSource
-
Constructor Details
-
BaseField
The constructor. -
BaseField
The constructor.- Parameters:
parent- theparent.reflectiveObject- thereflective object. May benull.
-
BaseField
-
-
Method Details
-
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 classBaseElement
-
getParent
- Specified by:
getParentin interfaceio.github.mmm.code.api.member.CodeMember- Specified by:
getParentin interfaceio.github.mmm.code.api.node.CodeNode- Specified by:
getParentin interfaceio.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.member.CodeFields, io.github.mmm.code.api.member.CodeField>- Specified by:
getParentin classBaseMember
-
getType
public io.github.mmm.code.api.type.CodeGenericType getType()- Specified by:
getTypein interfaceio.github.mmm.code.api.item.CodeItemWithType
-
setType
public void setType(io.github.mmm.code.api.type.CodeGenericType type) - Specified by:
setTypein interfaceio.github.mmm.code.api.item.CodeMutableItemWithType
-
getInitializer
public io.github.mmm.code.api.expression.CodeExpression getInitializer()- Specified by:
getInitializerin interfaceio.github.mmm.code.api.member.CodeField
-
setInitializer
public void setInitializer(io.github.mmm.code.api.expression.CodeExpression initializer) - Specified by:
setInitializerin interfaceio.github.mmm.code.api.member.CodeField
-
evaluate
public io.github.mmm.code.api.expression.CodeConstant evaluate()- Specified by:
evaluatein interfaceio.github.mmm.code.api.expression.CodeExpression
-
getReflectiveObject
- Specified by:
getReflectiveObjectin interfaceio.github.mmm.code.api.member.CodeField- Specified by:
getReflectiveObjectin interfaceio.github.mmm.code.api.member.CodeMember- Specified by:
getReflectiveObjectin interfaceio.github.mmm.code.api.item.CodeMutableItem- Specified by:
getReflectiveObjectin classBaseMember
-
getSourceCodeObject
public io.github.mmm.code.api.member.CodeField getSourceCodeObject()- Specified by:
getSourceCodeObjectin classBaseMember- 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.member.CodeField merge(io.github.mmm.code.api.member.CodeField other, io.github.mmm.code.api.merge.CodeMergeStrategyDecider decider, io.github.mmm.code.api.merge.CodeMergeStrategy parentStrategy) - Specified by:
mergein interfaceio.github.mmm.code.api.merge.CodeAdvancedMergeableItem<io.github.mmm.code.api.member.CodeField>
-
copy
- Specified by:
copyin interfaceio.github.mmm.code.api.element.CodeElement- Specified by:
copyin interfaceio.github.mmm.code.api.element.CodeElementWithDeclaringType- Specified by:
copyin interfaceio.github.mmm.code.api.element.CodeElementWithModifiers- Specified by:
copyin interfaceio.github.mmm.code.api.element.CodeElementWithName- Specified by:
copyin interfaceio.github.mmm.code.api.member.CodeField- Specified by:
copyin interfaceio.github.mmm.code.api.member.CodeMember- 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.copy.CodeNodeItemCopyable<io.github.mmm.code.api.member.CodeFields, io.github.mmm.code.api.member.CodeField>- Specified by:
copyin classBaseMember
-
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.copy.CodeNodeItemCopyable<io.github.mmm.code.api.member.CodeFields, io.github.mmm.code.api.member.CodeField>
-
getGetter
public io.github.mmm.code.api.member.CodeMethod getGetter()- Specified by:
getGetterin interfaceio.github.mmm.code.api.member.CodeField
-
getOrCreateGetter
public io.github.mmm.code.api.member.CodeMethod getOrCreateGetter()- Specified by:
getOrCreateGetterin interfaceio.github.mmm.code.api.member.CodeField
-
getSetter
public io.github.mmm.code.api.member.CodeMethod getSetter()- Specified by:
getSetterin interfaceio.github.mmm.code.api.member.CodeField
-
getOrCreateSetter
public io.github.mmm.code.api.member.CodeMethod getOrCreateSetter()- Specified by:
getOrCreateSetterin interfaceio.github.mmm.code.api.member.CodeField
-
doWrite
protected void doWrite(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) throws IOException - Overrides:
doWritein classBaseElement- 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:
-