0

私はいくつかの grails コードを継承しており、以下のcreateメソッドの性質を理解しようとしています。AttributeService が所有する Attribute プロパティの一種の grails キーワード コンストラクターですか? createメソッドがどこで呼び出されているかわかりません。ありがとう。

class AttributeService {

    boolean transactional = false

    def uiKey2Attribute = [:]
    def internalName2Attribute = [:]

    def Attribute create(String internalName, String displayName) {
        Attribute attribute = new Attribute();
        attribute.setInternalName(internalName);
        attribute.setUiKey(internalName.replaceAll(' ', '_'))
        attribute.setDisplayName(displayName);
        return attribute;
    }

}
4

1 に答える 1