当前位置: 首页>>代码示例>>Java>>正文


Java FieldMetadata.getFieldName方法代码示例

本文整理汇总了Java中org.springframework.roo.classpath.details.FieldMetadata.getFieldName方法的典型用法代码示例。如果您正苦于以下问题:Java FieldMetadata.getFieldName方法的具体用法?Java FieldMetadata.getFieldName怎么用?Java FieldMetadata.getFieldName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.roo.classpath.details.FieldMetadata的用法示例。


在下文中一共展示了FieldMetadata.getFieldName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: typeCommandTabular

import org.springframework.roo.classpath.details.FieldMetadata; //导入方法依赖的package包/类
/**
 * Add type value command for tabular pattern.
 * 
 * @param document Document to write command
 * @param field Field to add value
 * @param entity Field parent entity
 * @return Type node
 */
protected Node typeCommandTabular(Document document, FieldMetadata field,
        JavaType entity, boolean random) {

    Node tr = document.createElement("tr");

    Node td1 = tr.appendChild(document.createElement("td"));
    td1.setTextContent("type");

    Node td2 = tr.appendChild(document.createElement("td"));

    String id = "_"
            + XmlUtils
                    .convertId("fu:" + entity.getFullyQualifiedTypeName())
            + "[0]_" + field.getFieldName() + "_id_create";
    td2.setTextContent(id);

    Node td3 = tr.appendChild(document.createElement("td"));
    td3.setTextContent(convertToInitializer(field, random));

    return tr;
}
 
开发者ID:gvSIGAssociation,项目名称:gvnix1,代码行数:30,代码来源:SeleniumServicesImpl.java

示例2: verifyCommandTabular

import org.springframework.roo.classpath.details.FieldMetadata; //导入方法依赖的package包/类
/**
 * Add verification value command for tabular pattern field.
 * 
 * @param document Document to write command
 * @param entity Field parent entity
 * @param field Field to verify value
 * @return Verification node
 */
protected Node verifyCommandTabular(Document document, JavaType entity,
        FieldMetadata field) {

    Node tr = document.createElement("tr");

    Node td1 = tr.appendChild(document.createElement("td"));
    td1.setTextContent("verifyValue");

    Node td2 = tr.appendChild(document.createElement("td"));
    String id = "_"
            + XmlUtils
                    .convertId("fu:" + entity.getFullyQualifiedTypeName())
            + "[0]_" + field.getFieldName() + "_id_update";
    td2.setTextContent(XmlUtils.convertId(id));

    Node td3 = tr.appendChild(document.createElement("td"));
    td3.setTextContent(convertToInitializer(field));

    return tr;
}
 
开发者ID:gvSIGAssociation,项目名称:gvnix1,代码行数:29,代码来源:SeleniumServicesImpl.java

示例3: getScaffoldEligibleFieldMetadata

import org.springframework.roo.classpath.details.FieldMetadata; //导入方法依赖的package包/类
public List<FieldMetadata> getScaffoldEligibleFieldMetadata(
        final JavaType javaType, final MemberDetails memberDetails,
        final String metadataIdentificationString) {
	
    Validate.notNull(javaType, "Java type required");
    Validate.notNull(memberDetails, "Member details required");

    final MethodMetadata identifierAccessor = getPersistenceMemberLocator()
            .getIdentifierAccessor(javaType);
    final MethodMetadata versionAccessor = getPersistenceMemberLocator()
            .getVersionAccessor(javaType);

    final Map<JavaSymbolName, FieldMetadata> fields = new LinkedHashMap<JavaSymbolName, FieldMetadata>();
    final List<MethodMetadata> methods = memberDetails.getMethods();

    for (final MethodMetadata method : methods) {
        // Only interested in accessors
        if (!BeanInfoUtils.isAccessorMethod(method)
                || method.hasSameName(identifierAccessor, versionAccessor)) {
            continue;
        }

        final FieldMetadata field = BeanInfoUtils
                .getFieldForJavaBeanMethod(memberDetails, method);
        if (field == null
                || !BeanInfoUtils.hasAccessorAndMutator(field,
                        memberDetails)) {
            continue;
        }
        final JavaSymbolName fieldName = field.getFieldName();
        registerDependency(method.getDeclaredByMetadataId(),
                metadataIdentificationString);
        if (!fields.containsKey(fieldName)) {
            fields.put(fieldName, field);
        }
    }
    return Collections.unmodifiableList(new ArrayList<FieldMetadata>(fields
            .values()));
}
 
