當前位置: 首頁>>代碼示例>>Java>>正文


Java ClassOrInterfaceTypeDetailsBuilder.setDeclaredFields方法代碼示例

本文整理匯總了Java中org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetailsBuilder.setDeclaredFields方法的典型用法代碼示例。如果您正苦於以下問題:Java ClassOrInterfaceTypeDetailsBuilder.setDeclaredFields方法的具體用法?Java ClassOrInterfaceTypeDetailsBuilder.setDeclaredFields怎麽用?Java ClassOrInterfaceTypeDetailsBuilder.setDeclaredFields使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetailsBuilder的用法示例。


在下文中一共展示了ClassOrInterfaceTypeDetailsBuilder.setDeclaredFields方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getInnerType

import org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetailsBuilder; //導入方法依賴的package包/類
private ClassOrInterfaceTypeDetails getInnerType() {
    final List<FieldMetadataBuilder> fields = new ArrayList<FieldMetadataBuilder>();

    builder.getImportRegistrationResolver().addImports(OP4J_GET,
            JAVA_RUN_TYPE_TYPES);

    final String targetName = super.destination.getSimpleTypeName();
    final String initializer = "Get.attrOf(Types.forClass(" + targetName
            + ".class),\"" + targetName.toLowerCase() + "\")";
    final List<JavaType> parameters = Arrays.asList(OBJECT, destination);
    final JavaType function = new JavaType("org.op4j.functions.Function",
            0, DataType.TYPE, null, parameters);
    final int fieldModifier = Modifier.PUBLIC | Modifier.STATIC
            | Modifier.FINAL;
    final FieldMetadataBuilder fieldBuilder = new FieldMetadataBuilder(
            getId(), fieldModifier, new JavaSymbolName(
                    targetName.toUpperCase()), function, initializer);
    fields.add(fieldBuilder);

    final ClassOrInterfaceTypeDetailsBuilder cidBuilder = new ClassOrInterfaceTypeDetailsBuilder(
            getId(), Modifier.PUBLIC | Modifier.STATIC, KEYS,
            PhysicalTypeCategory.CLASS);
    cidBuilder.setDeclaredFields(fields);
    return cidBuilder.build();
}
 
開發者ID:gvSIGAssociation,項目名稱:gvnix1,代碼行數:26,代碼來源:Op4jMetadata.java

示例2: build

import org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetailsBuilder; //導入方法依賴的package包/類
public MemberHoldingTypeDetails build() {
    if (existing instanceof ItdTypeDetails) {
        final ItdTypeDetailsBuilder itdBuilder = new ItdTypeDetailsBuilder(
                (ItdTypeDetails) existing);
        // Push in all members that may have been modified
        itdBuilder.setDeclaredFields(getDeclaredFields());
        itdBuilder.setDeclaredMethods(getDeclaredMethods());
        itdBuilder.setAnnotations(getAnnotations());
        itdBuilder.setCustomData(getCustomData());
        itdBuilder.setDeclaredConstructors(getDeclaredConstructors());
        itdBuilder.setDeclaredInitializers(getDeclaredInitializers());
        itdBuilder.setDeclaredInnerTypes(getDeclaredInnerTypes());
        itdBuilder.setExtendsTypes(getExtendsTypes());
        itdBuilder.setImplementsTypes(getImplementsTypes());
        itdBuilder.setModifier(getModifier());
        return itdBuilder.build();
    }
    else if (existing instanceof ClassOrInterfaceTypeDetails) {
        final ClassOrInterfaceTypeDetailsBuilder cidBuilder = new ClassOrInterfaceTypeDetailsBuilder(
                (ClassOrInterfaceTypeDetails) existing);
        // Push in all members that may
        cidBuilder.setDeclaredFields(getDeclaredFields());
        cidBuilder.setDeclaredMethods(getDeclaredMethods());
        cidBuilder.setAnnotations(getAnnotations());
        cidBuilder.setCustomData(getCustomData());
        cidBuilder.setDeclaredConstructors(getDeclaredConstructors());
        cidBuilder.setDeclaredInitializers(getDeclaredInitializers());
        cidBuilder.setDeclaredInnerTypes(getDeclaredInnerTypes());
        cidBuilder.setExtendsTypes(getExtendsTypes());
        cidBuilder.setImplementsTypes(getImplementsTypes());
        cidBuilder.setModifier(getModifier());
        return cidBuilder.build();
    }
    else {
        throw new IllegalStateException(
                "Unknown instance of MemberHoldingTypeDetails");
    }
}
 
開發者ID:gvSIGAssociation,項目名稱:gvnix1,代碼行數:39,代碼來源:MemberDetailsBuilder.java


注:本文中的org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetailsBuilder.setDeclaredFields方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。