public void generateEqualsAndHashCodeForType(EclipseNode typeNode, EclipseNode errorNode) {
    for (EclipseNode child : typeNode.down()) {
      if (child.getKind() == Kind.ANNOTATION) {
        if (Eclipse.annotationTypeMatches(EqualsAndHashCode.class, child)) {
          // The annotation will make it happen, so we can skip it.
          return;
        }
      }
    }

    generateMethods(typeNode, errorNode, null, null, null, false, FieldAccess.GETTER);
  }
Example #2
0
  public void generateToStringForType(EclipseNode typeNode, EclipseNode errorNode) {
    for (EclipseNode child : typeNode.down()) {
      if (child.getKind() == Kind.ANNOTATION) {
        if (Eclipse.annotationTypeMatches(ToString.class, child)) {
          // The annotation will make it happen, so we can skip it.
          return;
        }
      }
    }

    boolean includeFieldNames = true;
    try {
      includeFieldNames =
          ((Boolean) ToString.class.getMethod("includeFieldNames").getDefaultValue())
              .booleanValue();
    } catch (Exception ignore) {
    }
    generateToString(
        typeNode, errorNode, null, null, includeFieldNames, null, false, FieldAccess.GETTER);
  }