/** Emits the modifiers to the writer. */ private void emitModifiers(Set<Modifier> modifiers) throws IOException { // Use an EnumSet to ensure the proper ordering if (!(modifiers instanceof EnumSet)) { modifiers = EnumSet.copyOf(modifiers); } for (Modifier modifier : modifiers) { out.append(modifier.toString()).append(' '); } }
@Override protected StringBuilder appendDescription(final StringBuilder sb) { for (final javax.lang.model.element.Modifier modifier : Flags.asModifierSet(getModifiers() & ~Flags.ACC_VARARGS)) { sb.append(modifier.toString()); sb.append(' '); } if (isEnum()) { sb.append("enum "); } else if (isInterface()) { sb.append("interface "); if (isAnnotation()) { sb.append('@'); } } else { sb.append("class "); } StringBuilder s = super.appendDescription(sb); final TypeReference baseType = getBaseType(); if (baseType != null) { s.append(" extends "); s = baseType.appendBriefDescription(s); } final List<TypeReference> interfaces = getExplicitInterfaces(); final int interfaceCount = interfaces.size(); if (interfaceCount > 0) { s.append(" implements "); for (int i = 0; i < interfaceCount; ++i) { if (i != 0) { s.append(","); } s = interfaces.get(i).appendBriefDescription(s); } } return s; }