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 classJavaCodeUnit.Functionsstatic classJavaCodeUnit.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()JavaClassListgetExceptionTypes()java.util.Set<JavaFieldAccess>getFieldAccesses()java.lang.StringgetFullName()java.util.Set<JavaMethodCall>getMethodCallsFromSelf()JavaClassListgetParameters()Deprecated.UsegetRawParameterTypes()insteadJavaClassListgetRawParameterTypes()JavaClassgetRawReturnType()JavaClassgetReturnType()Deprecated.UsegetRawReturnType()instead.abstract ThrowsClause<? extends JavaCodeUnit>getThrowsClause()booleanisConstructor()-
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:
getFullNamein 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:
getParametersin interfaceHasParameterTypes
-
getRawParameterTypes
@PublicAPI(usage=ACCESS) public JavaClassList getRawParameterTypes()
- Specified by:
getRawParameterTypesin interfaceHasParameterTypes
-
getThrowsClause
@PublicAPI(usage=ACCESS) public abstract ThrowsClause<? extends JavaCodeUnit> getThrowsClause()
- Specified by:
getThrowsClausein 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:
getReturnTypein interfaceHasReturnType
-
getRawReturnType
@PublicAPI(usage=ACCESS) public JavaClass getRawReturnType()
- Specified by:
getRawReturnTypein 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()
-
-