Class BaseProperty
- All Implemented Interfaces:
io.github.mmm.code.api.CodeWithContext, io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.member.CodeProperties, io.github.mmm.code.api.member.CodeProperty>, 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.item.CodeItem, io.github.mmm.code.api.item.CodeItemWithComment, 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.CodeMember, io.github.mmm.code.api.member.CodeProperty, io.github.mmm.code.api.node.CodeNode, io.github.mmm.code.api.node.CodeNodeItem, io.github.mmm.code.api.object.CodeMutable
Base implementation of
CodeProperty.- 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
ConstructorsConstructorDescriptionBaseProperty(BaseProperties parent, String name) The constructor.BaseProperty(BaseProperty template, io.github.mmm.code.api.copy.CodeCopyMapper mapper) The copy-constructor. -
Method Summary
Modifier and TypeMethodDescriptioncopy()copy(io.github.mmm.code.api.copy.CodeCopyMapper mapper) protected voiddoWrite(Appendable sink, String newline, String defaultIndent, String currentIndent, io.github.mmm.code.api.language.CodeLanguage language) io.github.mmm.code.api.member.CodeFieldgetField()io.github.mmm.code.api.member.CodeMethodio.github.mmm.code.api.modifier.CodeModifiersDeprecated.io.github.mmm.code.api.member.CodeMethodDeprecated.aBasePropertyis a virtual object that can never have a source-code object.io.github.mmm.code.api.type.CodeGenericTypegetType()inherit(io.github.mmm.code.api.type.CodeType declaring) booleanisReadable(io.github.mmm.code.api.modifier.CodeVisibility visibility) booleanisWritable(io.github.mmm.code.api.modifier.CodeVisibility visibility) voidsetModifiers(io.github.mmm.code.api.modifier.CodeModifiers modifiers) Deprecated.seeCodeProperty.setModifiers(CodeModifiers).voidsetType(io.github.mmm.code.api.type.CodeGenericType type) Methods inherited from class BaseMember
getDeclaringType, getName, setNameMethods inherited from class BaseElement
doInitialize, 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.element.CodeElement
getAnnotations, getDoc, removeFromParentMethods 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.CodeItemWithDeclaringType
getDeclaringTypeMethods 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.member.CodeProperty
isPrivateReadable, isPrivateWritable, isPublicReadable, isPublicWritableMethods inherited from interface io.github.mmm.code.api.CodeWithContext
getContext, getSource
-
Constructor Details
-
BaseProperty
The constructor. -
BaseProperty
The copy-constructor.- Parameters:
template- theBasePropertyto copy.mapper- theCodeCopyMapper.
-
-
Method Details
-
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.CodeProperties, io.github.mmm.code.api.member.CodeProperty>- Specified by:
getParentin classBaseMember
-
getModifiers
public io.github.mmm.code.api.modifier.CodeModifiers getModifiers()- Specified by:
getModifiersin interfaceio.github.mmm.code.api.item.CodeItemWithModifiers- Overrides:
getModifiersin classBaseElementWithModifiers
-
setModifiers
Deprecated.seeCodeProperty.setModifiers(CodeModifiers).- Specified by:
setModifiersin interfaceio.github.mmm.code.api.element.CodeElementWithModifiers- Specified by:
setModifiersin interfaceio.github.mmm.code.api.member.CodeProperty- Overrides:
setModifiersin classBaseElementWithModifiers
-
getField
public io.github.mmm.code.api.member.CodeField getField()- Specified by:
getFieldin interfaceio.github.mmm.code.api.member.CodeProperty
-
getGetter
public io.github.mmm.code.api.member.CodeMethod getGetter()- Specified by:
getGetterin interfaceio.github.mmm.code.api.member.CodeProperty
-
getSetter
public io.github.mmm.code.api.member.CodeMethod getSetter()- Specified by:
getSetterin interfaceio.github.mmm.code.api.member.CodeProperty
-
getReflectiveObject
Deprecated.aBasePropertyis a virtual object that can never have a reflective object. Use that method ongetField(),getGetter(), orgetSetter()instead.- 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
Deprecated.aBasePropertyis a virtual object that can never have a source-code object. Use that method ongetField(),getGetter(), orgetSetter()instead.- 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.
-
inherit
- Specified by:
inheritin interfaceio.github.mmm.code.api.member.CodeProperty
-
isReadable
public boolean isReadable(io.github.mmm.code.api.modifier.CodeVisibility visibility) - Specified by:
isReadablein interfaceio.github.mmm.code.api.member.CodeProperty
-
isWritable
public boolean isWritable(io.github.mmm.code.api.modifier.CodeVisibility visibility) - Specified by:
isWritablein interfaceio.github.mmm.code.api.member.CodeProperty
-
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
-
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.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.CodeProperties, io.github.mmm.code.api.member.CodeProperty>- Specified by:
copyin interfaceio.github.mmm.code.api.member.CodeProperty- 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.CodeProperties, io.github.mmm.code.api.member.CodeProperty>
-
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:
-
BasePropertyis a virtual object that can never have a reflective object.