Interface CodeAnnotation
- All Superinterfaces:
CodeItem, CodeItemWithComment, CodeItemWithType, CodeMutable, CodeMutableItem, CodeMutableItemWithComment, CodeMutableItemWithType, CodeNode, CodeNodeItem, CodeNodeItemCopyable<CodeAnnotations, CodeAnnotation>, CodeWithContext
public interface CodeAnnotation
extends CodeMutableItemWithType, CodeMutableItemWithComment, CodeNodeItemCopyable<CodeAnnotations, CodeAnnotation>
CodeMutableItemWithType that represents an Annotation instance.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringTheStringused as prefix for an annotation.static final charThe character used as prefix for an annotation.Fields inherited from interface CodeItem
DEFAULT_INDENT, DEFAULT_NEWLINE -
Method Summary
Methods inherited from interface CodeItem
getLanguage, getSourceCode, write, write, write, write, write, writeMethods inherited from interface CodeItemWithComment
getCommentMethods inherited from interface CodeItemWithType
getTypeMethods inherited from interface CodeMutable
isImmutable, isMutableMethods inherited from interface CodeMutableItem
setImmutableMethods inherited from interface CodeMutableItemWithComment
setCommentMethods inherited from interface CodeMutableItemWithType
setTypeMethods inherited from interface CodeWithContext
getContext, getSource
-
Field Details
-
PREFIX_CHAR
static final char PREFIX_CHARThe character used as prefix for an annotation.- See Also:
-
PREFIX
-
-
Method Details
-
getParameters
Map<String, CodeExpression> getParameters()- Returns:
- the
Mapwith the parameters of this annotation. May beemptybut is nevernull. TheCodeExpressions are most likely aCodeConstant.
-
getReflectiveObject
Annotation getReflectiveObject()- 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.
-
getParent
CodeAnnotations getParent()- Specified by:
getParentin interfaceCodeNode- Specified by:
getParentin interfaceCodeNodeItemCopyable<CodeAnnotations, CodeAnnotation>- Returns:
- the parent of this
CodeNode. May only benullfor instances ofCodeContext.
-
copy
CodeAnnotation copy()- Specified by:
copyin interfaceCodeMutableItem- Specified by:
copyin interfaceCodeNodeItem- Specified by:
copyin interfaceCodeNodeItemCopyable<CodeAnnotations, CodeAnnotation>- Returns:
- a new
mutablecopy of thisCodeMutableItem. Will be a deep-copy with copies of all childCodeMutableItems.
-
copy
- Specified by:
copyin interfaceCodeMutableItem- Specified by:
copyin interfaceCodeNodeItem- Specified by:
copyin interfaceCodeNodeItemCopyable<CodeAnnotations, CodeAnnotation>- Parameters:
mapper- theCodeCopyMapperused to map involved nodes during copy.- Returns:
- a
CodeMutableItem.copy()with the related objects mapped using the givenCodeCopyMapper.
-