Package com.tngtech.archunit.core.domain
Class JavaConstructor
java.lang.Object
com.tngtech.archunit.core.domain.JavaMember
com.tngtech.archunit.core.domain.JavaCodeUnit
com.tngtech.archunit.core.domain.JavaConstructor
- All Implemented Interfaces:
HasDescription,CanBeAnnotated,HasAnnotations<JavaMember>,HasDescriptor,HasModifiers,HasName,HasName.AndFullName,HasOwner<JavaClass>,HasParameterTypes,HasReturnType,HasSourceCodeLocation,HasThrowsClause<JavaCodeUnit>,HasTypeParameters<JavaCodeUnit>
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tngtech.archunit.core.domain.JavaCodeUnit
JavaCodeUnit.Functions, JavaCodeUnit.PredicatesNested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.CanBeAnnotated
CanBeAnnotated.UtilsNested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.HasName
HasName.AndFullName, HasName.Utils -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetAnnotationOfType(String typeName) booleanConstructor<?>reflect()tryGetAnnotationOfType(String typeName) Methods inherited from class com.tngtech.archunit.core.domain.JavaCodeUnit
getAccessesFromSelf, getAllInvolvedRawTypes, getCallsFromSelf, getCodeUnitReferencesFromSelf, getConstructorCallsFromSelf, getConstructorReferencesFromSelf, getExceptionTypes, getFieldAccesses, getFullName, getInstanceofChecks, getMethodCallsFromSelf, getMethodReferencesFromSelf, getParameterAnnotations, getParameters, getParameterTypes, getRawParameterTypes, getRawReturnType, getReferencedClassObjects, getReturnType, getTryCatchBlocks, isMethodMethods inherited from class com.tngtech.archunit.core.domain.JavaMember
getAnnotationOfType, getDescriptor, getModifiers, getName, getOwner, getReverseDependencies, getSourceCodeLocation, isAnnotatedWith, isAnnotatedWith, isAnnotatedWith, isMetaAnnotatedWith, isMetaAnnotatedWith, isMetaAnnotatedWith, toString, tryGetAnnotationOfType
-
Field Details
-
CONSTRUCTOR_NAME
- See Also:
-
-
Method Details
-
getTypeParameters
- Specified by:
getTypeParametersin interfaceHasTypeParameters<JavaCodeUnit>- Overrides:
getTypeParametersin classJavaCodeUnit- Returns:
- the type parameters of this object, e.g. for any generic method
this would return the<A, B> B someMethod(A a) {..}JavaTypeVariables[A, B].
If this object is non-generic, e.g. a method
an empty list will be returned.void someMethod() {..}
-
getThrowsClause
- Specified by:
getThrowsClausein interfaceHasThrowsClause<JavaCodeUnit>- Specified by:
getThrowsClausein classJavaCodeUnit
-
isConstructor
- Overrides:
isConstructorin classJavaCodeUnit
-
getCallsOfSelf
- Specified by:
getCallsOfSelfin classJavaCodeUnit
-
getReferencesToSelf
-
getAccessesToSelf
- Specified by:
getAccessesToSelfin classJavaMember
-
getAnnotations
- Specified by:
getAnnotationsin interfaceHasAnnotations<JavaMember>- Overrides:
getAnnotationsin classJavaCodeUnit
-
getAnnotationOfType
- Specified by:
getAnnotationOfTypein interfaceHasAnnotations<JavaMember>- Overrides:
getAnnotationOfTypein classJavaCodeUnit- Parameters:
typeName- The fully qualified class name of theAnnotationtype to retrieve.- Returns:
- The
JavaAnnotationmatching the given type. Will throw anIllegalArgumentExceptionif no matchingAnnotationis present. - See Also:
-
tryGetAnnotationOfType
- Specified by:
tryGetAnnotationOfTypein interfaceHasAnnotations<JavaMember>- Overrides:
tryGetAnnotationOfTypein classJavaCodeUnit- Parameters:
typeName- The fully qualified class name of theAnnotationtype to retrieve.- Returns:
- The
JavaAnnotationmatching the given type orOptional.empty()if there is noAnnotationwith the respective annotation type. - See Also:
-
reflect
Description copied from class:JavaMemberResolves the respectiveMemberfrom the classpath.
NOTE: This method will throw an exception, if the owningClassor any of its dependencies can't be found on the classpath.- Specified by:
reflectin classJavaMember- Returns:
- The
Memberequivalent to thisJavaMember
-
getDescription
-