@Override protected ItdTypeDetailsProvidingMetadataItem getMetadata( final String metadataIdentificationString, final JavaType aspectName, final PhysicalTypeMetadata governorPhysicalTypeMetadata, final String itdFilename) { final ToStringAnnotationValues annotationValues = new ToStringAnnotationValues(governorPhysicalTypeMetadata); if (!annotationValues.isAnnotationFound()) { return null; } final MemberDetails memberDetails = getMemberDetails(governorPhysicalTypeMetadata); if (memberDetails == null || memberDetails.getFields().isEmpty()) { return null; } AnnotationMetadata javaBeanAnnotation = memberDetails.getAnnotation(ROO_JAVA_BEAN); if (javaBeanAnnotation != null) { // Return an empty metadata as @RooJavaBean do the work return new ToStringMetadata(metadataIdentificationString, aspectName, governorPhysicalTypeMetadata, annotationValues, new ArrayList<FieldMetadata>(), true); } // Exclude fields which are in superclass List<FieldMetadata> toStringFields = getToStringFields(governorPhysicalTypeMetadata, memberDetails.getFields()); return new ToStringMetadata(metadataIdentificationString, aspectName, governorPhysicalTypeMetadata, annotationValues, toStringFields, false); }
final JavaSymbolName methodName = new JavaSymbolName(annotationValues.getToStringMethod()); final String[] excludeFields = annotationValues.getExcludeFields();
/** * Obtains the "toString" method for this type, if available. * <p> * If the user provided a non-default name for "toString", that method will * be returned. * * @return the "toString" method declared on this type or that will be * introduced (or null if undeclared and not introduced) */ private MethodMetadataBuilder getToStringMethod() { if (StringUtils.isBlank(annotationValues.getToStringMethod())) { return null; } // Compute the relevant toString method name final JavaSymbolName methodName = new JavaSymbolName(annotationValues.getToStringMethod()); // See if the type itself declared the method if (governorHasMethod(methodName)) { return null; } return generateToStringMethod(getId(), governorTypeDetails.getType(), annotationValues, fields); }
if (toStringAnnotationValues.isAnnotationFound()) { ensureGovernorHasMethod(ToStringMetadata.generateToStringMethod(identifier, target, toStringAnnotationValues, toStringFields));
/** * Obtains the "toString" method for this type, if available. * <p> * If the user provided a non-default name for "toString", that method will * be returned. * * @return the "toString" method declared on this type or that will be * introduced (or null if undeclared and not introduced) */ private MethodMetadataBuilder getToStringMethod() { if (StringUtils.isBlank(annotationValues.getToStringMethod())) { return null; } // Compute the relevant toString method name final JavaSymbolName methodName = new JavaSymbolName(annotationValues.getToStringMethod()); // See if the type itself declared the method if (governorHasMethod(methodName)) { return null; } return generateToStringMethod(getId(), governorTypeDetails.getType(), annotationValues, fields); }
if (toStringAnnotationValues.isAnnotationFound()) { ensureGovernorHasMethod(ToStringMetadata.generateToStringMethod(identifier, target, toStringAnnotationValues, toStringFields));
new ToStringAnnotationValues(governorPhysicalTypeMetadata); List<FieldMetadata> toStringFields = null; if (toStringAnnotationValues.isAnnotationFound()) { ToStringMetadataProvider toStringProvider = getToStringMetadataProvider(); toStringFields =
final JavaSymbolName methodName = new JavaSymbolName(annotationValues.getToStringMethod()); final String[] excludeFields = annotationValues.getExcludeFields();
@Override protected ItdTypeDetailsProvidingMetadataItem getMetadata( final String metadataIdentificationString, final JavaType aspectName, final PhysicalTypeMetadata governorPhysicalTypeMetadata, final String itdFilename) { final ToStringAnnotationValues annotationValues = new ToStringAnnotationValues(governorPhysicalTypeMetadata); if (!annotationValues.isAnnotationFound()) { return null; } final MemberDetails memberDetails = getMemberDetails(governorPhysicalTypeMetadata); if (memberDetails == null || memberDetails.getFields().isEmpty()) { return null; } AnnotationMetadata javaBeanAnnotation = memberDetails.getAnnotation(ROO_JAVA_BEAN); if (javaBeanAnnotation != null) { // Return an empty metadata as @RooJavaBean do the work return new ToStringMetadata(metadataIdentificationString, aspectName, governorPhysicalTypeMetadata, annotationValues, new ArrayList<FieldMetadata>(), true); } // Exclude fields which are in superclass List<FieldMetadata> toStringFields = getToStringFields(governorPhysicalTypeMetadata, memberDetails.getFields()); return new ToStringMetadata(metadataIdentificationString, aspectName, governorPhysicalTypeMetadata, annotationValues, toStringFields, false); }
new ToStringAnnotationValues(governorPhysicalTypeMetadata); List<FieldMetadata> toStringFields = null; if (toStringAnnotationValues.isAnnotationFound()) { ToStringMetadataProvider toStringProvider = getToStringMetadataProvider(); toStringFields =