Interface CodeProperty
- All Superinterfaces:
CodeElement, CodeElementWithDeclaringType, CodeElementWithModifiers, CodeElementWithName, CodeItem, CodeItemWithComment, CodeItemWithDeclaringType, CodeItemWithModifiers, CodeItemWithName, CodeItemWithType, CodeMember, CodeMutable, CodeMutableItem, CodeMutableItemWithComment, CodeMutableItemWithType, CodeNode, CodeNodeItem, CodeNodeItemCopyable<CodeProperties, CodeProperty>, CodeWithContext
public interface CodeProperty
extends CodeMember, CodeMutableItemWithType, CodeNodeItemCopyable<CodeProperties, CodeProperty>
Abstract interface 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
Modifier and TypeMethodDescriptioncopy()getField()default booleandefault booleandefault booleandefault booleanbooleanisReadable(CodeVisibility visibility) booleanisWritable(CodeVisibility visibility) default voidsetModifiers(CodeModifiers modifiers) Deprecated.Methods inherited from interface CodeElement
getAnnotations, getDoc, removeFromParentMethods inherited from interface CodeElementWithName
setNameMethods inherited from interface CodeItem
getLanguage, getSourceCode, write, write, write, write, write, writeMethods inherited from interface CodeItemWithComment
getCommentMethods inherited from interface CodeItemWithDeclaringType
getDeclaringTypeMethods inherited from interface CodeItemWithModifiers
getModifiersMethods inherited from interface CodeItemWithName
getNameMethods inherited from interface CodeItemWithType
getTypeMethods inherited from interface CodeMember
getParent, getReflectiveObjectMethods 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 CodeWithContext
getContext, getSource
-
Method Details
-
getField
-
getGetter
CodeMethod getGetter()- Returns:
- the
CodeMethodrepresenting the getter of this property ornullif no such method exists.
-
getSetter
CodeMethod getSetter()- Returns:
- the
CodeMethodrepresenting the setter of this property ornullif no such method exists.
-
isPublicReadable
-
isPrivateReadable
-
isReadable
- Parameters:
visibility- the expectedCodeVisibility.- Returns:
trueif this property is readable throughfieldorgetterwith the givenCodeVisibility,falseotherwise.
-
isPublicWritable
-
isPrivateWritable
-
isWritable
- Parameters:
visibility- the expectedCodeVisibility.- Returns:
trueif this property is writable through non-finalfieldorsetterwith the givenCodeVisibility,falseotherwise.
-
inherit
- Parameters:
declaring- the new potentialCodeItemWithDeclaringType.getDeclaringType().- Returns:
- a new
CodePropertywith itstypebeingresolvedor this property itself if the type could not be resolved any further.
-
setModifiers
Deprecated.themodifiersof aCodePropertyare calculated and cannot be modified.- Specified by:
setModifiersin interfaceCodeElementWithModifiers- Parameters:
modifiers- the newmodifiers.- Throws:
io.github.mmm.base.exception.ReadOnlyException- on every call.
-
copy
CodeProperty 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<CodeProperties, CodeProperty>- Returns:
- a new
mutablecopy of thisCodeMutableItem. Will be a deep-copy with copies of all childCodeMutableItems.
-
modifiersof aCodePropertyare calculated and cannot be modified.