public boolean isInterface() { return wrapped.isInterface(); }
/** * Get the current class for a meta tag keyword, as the first * and only element of an array list. */ protected ArrayList<String> getClassKeyword(ClassDoc classdoc) { String cltypelower = classdoc.isInterface() ? "interface" : "class"; ArrayList<String> metakeywords = new ArrayList<String>(1); metakeywords.add(classdoc.qualifiedName() + " " + cltypelower); return metakeywords; }
/** * Get the current class for a meta tag keyword, as the first * and only element of an array list. */ protected ArrayList<String> getClassKeyword(ClassDoc classdoc) { String cltypelower = classdoc.isInterface() ? "interface" : "class"; ArrayList<String> metakeywords = new ArrayList<String>(1); metakeywords.add(classdoc.qualifiedName() + " " + cltypelower); return metakeywords; }
public String getClassType() { if(this.classDoc.isInterface()) { return "interface"; } else if(this.classDoc.isAnnotationType()) { return "@interface"; } else if(this.classDoc.isEnum()) { return "enum"; } return "class"; }
public boolean matches(ClassDoc cd) { // if it's the interface we're looking for, match if(cd.isInterface() && pattern.matcher(cd.toString()).matches()) return true; // for each interface, recurse, since classes and interfaces // are treated the same in the doclet API for (ClassDoc iface : cd.interfaces()) if(matches(iface)) return true; // recurse on supeclass, if available return cd.superclass() == null ? false : matches(cd.superclass()); }
public String italicsClassName( ClassDoc cd, boolean qual ) { String name = (qual) ? cd.qualifiedName() : cd.name(); return (cd.isInterface()) ? italicsText( name ) : name; }
public boolean matches(ClassDoc cd) { // if it's the interface we're looking for, match if(cd.isInterface() && pattern.matcher(cd.toString()).matches()) return true; // for each interface, recurse, since classes and interfaces // are treated the same in the doclet API for (ClassDoc iface : cd.interfaces()) { if(matches(iface)) return true; } // recurse on supeclass, if available if(cd.superclass() != null) return matches(cd.superclass()); return false; }
protected String getLabel( ClassDoc cd ) { return cd.isInterface() ? italicsText( cd.name() ) : cd.name(); }
/** * Return the class type that is a direct supertype of this one. * Return null if this is an interface type. */ public com.sun.javadoc.Type superclassType() { if (asClassDoc().isInterface()) { return null; } Type sup = env.types.supertype(type); return TypeMaker.getType(env, (sup != type) ? sup : env.syms.objectType); }
/** * Get the modifier specifier integer. * * @see java.lang.reflect.Modifier */ public int modifierSpecifier() { int modifiers = getModifiers(); if (isMethod() && containingClass().isInterface()) // Remove the implicit abstract modifier. return modifiers & ~Modifier.ABSTRACT; return modifiers; }
public void printInheritedSummaryLabel(ClassDoc cd) { String clslink = writer.getPreQualifiedClassLink( LinkInfoImpl.CONTEXT_MEMBER, cd, false); writer.strong(); writer.printText(cd.isInterface() ? "doclet.Nested_Classes_Interface_Inherited_From_Interface" : "doclet.Nested_Classes_Interfaces_Inherited_From_Class", clslink); writer.strongEnd(); }
protected void printModifiers(MemberDoc member) { String mod = modifierString(member); // According to JLS, we should not be showing public modifier for // interface methods. if ((member.isField() || member.isMethod()) && writer instanceof ClassWriterImpl && ((ClassWriterImpl) writer).getClassDoc().isInterface()) { mod = Util.replaceText(mod, "public", "").trim(); } if(mod.length() > 0) { print(mod); print(' '); } }
public Content italicsClassName(ClassDoc cd, boolean qual) { Content name = new StringContent((qual)? cd.qualifiedName(): cd.name()); return (cd.isInterface())? HtmlTree.SPAN(HtmlStyle.interfaceName, name): name; }
/** * {@inheritDoc} */ public void addSuperInterfacesInfo(Content classInfoTree) { //NOTE: we really should be using ClassDoc.interfaceTypes() here, but // it doesn't walk up the tree like we want it to. List<Type> interfaceArray = Util.getAllInterfaces(classDoc, configuration); if (classDoc.isInterface() && interfaceArray.size() > 0) { Content label = getResource( "doclet.All_Superinterfaces"); Content dt = HtmlTree.DT(label); Content dl = HtmlTree.DL(dt); dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUPER_INTERFACES, interfaceArray)); classInfoTree.addContent(dl); } }
/** * {@inheritDoc} */ public void addSubInterfacesInfo(Content classInfoTree) { if (classDoc.isInterface()) { List<ClassDoc> subInterfaces = classtree.allSubs(classDoc, false); if (subInterfaces.size() > 0) { Content label = getResource( "doclet.Subinterfaces"); Content dt = HtmlTree.DT(label); Content dl = HtmlTree.DL(dt); dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUBINTERFACES, subInterfaces)); classInfoTree.addContent(dl); } } }
/** * {@inheritDoc} */ public void writeSubInterfacesInfo() { if( classDoc.isInterface() ) { List<ClassDoc> subInterfaces = classtree.allSubs( classDoc, false ); if( subInterfaces.size() > 0 ) { dl(); dt(); strongText( "doclet.Subinterfaces" ); dtEnd(); writeClassLinks( LinkInfoImpl.CONTEXT_SUBINTERFACES, subInterfaces ); dlEnd(); } } }
/** * Return the sub-class/interface list for the class/interface passed. * * @param cd class/interface whose sub-class/interface list is required. * @param isEnum true if the subclasses should be forced to come from the * enum tree. */ public List<ClassDoc> subs(ClassDoc cd, boolean isEnum) { if (isEnum) { return get(subEnums, cd); } else if (cd.isAnnotationType()) { return get(subAnnotationTypes, cd); } else if (cd.isInterface()) { return get(subinterfaces, cd); } else if (cd.isClass()) { return get(subclasses, cd); } else { return null; } }
private static String getStereotype(ClassDoc node) { String stereotype = node.isInterface()? "interface" : null; if (node.isException() || node.isError()) { stereotype = "exception"; } else if (node.isAnnotationType()) { stereotype = "annotation"; } else if (node.isEnum()) { stereotype = "enum"; } else if (isStaticType(node)) { stereotype = "static"; } if (node.tags(TAG_STEREOTYPE).length > 0) { stereotype = node.tags(TAG_STEREOTYPE)[0].text(); } return escape(stereotype); }
/** * {@inheritDoc} */ public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { Content classLink = writer.getPreQualifiedClassLink( LinkInfoImpl.Kind.MEMBER, cd, false); Content label = new StringContent(cd.isInterface() ? configuration.getText("doclet.Nested_Classes_Interface_Inherited_From_Interface") : configuration.getText("doclet.Nested_Classes_Interfaces_Inherited_From_Class")); Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING, label); labelHeading.addContent(writer.getSpace()); labelHeading.addContent(classLink); inheritedTree.addContent(labelHeading); }
/** * Print the header for the class use Listing. */ protected void printClassUseHeader() { String cltype = configuration.getText( classdoc.isInterface() ? "doclet.Interface" : "doclet.Class" ); String clname = classdoc.qualifiedName(); printHtmlHeader( configuration.getText( "doclet.Window_ClassUse_Header", cltype, clname ), null, true ); printTop(); navLinks( true ); center(); h2(); strongText( "doclet.ClassUse_Title", cltype, clname ); h2End(); centerEnd(); }