Package com.tngtech.archunit.core.domain
Class JavaField
java.lang.Object
com.tngtech.archunit.core.domain.JavaMember
com.tngtech.archunit.core.domain.JavaField
- All Implemented Interfaces:
HasDescription
,CanBeAnnotated
,HasAnnotations<JavaMember>
,HasDescriptor
,HasModifiers
,HasName
,HasName.AndFullName
,HasOwner<JavaClass>
,HasSourceCodeLocation
,HasType
public class JavaField extends JavaMember implements HasType
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tngtech.archunit.core.domain.JavaMember
JavaMember.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, HasName.Utils
Nested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.HasName.AndFullName
HasName.AndFullName.Functions
Nested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.HasOwner
HasOwner.Functions
Nested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.HasType
HasType.Functions, HasType.Predicates
-
Method Summary
Modifier and Type Method Description java.util.Set<JavaFieldAccess>
getAccessesToSelf()
JavaAnnotation<JavaField>
getAnnotationOfType(java.lang.String typeName)
java.util.Set<JavaAnnotation<JavaField>>
getAnnotations()
java.lang.String
getDescription()
java.lang.String
getFullName()
JavaClass
getRawType()
JavaType
getType()
Note: This is still work in progress and thus does not support generic types at the moment.java.lang.reflect.Field
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.Optional<JavaAnnotation<JavaField>>
tryGetAnnotationOfType(java.lang.String typeName)
Methods inherited from class com.tngtech.archunit.core.domain.JavaMember
getAnnotationOfType, getDescriptor, getModifiers, getName, getOwner, getReverseDependencies, getSourceCodeLocation, isAnnotatedWith, isAnnotatedWith, isAnnotatedWith, isMetaAnnotatedWith, isMetaAnnotatedWith, isMetaAnnotatedWith, toString, tryGetAnnotationOfType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Method Details
-
getFullName
- Specified by:
getFullName
in interfaceHasName.AndFullName
- Returns:
- The full name of this
JavaField
, i.e. a string containing${declaringClass}.${name}
-
getType
Note: This is still work in progress and thus does not support generic types at the moment. In the future the result can possibly also be aJavaParameterizedType
orJavaTypeVariable
-
getRawType
- Specified by:
getRawType
in interfaceHasType
-
getAccessesToSelf
- Specified by:
getAccessesToSelf
in classJavaMember
-
getAnnotations
- Specified by:
getAnnotations
in interfaceHasAnnotations<JavaMember>
- Overrides:
getAnnotations
in classJavaMember
-
getAnnotationOfType
- Specified by:
getAnnotationOfType
in interfaceHasAnnotations<JavaMember>
- Overrides:
getAnnotationOfType
in classJavaMember
-
tryGetAnnotationOfType
- Specified by:
tryGetAnnotationOfType
in interfaceHasAnnotations<JavaMember>
- Overrides:
tryGetAnnotationOfType
in classJavaMember
-
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
-
getDescription
- Specified by:
getDescription
in interfaceHasDescription
-