All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.wangjiegulu.rapidooo.library.compiler.variables.impl.OtherFieldVariable Maven / Gradle / Ivy

package com.wangjiegulu.rapidooo.library.compiler.variables.impl;

import com.wangjiegulu.rapidooo.library.compiler.entry.GetterSetterMethodNames;
import com.wangjiegulu.rapidooo.library.compiler.util.ElementUtil;
import com.wangjiegulu.rapidooo.library.compiler.util.PoetUtil;
import com.wangjiegulu.rapidooo.library.compiler.variables.IOOOVariable;

import javax.lang.model.element.VariableElement;

/**
 * Author: wangjie Email: [email protected] Date: 2019-06-14.
 */
public class OtherFieldVariable implements IOOOVariable {
    private String fieldName;
    private String inputCode;

    public OtherFieldVariable(VariableElement variableElement, String reference) {
        this.fieldName = variableElement.getSimpleName().toString();
        GetterSetterMethodNames getterSetterMethodNames = PoetUtil.generateGetterSetterMethodName(this.fieldName, ElementUtil.getTypeName(variableElement.asType()));
        this.inputCode = reference + "." + getterSetterMethodNames.getGetterMethodName() + "()";
    }

    @Override
    public String fieldName() {
        return fieldName;
    }

    @Override
    public String inputCode() {
        return inputCode;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy