Interface CodeMethod
- All Superinterfaces:
CodeAdvancedMergeableItem<CodeMethod>, CodeElement, CodeElementWithDeclaringType, CodeElementWithModifiers, CodeElementWithName, CodeElementWithTypeVariables, CodeFunction, CodeItem, CodeItemWithComment, CodeItemWithDeclaringType, CodeItemWithModifiers, CodeItemWithName, CodeItemWithType, CodeItemWithVariables, CodeMember, CodeMergeableItem<CodeMethod>, CodeMutable, CodeMutableItem, CodeMutableItemWithComment, CodeNode, CodeNodeItem, CodeNodeItemCopyable<CodeMethods, CodeMethod>, CodeOperation, CodeWithContext
public interface CodeMethod
extends CodeOperation, CodeAdvancedMergeableItem<CodeMethod>, CodeNodeItemCopyable<CodeMethods, CodeMethod>
CodeOperation that represents a method 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()Attention:
This method is expensive as it has to traverse all methods of the entire type hierarchy recursively.default CodeGenericTypegetType()voidsetDefaultValue(CodeExpression defaultValue) 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 CodeElementWithTypeVariables
getTypeParametersMethods inherited from interface CodeFunction
canHaveBody, getBody, setBodyMethods 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 CodeItemWithVariables
getVariableMethods inherited from interface CodeMutable
isImmutable, isMutableMethods inherited from interface CodeMutableItem
setImmutableMethods inherited from interface CodeMutableItemWithComment
setCommentMethods inherited from interface CodeNodeItemCopyable
copy, getParentMethods inherited from interface CodeOperation
getExceptions, getParameters, getParentMethods inherited from interface CodeWithContext
getContext, getSource
-
Method Details
-
getType
- Specified by:
getTypein interfaceCodeItemWithType- Returns:
- the return type of this method.
-
getReturns
CodeReturn getReturns()- Returns:
- the
CodeReturnwith the information about the returned result of this method. Will never benull. In case of a programming language that supports multiple return types a singleCodeReturnwill be returned that reflects a tuple of the actual returned types.
-
getDefaultValue
CodeExpression getDefaultValue()- Returns:
- the default value of this method or
nullfor none. - See Also:
-
setDefaultValue
- Parameters:
defaultValue- the new value ofgetDefaultValue().
-
getParentMethod
CodeMethod getParentMethod()Attention:
This method is expensive as it has to traverse all methods of the entire type hierarchy recursively.- Returns:
- the
CodeMethodinherited from the closestsuper typethat isoverriddenby this method ornullif this method does not override any method. Here closest means thatclass hierarchyis searched first, then the interface hierarchy in left recursive order.
-
getAccessorField
-
getReflectiveObject
Method getReflectiveObject()- Specified by:
getReflectiveObjectin interfaceCodeElementWithTypeVariables- Specified by:
getReflectiveObjectin interfaceCodeMember- Specified by:
getReflectiveObjectin interfaceCodeMutableItem- Specified by:
getReflectiveObjectin interfaceCodeOperation- 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:
-
copy
CodeMethod copy()- Specified by:
copyin interfaceCodeElement- Specified by:
copyin interfaceCodeElementWithDeclaringType- Specified by:
copyin interfaceCodeElementWithModifiers- Specified by:
copyin interfaceCodeElementWithName- Specified by:
copyin interfaceCodeElementWithTypeVariables- Specified by:
copyin interfaceCodeMember- Specified by:
copyin interfaceCodeMutableItem- Specified by:
copyin interfaceCodeNodeItem- Specified by:
copyin interfaceCodeNodeItemCopyable<CodeMethods, CodeMethod>- Specified by:
copyin interfaceCodeOperation- Returns:
- a new
mutablecopy of thisCodeMutableItem. Will be a deep-copy with copies of all childCodeMutableItems.
-