Package com.tngtech.archunit.core.domain
Class JavaMethod
- java.lang.Object
-
- com.tngtech.archunit.core.domain.JavaMember
-
- com.tngtech.archunit.core.domain.JavaCodeUnit
-
- com.tngtech.archunit.core.domain.JavaMethod
-
- All Implemented Interfaces:
CanBeAnnotated
,HasAnnotations
,HasDescriptor
,HasModifiers
,HasName
,HasName.AndFullName
,HasOwner<JavaClass>
,HasParameterTypes
,HasReturnType
public class JavaMethod extends JavaCodeUnit
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.CanBeAnnotated
CanBeAnnotated.Utils
-
Nested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.HasName
HasName.AndFullName
-
Nested classes/interfaces inherited from class com.tngtech.archunit.core.domain.JavaCodeUnit
JavaCodeUnit.Functions, JavaCodeUnit.Predicates
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<JavaMethodCall>
getAccessesToSelf()
java.util.Set<JavaMethodCall>
getCallsOfSelf()
Optional<java.lang.Object>
getDefaultValue()
Returns the default value of this annotation method, if the method is an annotation method and has a declared default.java.lang.reflect.Method
reflect()
Resolves the respectiveMember
from the classpath.
NOTE: This method will throw an exception, if the owningClass
or any of its dependencies can't be found on the classpath.-
Methods inherited from class com.tngtech.archunit.core.domain.JavaCodeUnit
getConstructorCallsFromSelf, getFieldAccesses, getFullName, getMethodCallsFromSelf, getParameters, getReturnType, isConstructor
-
Methods inherited from class com.tngtech.archunit.core.domain.JavaMember
getAnnotationOfType, getAnnotationOfType, getAnnotations, getDescriptor, getModifiers, getName, getOwner, isAnnotatedWith, isAnnotatedWith, isAnnotatedWith, isMetaAnnotatedWith, isMetaAnnotatedWith, isMetaAnnotatedWith, toString, tryGetAnnotationOfType, tryGetAnnotationOfType
-
-
-
-
Method Detail
-
getDefaultValue
@PublicAPI(usage=ACCESS) public Optional<java.lang.Object> getDefaultValue()
Returns the default value of this annotation method, if the method is an annotation method and has a declared default. It's analogue toMethod.getDefaultValue()
, but returns Optional.absent() instead of null.- Returns:
- Optional.of(defaultValue) if applicable, otherwise Optional.absent()
-
getCallsOfSelf
@PublicAPI(usage=ACCESS) public java.util.Set<JavaMethodCall> getCallsOfSelf()
-
getAccessesToSelf
public java.util.Set<JavaMethodCall> getAccessesToSelf()
- Specified by:
getAccessesToSelf
in classJavaMember
-
reflect
public java.lang.reflect.Method reflect()
Description copied from class:JavaMember
Resolves the respectiveMember
from the classpath.
NOTE: This method will throw an exception, if the owningClass
or any of its dependencies can't be found on the classpath.- Specified by:
reflect
in classJavaMember
- Returns:
- The
Member
equivalent to thisJavaMember
-
-