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
-
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
All Methods Instance Methods Concrete Methods Deprecated Methods 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()
JavaClass
getType()
Deprecated.UsegetRawType()
insteadjava.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, getSourceCodeLocation, isAnnotatedWith, isAnnotatedWith, isAnnotatedWith, isMetaAnnotatedWith, isMetaAnnotatedWith, isMetaAnnotatedWith, toString, tryGetAnnotationOfType
-
-
-
-
Method Detail
-
getFullName
@PublicAPI(usage=ACCESS) public java.lang.String getFullName()
- Specified by:
getFullName
in interfaceHasName.AndFullName
- Returns:
- The full name of this
JavaField
, i.e. a string containing${declaringClass}.${name}
-
getType
@Deprecated @PublicAPI(usage=ACCESS) public JavaClass getType()
Deprecated.UsegetRawType()
instead
-
getRawType
@PublicAPI(usage=ACCESS) public JavaClass getRawType()
- Specified by:
getRawType
in interfaceHasType
-
getAccessesToSelf
@PublicAPI(usage=ACCESS) public java.util.Set<JavaFieldAccess> getAccessesToSelf()
- Specified by:
getAccessesToSelf
in classJavaMember
-
getAnnotations
public java.util.Set<JavaAnnotation<JavaField>> getAnnotations()
- Specified by:
getAnnotations
in interfaceHasAnnotations<JavaMember>
- Overrides:
getAnnotations
in classJavaMember
-
getAnnotationOfType
public JavaAnnotation<JavaField> getAnnotationOfType(java.lang.String typeName)
- Specified by:
getAnnotationOfType
in interfaceHasAnnotations<JavaMember>
- Overrides:
getAnnotationOfType
in classJavaMember
-
tryGetAnnotationOfType
public Optional<JavaAnnotation<JavaField>> tryGetAnnotationOfType(java.lang.String typeName)
- Specified by:
tryGetAnnotationOfType
in interfaceHasAnnotations<JavaMember>
- Overrides:
tryGetAnnotationOfType
in classJavaMember
-
reflect
@PublicAPI(usage=ACCESS) public java.lang.reflect.Field 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
@PublicAPI(usage=ACCESS) public java.lang.String getDescription()
- Specified by:
getDescription
in interfaceHasDescription
-
-