Package com.tngtech.archunit.core.domain
Class JavaCodeUnit
java.lang.Object
com.tngtech.archunit.core.domain.JavaMember
com.tngtech.archunit.core.domain.JavaCodeUnit
- All Implemented Interfaces:
HasDescription
,CanBeAnnotated
,HasAnnotations<JavaMember>
,HasDescriptor
,HasModifiers
,HasName
,HasName.AndFullName
,HasOwner<JavaClass>
,HasParameterTypes
,HasReturnType
,HasSourceCodeLocation
,HasThrowsClause<JavaCodeUnit>
- Direct Known Subclasses:
JavaConstructor
,JavaMethod
,JavaStaticInitializer
public abstract class JavaCodeUnit extends JavaMember implements HasParameterTypes, HasReturnType, HasThrowsClause<JavaCodeUnit>
Represents a unit of code containing accesses to other units of code. A unit of code can be
- a method
- a constructor
- a static initializer
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JavaCodeUnit.Functions
static class
JavaCodeUnit.Predicates
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
-
Method Summary
Modifier and Type Method Description java.util.Set<JavaAccess<?>>
getAccessesFromSelf()
JavaAnnotation<? extends JavaCodeUnit>
getAnnotationOfType(java.lang.String typeName)
java.util.Set<? extends JavaAnnotation<? extends JavaCodeUnit>>
getAnnotations()
java.util.Set<JavaCall<?>>
getCallsFromSelf()
java.util.Set<JavaConstructorCall>
getConstructorCallsFromSelf()
JavaClassList
getExceptionTypes()
java.util.Set<JavaFieldAccess>
getFieldAccesses()
java.lang.String
getFullName()
java.util.Set<InstanceofCheck>
getInstanceofChecks()
java.util.Set<JavaMethodCall>
getMethodCallsFromSelf()
JavaClassList
getRawParameterTypes()
JavaClass
getRawReturnType()
java.util.Set<ReferencedClassObject>
getReferencedClassObjects()
abstract ThrowsClause<? extends JavaCodeUnit>
getThrowsClause()
boolean
isConstructor()
Optional<? extends JavaAnnotation<? extends JavaCodeUnit>>
tryGetAnnotationOfType(java.lang.String typeName)
Methods inherited from class com.tngtech.archunit.core.domain.JavaMember
getAccessesToSelf, getAnnotationOfType, getDescriptor, getModifiers, getName, getOwner, getReverseDependencies, getSourceCodeLocation, isAnnotatedWith, isAnnotatedWith, isAnnotatedWith, isMetaAnnotatedWith, isMetaAnnotatedWith, isMetaAnnotatedWith, reflect, toString, tryGetAnnotationOfType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.tngtech.archunit.base.HasDescription
getDescription
-
Method Details
-
getFullName
- Specified by:
getFullName
in interfaceHasName.AndFullName
- Returns:
- The full name of this
JavaCodeUnit
, i.e. a string containing${declaringClass}.${name}(${parameterTypes})
-
getRawParameterTypes
- Specified by:
getRawParameterTypes
in interfaceHasParameterTypes
-
getThrowsClause
- Specified by:
getThrowsClause
in interfaceHasThrowsClause<JavaCodeUnit>
-
getExceptionTypes
- Returns:
- The types thrown by this method, similar to
Method.getExceptionTypes()
-
getRawReturnType
- Specified by:
getRawReturnType
in interfaceHasReturnType
-
getFieldAccesses
-
getMethodCallsFromSelf
-
getConstructorCallsFromSelf
-
getReferencedClassObjects
-
getInstanceofChecks
-
getCallsFromSelf
-
getAccessesFromSelf
-
isConstructor
-
getAnnotations
- Specified by:
getAnnotations
in interfaceHasAnnotations<JavaMember>
- Overrides:
getAnnotations
in classJavaMember
-
getAnnotationOfType
- Specified by:
getAnnotationOfType
in interfaceHasAnnotations<JavaMember>
- Overrides:
getAnnotationOfType
in classJavaMember
-
tryGetAnnotationOfType
public Optional<? extends JavaAnnotation<? extends JavaCodeUnit>> tryGetAnnotationOfType(java.lang.String typeName)- Specified by:
tryGetAnnotationOfType
in interfaceHasAnnotations<JavaMember>
- Overrides:
tryGetAnnotationOfType
in classJavaMember
-