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
,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
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.Set<JavaAccess<?>>
getAccessesFromSelf()
java.util.Set<JavaCall<?>>
getCallsFromSelf()
java.util.Set<JavaConstructorCall>
getConstructorCallsFromSelf()
JavaClassList
getExceptionTypes()
java.util.Set<JavaFieldAccess>
getFieldAccesses()
java.lang.String
getFullName()
java.util.Set<JavaMethodCall>
getMethodCallsFromSelf()
JavaClassList
getParameters()
Deprecated.UsegetRawParameterTypes()
insteadJavaClassList
getRawParameterTypes()
JavaClass
getRawReturnType()
JavaClass
getReturnType()
Deprecated.UsegetRawReturnType()
instead.abstract ThrowsClause<? extends JavaCodeUnit>
getThrowsClause()
boolean
isConstructor()
-
Methods inherited from class com.tngtech.archunit.core.domain.JavaMember
getAccessesToSelf, getAnnotationOfType, getAnnotationOfType, getAnnotations, getDescriptor, getModifiers, getName, getOwner, getSourceCodeLocation, isAnnotatedWith, isAnnotatedWith, isAnnotatedWith, isMetaAnnotatedWith, isMetaAnnotatedWith, isMetaAnnotatedWith, reflect, toString, tryGetAnnotationOfType, 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 Detail
-
getFullName
@PublicAPI(usage=ACCESS) public java.lang.String getFullName()
- Specified by:
getFullName
in interfaceHasName.AndFullName
- Returns:
- The full name of this
JavaCodeUnit
, i.e. a string containing${declaringClass}.${name}(${parameterTypes})
-
getParameters
@Deprecated @PublicAPI(usage=ACCESS) public JavaClassList getParameters()
Deprecated.UsegetRawParameterTypes()
instead- Specified by:
getParameters
in interfaceHasParameterTypes
-
getRawParameterTypes
@PublicAPI(usage=ACCESS) public JavaClassList getRawParameterTypes()
- Specified by:
getRawParameterTypes
in interfaceHasParameterTypes
-
getThrowsClause
@PublicAPI(usage=ACCESS) public abstract ThrowsClause<? extends JavaCodeUnit> getThrowsClause()
- Specified by:
getThrowsClause
in interfaceHasThrowsClause<JavaCodeUnit>
-
getExceptionTypes
@PublicAPI(usage=ACCESS) public JavaClassList getExceptionTypes()
- Returns:
- The types thrown by this method, similar to
Method.getExceptionTypes()
-
getReturnType
@Deprecated @PublicAPI(usage=ACCESS) public JavaClass getReturnType()
Deprecated.UsegetRawReturnType()
instead.- Specified by:
getReturnType
in interfaceHasReturnType
-
getRawReturnType
@PublicAPI(usage=ACCESS) public JavaClass getRawReturnType()
- Specified by:
getRawReturnType
in interfaceHasReturnType
-
getFieldAccesses
@PublicAPI(usage=ACCESS) public java.util.Set<JavaFieldAccess> getFieldAccesses()
-
getMethodCallsFromSelf
@PublicAPI(usage=ACCESS) public java.util.Set<JavaMethodCall> getMethodCallsFromSelf()
-
getConstructorCallsFromSelf
@PublicAPI(usage=ACCESS) public java.util.Set<JavaConstructorCall> getConstructorCallsFromSelf()
-
getCallsFromSelf
@PublicAPI(usage=ACCESS) public java.util.Set<JavaCall<?>> getCallsFromSelf()
-
getAccessesFromSelf
@PublicAPI(usage=ACCESS) public java.util.Set<JavaAccess<?>> getAccessesFromSelf()
-
isConstructor
@PublicAPI(usage=ACCESS) public boolean isConstructor()
-
-