@Test public void testIndenting() { JPAAnnotationBuilder builder = new JPAAnnotationBuilder(1); builder.add(Id.class); assertEquals(builder.toString(), " @Id", "Unexpected annotations built by JPAAnnotationBuilder."); }
public void add(Class<? extends Annotation> annotation, Map<String, String> attrs) { add(annotation); if (attrs != null && !attrs.isEmpty()) { builderString.append('('); for (Map.Entry<String, String> attr : attrs.entrySet()) { builderString.append(attr.getKey()).append('=').append(attr.getValue()).append(','); } builderString.deleteCharAt(builderString.lastIndexOf(",")); builderString.append(')'); } }
JPAAnnotationBuilder extends BaseBuilder<Class<? extends Annotation>> { public void add(Class<? extends Annotation> annotation, Map<String, String> attrs) { add(annotation); if (attrs != null && !attrs.isEmpty()) { builderString.append('('); for (Map.Entry<String, String> attr : attrs.entrySet()) { builderString.append(attr.getKey()).append('=').append(attr.getValue()).append(','); } builderString.deleteCharAt(builderString.lastIndexOf(",")); builderString.append(')'); } } }
JPAAnnotationBuilder extends BaseBuilder<Class<? extends Annotation>> { public void add(Class<? extends Annotation> annotation, Map<String, String> attrs) { add(annotation); if (attrs != null && !attrs.isEmpty()) { builderString.append('('); for (Map.Entry<String, String> attr : attrs.entrySet()) { builderString.append(attr.getKey()).append('=').append(attr.getValue()).append(','); } builderString.deleteCharAt(builderString.lastIndexOf(",")); builderString.append(')'); } } JPAAnnotationBuilder(int numIndents); }
JPAAnnotationBuilder extends BaseBuilder<Class<? extends Annotation>> { public void add(Class<? extends Annotation> annotation, Map<String, String> attrs) { add(annotation); if (attrs != null && !attrs.isEmpty()) { builderString.append('('); for (Map.Entry<String, String> attr : attrs.entrySet()) { builderString.append(attr.getKey()).append('=').append(attr.getValue()).append(','); } builderString.deleteCharAt(builderString.lastIndexOf(",")); builderString.append(')'); } } JPAAnnotationBuilder(int numIndents); void add(Class<? extends Annotation> annotation, Map<String, String> attrs); }
JPAAnnotationBuilder extends BaseBuilder<Class<? extends Annotation>> { public void add(Class<? extends Annotation> annotation, Map<String, String> attrs) { add(annotation); if (attrs != null && !attrs.isEmpty()) { builderString.append('('); for (Map.Entry<String, String> attr : attrs.entrySet()) { builderString.append(attr.getKey()).append('=').append(attr.getValue()).append(','); } builderString.deleteCharAt(builderString.lastIndexOf(",")); builderString.append(')'); } } JPAAnnotationBuilder(int numIndents); void add(Class<? extends Annotation> annotation, Map<String, String> attrs);  }