public class FieldScope extends MemberScope<com.fasterxml.classmate.members.ResolvedField,Field>
Modifier | Constructor and Description |
---|---|
protected |
FieldScope(com.fasterxml.classmate.members.ResolvedField field,
com.fasterxml.classmate.ResolvedType overriddenType,
String overriddenName,
com.fasterxml.classmate.ResolvedTypeWithMembers declaringTypeMembers,
Integer fakeContainerItemIndex,
TypeContext context)
Constructor.
|
protected |
FieldScope(com.fasterxml.classmate.members.ResolvedField field,
com.fasterxml.classmate.ResolvedTypeWithMembers declaringTypeMembers,
TypeContext context)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
FieldScope |
asFakeContainerItemScope()
Create another instance for this field or method and context, representing its field/method return type's container item type.
|
protected String |
doGetSchemaPropertyName()
Returns the name to be used to reference this field in its parent's "properties".
|
MethodScope |
findGetter()
Return the conventional getter method (if one exists).
|
<A extends Annotation> |
getAnnotationConsideringFieldAndGetter(Class<A> annotationClass)
Return the annotation of the given type on the member, if such an annotation is present on either the field or its getter.
|
<A extends Annotation> |
getContainerItemAnnotation(Class<A> annotationClass)
Return the annotation of the given type on the member's container item (i.e.
|
<A extends Annotation> |
getContainerItemAnnotationConsideringFieldAndGetter(Class<A> annotationClass)
Return the annotation of the given type on the member's container item (i.e.
|
boolean |
hasGetter()
Determine whether the field's declaring class contains a matching method starting with "get" or "is".
|
boolean |
isTransient()
Indicates whether the field has the
transient keyword. |
FieldScope |
withOverriddenName(String overriddenName)
Create another instance for this field or method and context, but overriding the declared field/method name with the given one.
|
FieldScope |
withOverriddenType(com.fasterxml.classmate.ResolvedType overriddenType)
Create another instance for this field or method and context, but overriding the declared field/method return type with the given one.
|
asFakeContainerItemScope, getAnnotation, getAnnotationConsideringFieldAndGetterIfSupported, getContainerItemAnnotationConsideringFieldAndGetterIfSupported, getDeclaredName, getDeclaredType, getDeclaringType, getDeclaringTypeMembers, getFakeContainerItemIndex, getMember, getName, getOverriddenName, getOverriddenType, getRawMember, getSchemaPropertyName, isFakeContainerItemScope, isFinal, isPrivate, isProtected, isPublic, isStatic, toString
getContainerItemType, getContext, getFullTypeDescription, getSimpleTypeDescription, getType, getTypeParameterFor, isContainerType
protected FieldScope(com.fasterxml.classmate.members.ResolvedField field, com.fasterxml.classmate.ResolvedTypeWithMembers declaringTypeMembers, TypeContext context)
field
- targeted fielddeclaringTypeMembers
- collection of the declaring type's (other) fields and methodscontext
- the overall type resolution contextprotected FieldScope(com.fasterxml.classmate.members.ResolvedField field, com.fasterxml.classmate.ResolvedType overriddenType, String overriddenName, com.fasterxml.classmate.ResolvedTypeWithMembers declaringTypeMembers, Integer fakeContainerItemIndex, TypeContext context)
field
- targeted fieldoverriddenType
- alternative type for this fieldoverriddenName
- alternative name for this fielddeclaringTypeMembers
- collection of the declaring type's (other) fields and methodsfakeContainerItemIndex
- index of the container item on the generic field/method scope's declared type (e.g., in case of a List, it is 0)context
- the overall type resolution contextpublic FieldScope withOverriddenType(com.fasterxml.classmate.ResolvedType overriddenType)
MemberScope
withOverriddenType
in class MemberScope<com.fasterxml.classmate.members.ResolvedField,Field>
overriddenType
- alternative type for this field or method return value (overriding the declared type)MemberScope.getDeclaredType()
,
MemberScope.getOverriddenType()
public FieldScope withOverriddenName(String overriddenName)
MemberScope
withOverriddenName
in class MemberScope<com.fasterxml.classmate.members.ResolvedField,Field>
overriddenName
- alternative name for this field or methodMemberScope.getDeclaredType()
,
MemberScope.getOverriddenType()
public FieldScope asFakeContainerItemScope()
MemberScope
asFakeContainerItemScope
in class MemberScope<com.fasterxml.classmate.members.ResolvedField,Field>
MemberScope.withOverriddenType(ResolvedType)
,
TypeScope.getContainerItemType()
,
MemberScope.isFakeContainerItemScope()
protected String doGetSchemaPropertyName()
doGetSchemaPropertyName
in class MemberScope<com.fasterxml.classmate.members.ResolvedField,Field>
MemberScope.getName()
public boolean isTransient()
transient
keyword.public MethodScope findGetter()
public boolean hasGetter()
findGetter()
public <A extends Annotation> A getContainerItemAnnotation(Class<A> annotationClass)
MemberScope
getContainerItemAnnotation
in class MemberScope<com.fasterxml.classmate.members.ResolvedField,Field>
A
- type of annotationannotationClass
- type of annotationnull
if no annotation of the given type is present)public <A extends Annotation> A getAnnotationConsideringFieldAndGetter(Class<A> annotationClass)
MemberScope
getAnnotationConsideringFieldAndGetter
in class MemberScope<com.fasterxml.classmate.members.ResolvedField,Field>
A
- type of annotationannotationClass
- type of annotationnull
if no annotation of the given type is present)public <A extends Annotation> A getContainerItemAnnotationConsideringFieldAndGetter(Class<A> annotationClass)
MemberScope
getContainerItemAnnotationConsideringFieldAndGetter
in class MemberScope<com.fasterxml.classmate.members.ResolvedField,Field>
A
- type of annotationannotationClass
- type of annotationnull
if no annotation of the given type is present)Copyright © 2022 VicTools. All rights reserved.