开发者ID:gvSIGAssociation,项目名称:gvnix1,代码行数:40,代码来源:WebMetadataServiceImpl.java

示例4: FieldToken

import org.springframework.roo.classpath.details.FieldMetadata; //导入方法依赖的package包/类
/**
 * Constructor
 * 
 * @param field
 */
public FieldToken(final FieldMetadata field) {
    Validate.notNull(field, "FieldMetadata required");
    this.field = field;
    fieldName = field.getFieldName();
}
 
开发者ID:gvSIGAssociation,项目名称:gvnix1,代码行数:11,代码来源:FieldToken.java

示例5: getGvNIXXmlElementFieldAnnotation

import org.springframework.roo.classpath.details.FieldMetadata; //导入方法依赖的package包/类
/**
 * <p>
 * Convert field with @XmlElement annotation to field with @GvNIXXmlElementField
 * with its values.
 * </p>
 * <p>
 * Creates {@link FieldMetadata} with @GvNIXXmlElementField annotation even
 * if not exists @XmlElement.
 * </p>
 * TODO to be removed from interface?. This method could be useless outside
 * this service.
 * 
 * @param fieldMetadata
 * @return {@link FieldMetadata} with @GvNIXXmlElementField annotation.
 */
protected FieldMetadata getGvNIXXmlElementFieldAnnotation(
        FieldMetadata field) {

    AnnotationMetadata gvNixXmlElementAnnot;

    AnnotationMetadata xmlElementAnnot = MemberFindingUtils
            .getAnnotationOfType(field.getAnnotations(), new JavaType(
                    XmlElement.class.getName()));
    if (xmlElementAnnot != null) {

        // Field has XmlElement annotation: create GvNIXXmlElement from it
        gvNixXmlElementAnnot = getXmlElementFieldAnnotation(xmlElementAnnot);

    }
    else {

        AnnotationMetadata xmlElementRefAnnot = MemberFindingUtils
                .getAnnotationOfType(field.getAnnotations(), new JavaType(
                        XmlElementRef.class.getName()));
        if (xmlElementRefAnnot != null) {

            // Field has XmlElementRef: create GvNIXXmlElement from it
            gvNixXmlElementAnnot = getXmlElementRefFieldAnnotation(field);

        }
        else {

            // Field no XmlElement, XmlElementRef: create empty
            // GvNIXXmlElement
            gvNixXmlElementAnnot = new AnnotationMetadataBuilder(
                    new JavaType(GvNIXXmlElementField.class.getName()),
                    new ArrayList<AnnotationAttributeValue<?>>()).build();
        }
    }

    List<AnnotationMetadata> annots = new ArrayList<AnnotationMetadata>();
    annots.add(gvNixXmlElementAnnot);

    // Create new Field with GvNIXAnnotation.
    FieldMetadataBuilder fieldMetadataBuilder = new FieldMetadataBuilder(
            field.getDeclaredByMetadataId(), field.getModifier(),
            field.getFieldName(), field.getFieldType(),
            field.getFieldInitializer());
    for (AnnotationMetadata annotationMetadata : annots) {
        fieldMetadataBuilder.addAnnotation(annotationMetadata);
    }

    return fieldMetadataBuilder.build();
}
 
开发者ID:gvSIGAssociation,项目名称:gvnix1,代码行数:65,代码来源:WSExportWsdlImpl.java


注:本文中的org.springframework.roo.classpath.details.FieldMetadata.getFieldName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。