return domainObjectDescriptor;
}
@Nonnull
public FieldWithInitializationInfo getFieldWithInitializationInfo( @Nonnull FieldDeclaration fieldDeclaration ) {
MethodDeclaration getterDeclaration = TypeUtils.findGetterForField( classDeclaration, fieldDeclaration );
//At first look for fields that are initialized within the constructor
try {
ConstructorCallInfo constructorCallInfo = findConstructorCallInfoForField( fieldDeclaration );
return new FieldInitializedInConstructorInfo( fieldDeclaration, getterDeclaration, constructorCallInfo );
} catch ( IllegalArgumentException ignore ) {
}
//Now look for fields that have a setter
try {
MethodDeclaration setter = TypeUtils.findSetter( classDeclaration, fieldDeclaration );
return new FieldInitializedInSetterInfo( fieldDeclaration, getterDeclaration, setter );
} catch ( IllegalArgumentException ignore ) {
}
//Ok, return a read only field descriptor