本文整理汇总了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;
}
示例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;
}
示例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()));
}
示例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();
}
示例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();
}