diff --git a/src/main/java/com/microsoft/build/YmlFilesBuilder.java b/src/main/java/com/microsoft/build/YmlFilesBuilder.java index 2a5c50c..06ffa06 100644 --- a/src/main/java/com/microsoft/build/YmlFilesBuilder.java +++ b/src/main/java/com/microsoft/build/YmlFilesBuilder.java @@ -7,6 +7,7 @@ import com.microsoft.model.*; import com.microsoft.util.ElementUtil; import com.microsoft.util.FileUtil; +import com.microsoft.util.Utils; import com.microsoft.util.YamlUtil; import jdk.javadoc.doclet.DocletEnvironment; import org.apache.commons.lang3.RegExUtils; @@ -166,7 +167,7 @@ void addChildren(TypeElement classElement, List children) { List filterPrivateElements(List elements) { return elements.stream() - .filter(element -> !ElementUtil.isPrivateOrPackagePrivate(element)).collect(Collectors.toList()); + .filter(element -> !Utils.isPrivateOrPackagePrivate(element)).collect(Collectors.toList()); } void collect(TypeElement classElement, List children, @@ -193,7 +194,7 @@ void addConstructorsInfo(TypeElement classElement, MetadataFile classMetadataFil void addMethodsInfo(TypeElement classElement, MetadataFile classMetadataFile) { ElementFilter.methodsIn(classElement.getEnclosedElements()).stream() - .filter(methodElement -> !ElementUtil.isPrivateOrPackagePrivate(methodElement)) + .filter(methodElement -> !Utils.isPrivateOrPackagePrivate(methodElement)) .forEach(methodElement -> { MetadataFileItem methodItem = buildMetadataFileItem(methodElement); methodItem.setOverload(classItemsLookup.extractOverload(methodElement)); @@ -201,6 +202,7 @@ void addMethodsInfo(TypeElement classElement, MetadataFile classMetadataFile) { methodItem.setExceptions(classItemsLookup.extractExceptions(methodElement)); methodItem.setParameters(classItemsLookup.extractParameters(methodElement)); methodItem.setReturn(classItemsLookup.extractReturn(methodElement)); + methodItem.setOverridden(classItemsLookup.extractOverridden(methodElement)); classMetadataFile.getItems().add(methodItem); addExceptionReferences(methodItem, classMetadataFile); @@ -212,7 +214,7 @@ void addMethodsInfo(TypeElement classElement, MetadataFile classMetadataFile) { void addFieldsInfo(TypeElement classElement, MetadataFile classMetadataFile) { ElementFilter.fieldsIn(classElement.getEnclosedElements()).stream() - .filter(fieldElement -> !ElementUtil.isPrivateOrPackagePrivate(fieldElement)) + .filter(fieldElement -> !Utils.isPrivateOrPackagePrivate(fieldElement)) .forEach(fieldElement -> { MetadataFileItem fieldItem = buildMetadataFileItem(fieldElement); fieldItem.setContent(classItemsLookup.extractFieldContent(fieldElement)); @@ -286,7 +288,7 @@ void addSuperclassAndInterfacesReferences(TypeElement classElement, MetadataFile void addInnerClassesReferences(TypeElement classElement, MetadataFile classMetadataFile) { classMetadataFile.getReferences().addAll( - ElementFilter.typesIn(classElement.getEnclosedElements()).stream() + ElementFilter.typesIn(elementUtil.extractSortedElements(classElement)).stream() .map(this::buildClassReference) .collect(Collectors.toList())); } @@ -488,7 +490,7 @@ String resolveUidFromReference(String linkContent, LookupContext lookupContext) return uid; } - String resolveUidByLookup(String signature, LookupContext lookupContext){ + String resolveUidByLookup(String signature, LookupContext lookupContext) { if (StringUtils.isBlank(signature) || lookupContext == null) { return ""; } diff --git a/src/main/java/com/microsoft/lookup/BaseLookup.java b/src/main/java/com/microsoft/lookup/BaseLookup.java index 5b846af..68b6fdd 100644 --- a/src/main/java/com/microsoft/lookup/BaseLookup.java +++ b/src/main/java/com/microsoft/lookup/BaseLookup.java @@ -6,6 +6,7 @@ import com.microsoft.model.MethodParameter; import com.microsoft.model.Return; import com.microsoft.model.TypeParameter; + import com.sun.source.doctree.DocCommentTree; import com.sun.source.doctree.DocTree; import com.sun.source.doctree.LinkTree; @@ -14,9 +15,12 @@ import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; + import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; + import jdk.javadoc.doclet.DocletEnvironment; + import org.apache.commons.lang3.RegExUtils; import org.apache.commons.lang3.StringUtils; @@ -152,6 +156,10 @@ public Set extractReferences(T key) { return resolve(key).getReferences(); } + public String extractOverridden(T key) { + return resolve(key).getOverridden(); + } + protected String determineType(T element) { return elementKindLookup.get(element.getKind()); } @@ -162,9 +170,9 @@ protected String determinePackageName(T element) { protected String determineComment(T element) { return getDocCommentTree(element) - .map(DocCommentTree::getFullBody) - .map(this::replaceLinksAndCodes) - .orElse(null); + .map(DocCommentTree::getFullBody) + .map(this::replaceLinksAndCodes) + .orElse(null); } /** @@ -175,19 +183,19 @@ protected String determineComment(T element) { */ String replaceLinksAndCodes(List items) { return items.stream().map( - bodyItem -> { - switch (bodyItem.getKind()) { - case LINK: - case LINK_PLAIN: - return buildXrefTag((LinkTree) bodyItem); - case CODE: - return buildCodeTag((LiteralTree) bodyItem); - case LITERAL: - return expandLiteralBody((LiteralTree) bodyItem); - default: - return String.valueOf(bodyItem); + bodyItem -> { + switch (bodyItem.getKind()) { + case LINK: + case LINK_PLAIN: + return buildXrefTag((LinkTree) bodyItem); + case CODE: + return buildCodeTag((LiteralTree) bodyItem); + case LITERAL: + return expandLiteralBody((LiteralTree) bodyItem); + default: + return String.valueOf(bodyItem); + } } - } ).collect(Collectors.joining()); } @@ -223,7 +231,7 @@ public String makeTypeShort(String value) { return value; } return Stream.of(StringUtils.split(value, "<")) - .map(s -> RegExUtils.removeAll(s, "\\b[a-z0-9_.]+\\.")) - .collect(Collectors.joining("<")); + .map(s -> RegExUtils.removeAll(s, "\\b[a-z0-9_.]+\\.")) + .collect(Collectors.joining("<")); } } diff --git a/src/main/java/com/microsoft/lookup/ClassItemsLookup.java b/src/main/java/com/microsoft/lookup/ClassItemsLookup.java index 9f54d85..18436b9 100644 --- a/src/main/java/com/microsoft/lookup/ClassItemsLookup.java +++ b/src/main/java/com/microsoft/lookup/ClassItemsLookup.java @@ -1,26 +1,35 @@ package com.microsoft.lookup; import com.microsoft.lookup.model.ExtendedMetadataFileItem; + import com.microsoft.model.ExceptionItem; import com.microsoft.model.MethodParameter; import com.microsoft.model.Return; + +import com.microsoft.util.CommentHelper; +import com.microsoft.util.Utils; + +import com.sun.source.doctree.DocTree; import com.sun.source.doctree.DocTree.Kind; import com.sun.source.doctree.ParamTree; import com.sun.source.doctree.ReturnTree; import com.sun.source.doctree.ThrowsTree; + +import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; -import javax.lang.model.element.Element; -import javax.lang.model.element.ExecutableElement; -import javax.lang.model.element.TypeElement; -import javax.lang.model.element.VariableElement; + +import javax.lang.model.element.*; import javax.lang.model.type.TypeKind; + import jdk.javadoc.doclet.DocletEnvironment; public class ClassItemsLookup extends BaseLookup { + private Utils utils; public ClassItemsLookup(DocletEnvironment environment) { super(environment); + utils = new Utils(environment); } @Override @@ -48,18 +57,22 @@ protected ExtendedMetadataFileItem buildMetadataFileItem(Element element) { ExecutableElement exeElement = (ExecutableElement) element; List parameters = extractParameters(exeElement); String paramsString = parameters.stream() - .map(parameter -> String.format("%s %s", makeTypeShort(parameter.getType()), parameter.getId())) - .collect(Collectors.joining(", ")); + .map(parameter -> String.format("%s %s", makeTypeShort(parameter.getType()), parameter.getId())) + .collect(Collectors.joining(", ")); String nameWithoutBrackets = elementQName.replaceAll("\\(.*\\)", ""); String methodName = String.format("%s(%s)", nameWithoutBrackets, paramsString); result.setName(methodName); result.setMethodContent(String.format("%s %s %s", modifiers, - makeTypeShort(String.valueOf(exeElement.getReturnType())), result.getName())); + makeTypeShort(String.valueOf(exeElement.getReturnType())), result.getName())); result.setConstructorContent(String.format("%s %s", modifiers, result.getName())); result.setParameters(parameters); result.setExceptions(extractExceptions(exeElement)); result.setReturn(extractReturn(exeElement)); + if (exeElement.getKind() == ElementKind.METHOD) { + result.setOverridden(extractOverriddenUid(utils.overriddenMethod(exeElement))); + result.setSummary(getInheritedInlineCommentString(exeElement)); + } } result.setNameWithType(String.format("%s.%s", classSNameWithGenericsSupport, result.getName())); result.setFullName(String.format("%s.%s", classQNameWithGenericsSupport, result.getName())); @@ -83,11 +96,11 @@ List extractParameters(ExecutableElement element) { String extractParameterDescription(ExecutableElement method, String paramName) { return getDocCommentTree(method).map(docTree -> docTree.getBlockTags().stream() - .filter(o -> o.getKind() == Kind.PARAM) - .map(o -> (ParamTree) o) - .filter(o -> paramName.equals(String.valueOf(o.getName()))) - .map(o -> replaceLinksAndCodes(o.getDescription())) - .findFirst().orElse(null) + .filter(o -> o.getKind() == Kind.PARAM) + .map(o -> (ParamTree) o) + .filter(o -> paramName.equals(String.valueOf(o.getName()))) + .map(o -> replaceLinksAndCodes(o.getDescription())) + .findFirst().orElse(null) ).orElse(null); } @@ -100,10 +113,10 @@ List extractExceptions(ExecutableElement methodElement) { String extractExceptionDescription(ExecutableElement methodElement) { return getDocCommentTree(methodElement).map(docTree -> docTree.getBlockTags().stream() - .filter(o -> o.getKind() == Kind.THROWS) - .map(o -> (ThrowsTree) o) - .map(o -> replaceLinksAndCodes(o.getDescription())) - .findFirst().orElse(null) + .filter(o -> o.getKind() == Kind.THROWS) + .map(o -> (ThrowsTree) o) + .map(o -> replaceLinksAndCodes(o.getDescription())) + .findFirst().orElse(null) ).orElse(null); } @@ -116,10 +129,10 @@ Return extractReturn(ExecutableElement methodElement) { String extractReturnDescription(ExecutableElement methodElement) { return getDocCommentTree(methodElement).map(docTree -> docTree.getBlockTags().stream() - .filter(o -> o.getKind() == Kind.RETURN) - .map(o -> (ReturnTree)o) - .map(o -> replaceLinksAndCodes(o.getDescription())) - .findFirst().orElse(null) + .filter(o -> o.getKind() == Kind.RETURN) + .map(o -> (ReturnTree) o) + .map(o -> replaceLinksAndCodes(o.getDescription())) + .findFirst().orElse(null) ).orElse(null); } @@ -130,4 +143,56 @@ Return extractReturn(VariableElement fieldElement) { String convertFullNameToOverload(String fullName) { return fullName.replaceAll("\\(.*\\)", "*"); } + + String extractOverriddenUid(ExecutableElement ovr) { + if (ovr != null) { + TypeElement te = utils.getEnclosingTypeElement(ovr); + String uid = te.getQualifiedName().toString().concat(".") + String.valueOf(ovr); + return uid; + } + + return ""; + } + + /** + * If the item being inherited from is declared from external compiled package, + * or is declared in the packages like java.lang.Object, + * comments may be not available as doclet resolves from byte code. + */ + String getInheritedInlineCommentString(ExecutableElement exeElement) { + CommentHelper ch = getInheritedInlineTags(new CommentHelper(exeElement, utils)); + // Remove unresolved "@inheritDoc" tag. + List dctree = utils.removeBlockTag(ch.inlineTags, DocTree.Kind.INHERIT_DOC); + return replaceLinksAndCodes(dctree); + } + + CommentHelper getInheritedInlineTags(CommentHelper input) { + CommentHelper output = input.copy(); + if (!output.hasInheritDocTag()&& !output.isSimpleOverride()) { + return output; + } + + CommentHelper inheritedSearchInput = input.copy(); + ExecutableElement overriddenMethod = utils.overriddenMethod((ExecutableElement) input.element); + + if (overriddenMethod != null) { + inheritedSearchInput.element = overriddenMethod; + CommentHelper ch = getInheritedInlineTags(inheritedSearchInput); + if (!ch.isSimpleOverride()) { + output = output.inherit(ch); + } + } + + TypeElement encl = utils.getEnclosingTypeElement(input.element); + List implementedMethods = utils.getImplementedMethods(input.element.toString(), encl, new ArrayList()); + for (Element implementedMethod : implementedMethods) { + inheritedSearchInput.element = implementedMethod; + CommentHelper ch = getInheritedInlineTags(inheritedSearchInput); + if (!ch.isSimpleOverride()) { + output = output.inherit(ch); + } + } + + return output; + } } diff --git a/src/main/java/com/microsoft/lookup/ClassLookup.java b/src/main/java/com/microsoft/lookup/ClassLookup.java index e875836..f5c67cb 100644 --- a/src/main/java/com/microsoft/lookup/ClassLookup.java +++ b/src/main/java/com/microsoft/lookup/ClassLookup.java @@ -3,7 +3,7 @@ import com.microsoft.lookup.model.ExtendedMetadataFileItem; import com.microsoft.model.MetadataFileItem; import com.microsoft.model.TypeParameter; -import com.microsoft.util.ElementUtil; +import com.microsoft.util.Utils; import jdk.javadoc.doclet.DocletEnvironment; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -146,7 +146,7 @@ void appendInheritedMethods(TypeElement element, List .orElse(0); for (Element m : members) { - if (m.getKind() == ElementKind.METHOD && !ElementUtil.isPrivateOrPackagePrivate(m)) { + if (m.getKind() == ElementKind.METHOD && !Utils.isPrivateOrPackagePrivate(m)) { String uid = element.getQualifiedName().toString().concat(".") + String.valueOf(m); ExtendedMetadataFileItem item = new ExtendedMetadataFileItem(uid); diff --git a/src/main/java/com/microsoft/model/MetadataFileItem.java b/src/main/java/com/microsoft/model/MetadataFileItem.java index 4d2134d..d953ea7 100644 --- a/src/main/java/com/microsoft/model/MetadataFileItem.java +++ b/src/main/java/com/microsoft/model/MetadataFileItem.java @@ -11,7 +11,7 @@ import org.apache.commons.lang3.RegExUtils; @JsonPropertyOrder({"uid", "id", "parent", "children", "href", "langs", "isExternal", "name", "nameWithType", - "fullName", "overload", "type", "package", "summary", "syntax", "inheritance", "implements", "exceptions", + "fullName", "overload", "overridden", "type", "package", "summary", "syntax", "inheritance", "implements", "exceptions", "spec.java", "inheritedMembers"}) public class MetadataFileItem implements Comparable { @@ -25,6 +25,7 @@ public class MetadataFileItem implements Comparable { private String nameWithType; private String fullName; private String overload; + private String overridden; private String type; @JsonProperty("package") private String packageName; @@ -232,6 +233,14 @@ public void setReturn(Return returnValue) { syntax.setReturnValue(returnValue); } + public void setOverridden(String overridden) { + this.overridden = overridden; + } + + public String getOverridden() { + return overridden; + } + @Override public boolean equals(Object o) { if (this == o) { diff --git a/src/main/java/com/microsoft/util/CommentHelper.java b/src/main/java/com/microsoft/util/CommentHelper.java new file mode 100644 index 0000000..f15ff25 --- /dev/null +++ b/src/main/java/com/microsoft/util/CommentHelper.java @@ -0,0 +1,89 @@ +package com.microsoft.util; + +import com.sun.source.doctree.DocTree; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +import javax.lang.model.element.Element; + +public class CommentHelper { + public Element element; + public List inlineTags = Collections.emptyList(); + private Utils utils; + private boolean hasInheritDocTag = false; + + public CommentHelper(Element element, Utils utils) { + this.element = element; + this.utils = utils; + this.inlineTags = utils.getFullBody(element); + this.hasInheritDocTag = utils.hasInlineTag(inlineTags, DocTree.Kind.INHERIT_DOC); + } + + public CommentHelper(Element element, Utils utils, List inlineTags) { + this.element = element; + this.utils = utils; + this.inlineTags = inlineTags; + this.hasInheritDocTag = utils.hasInlineTag(inlineTags, DocTree.Kind.INHERIT_DOC); + } + + /** + * Returns true if the method has no comments, or a lone @inheritDoc. + * + * @return true if there are no comments, false otherwise + */ + public boolean isSimpleOverride() { + return inlineTags.isEmpty() || + (inlineTags.size() == 1 && hasInheritDocTag); + } + + public boolean hasInheritDocTag(){ + return this.hasInheritDocTag; + } + + public CommentHelper copy() { + if (this.element == null) { + throw new NullPointerException(); + } + CommentHelper clone = new CommentHelper(this.element, this.utils); + return clone; + } + + public CommentHelper inherit(CommentHelper chInheritFrom) { + List mergedTags = new ArrayList<>(); + + if (this.isSimpleOverride()) + mergedTags = chInheritFrom.inlineTags; + else { + mergedTags = inheritInlineTags(this, chInheritFrom); + } + + return new CommentHelper(this.element, this.utils, mergedTags); + } + + List inheritInlineTags(CommentHelper origin, CommentHelper chInheritFrom) { + List mergedTags = new ArrayList<>(); + if (!origin.isSimpleOverride() && !origin.hasInheritDocTag) { + return origin.inlineTags; + } + + // Get the index of "{@inheritedDoc}". + int index = origin.inlineTags.stream().map(e -> e.getKind()) + .collect(Collectors.toList()) + .indexOf(DocTree.Kind.INHERIT_DOC); + + // Replace the "{@inheritedDoc}" with inherited inlineTags. + mergedTags = origin.inlineTags.stream().collect(Collectors.toList()); + mergedTags.remove(index); + + for (DocTree d : chInheritFrom.inlineTags + ) { + mergedTags.add(index, d); + index++; + } + + return mergedTags; + } +} diff --git a/src/main/java/com/microsoft/util/ElementUtil.java b/src/main/java/com/microsoft/util/ElementUtil.java index 0f850ea..fa83605 100644 --- a/src/main/java/com/microsoft/util/ElementUtil.java +++ b/src/main/java/com/microsoft/util/ElementUtil.java @@ -3,7 +3,6 @@ import org.apache.commons.lang3.StringUtils; import javax.lang.model.element.Element; -import javax.lang.model.element.Modifier; import javax.lang.model.element.PackageElement; import javax.lang.model.element.TypeElement; import javax.lang.model.util.ElementFilter; @@ -28,7 +27,10 @@ public ElementUtil(String[] excludePackages, String[] excludeClasses) { public List extractSortedElements(Element element) { // Need to apply sorting, because order of result items for Element.getEnclosedElements() depend on JDK implementation + // By default, exclude private and package-private items + // todo allow pass parameter for filter items by access modifiers return ElementFilter.typesIn(element.getEnclosedElements()).stream() + .filter(o -> !Utils.isPrivateOrPackagePrivate(o)) .filter(o -> !matchAnyPattern(excludeClasses, String.valueOf(o.getQualifiedName()))) .sorted((o1, o2) -> StringUtils.compare(String.valueOf(o1.getSimpleName()), String.valueOf(o2.getSimpleName())) @@ -51,24 +53,4 @@ boolean matchAnyPattern(Set patterns, String stringToCheck) { } return false; } - - public static boolean isPackagePrivate(Element e) { - return !(isPublic(e) || isPrivate(e) || isProtected(e)); - } - - public static boolean isPrivate(Element e) { - return e.getModifiers().contains(Modifier.PRIVATE); - } - - public static boolean isProtected(Element e) { - return e.getModifiers().contains(Modifier.PROTECTED); - } - - public static boolean isPublic(Element e) { - return e.getModifiers().contains(Modifier.PUBLIC); - } - - public static boolean isPrivateOrPackagePrivate(Element e) { - return isPrivate(e) || isPackagePrivate(e); - } } diff --git a/src/main/java/com/microsoft/util/Utils.java b/src/main/java/com/microsoft/util/Utils.java new file mode 100644 index 0000000..df8e08b --- /dev/null +++ b/src/main/java/com/microsoft/util/Utils.java @@ -0,0 +1,261 @@ +package com.microsoft.util; + +import com.sun.source.doctree.DocCommentTree; +import com.sun.source.doctree.DocTree; + +import javax.lang.model.element.*; +import javax.lang.model.type.TypeKind; +import javax.lang.model.type.TypeMirror; +import javax.lang.model.util.Elements; +import javax.lang.model.util.SimpleElementVisitor9; +import javax.lang.model.util.Types; + +import java.util.*; +import java.util.stream.Collectors; + +import jdk.javadoc.doclet.DocletEnvironment; + +import static com.sun.source.doctree.DocTree.Kind.ERRONEOUS; +import static javax.lang.model.type.TypeKind.DECLARED; + +public class Utils { + + public final DocletEnvironment docletEnvironment; + public final Elements elementUtils; + public final Types typeUtils; + + public Utils(DocletEnvironment docEnv) { + docletEnvironment = docEnv; + elementUtils = docEnv.getElementUtils(); + typeUtils = docEnv.getTypeUtils(); + } + + public static boolean isPackagePrivate(Element e) { + return !(isPublic(e) || isPrivate(e) || isProtected(e)); + } + + public static boolean isPrivate(Element e) { + return e.getModifiers().contains(Modifier.PRIVATE); + } + + public static boolean isProtected(Element e) { + return e.getModifiers().contains(Modifier.PROTECTED); + } + + public static boolean isPublic(Element e) { + return e.getModifiers().contains(Modifier.PUBLIC); + } + + public static boolean isPrivateOrPackagePrivate(Element e) { + return isPrivate(e) || isPackagePrivate(e); + } + + public static boolean isNoType(TypeMirror t) { + return t.getKind() == TypeKind.NONE; + } + + public boolean isStatic(Element e) { + return e.getModifiers().contains(Modifier.STATIC); + } + + /** + * Returns true if the method has no comments, or a lone @inheritDoc. + * + * @param m a method + * @return true if there are no comments, false otherwise + */ + public boolean isSimpleOverride(ExecutableElement m) { + + if (!getBlockTags(m).isEmpty()) + return false; + + List fullBody = getFullBody(m); + return fullBody.isEmpty() || + (fullBody.size() == 1 && fullBody.get(0).getKind().equals(DocTree.Kind.INHERIT_DOC)); + } + + public boolean hasInlineTag(List inlineTags, DocTree.Kind kind) { + for (DocTree dt : inlineTags) { + if (dt.getKind() == kind) { + return true; + } + } + return false; + } + + public Element getMemberBySignature(TypeElement te, ElementKind kind, String signature) { + return getMembers(te, kind).stream() + .filter(e -> e.toString().equals(signature)) + .findFirst().orElse(null); + } + + public TypeElement getObjectType() { + return elementUtils.getTypeElement("java.lang.Object"); + } + + /** + * Return the element of given type. + */ + public TypeElement asTypeElement(TypeMirror t) { + if (t.getKind() != TypeKind.NONE) { + TypeElement element = (TypeElement) docletEnvironment.getTypeUtils().asElement(t); + return element; + } else return null; + } + + /** + * Return the lexically enclosing element for a nested type. + * The inherited items will not be listed. + */ + public TypeElement getEnclosingTypeElement(Element e) { + if (e.getKind() == ElementKind.PACKAGE) + return null; + Element encl = e.getEnclosingElement(); + ElementKind kind = encl.getKind(); + if (kind == ElementKind.PACKAGE) + return null; + while (!(kind.isClass() || kind.isInterface())) { + encl = encl.getEnclosingElement(); + kind = encl.getKind(); + } + return (TypeElement) encl; + } + + /** + * Follow the same behavior with Standard doclet. + * Return the ExecutableElement being overridden by given method, + * when a method in a class overrides a method in a superclass. + * For following cases, they will be marked as "Specified by": + *
    + *
  • a method in an interface overrides a method in a superinterface
  • + *
  • a method in a class implements a method in an interface
  • + *
+ * todo add "Specified by" to yaml. + */ + public ExecutableElement overriddenMethod(ExecutableElement method) { + if (isStatic(method)) { + return null; + } + final TypeElement origin = getEnclosingTypeElement(method); + for (TypeMirror t = getSuperType(origin); + t.getKind() == DECLARED; + t = getSuperType(asTypeElement(t))) { + TypeElement te = asTypeElement(t); + if (te == null) { + return null; + } + + for (Element e : getMembers(te, ElementKind.METHOD)) { + ExecutableElement ee = (ExecutableElement) e; + if (elementUtils.overrides(method, ee, origin) + ) { + return ee; + } + } + if (t.equals(getObjectType().asType())) + return null; + } + return null; + } + + public TypeMirror getSuperType(TypeElement te) { + TypeMirror t = te.getSuperclass(); + return getType(t); + } + + private TypeMirror getType(TypeMirror t) { + return (isNoType(t)) ? getObjectType().asType() : t; + } + + public Optional getDocCommentTree(Element element) { + return Optional.ofNullable(docletEnvironment.getDocTrees().getDocCommentTree(element)); + } + + protected List getFullBody(Element element) { + return getDocCommentTree(element) + .map(DocCommentTree::getFullBody) + .orElse(Collections.emptyList()); + } + + public static List filteredList(List dlist, DocTree.Kind... select) { + List list = new ArrayList<>(); + if (select == null) + return dlist; + for (DocTree dt : dlist) { + if (dt.getKind() != ERRONEOUS) { + for (DocTree.Kind kind : select) { + if (dt.getKind() == kind) { + list.add(dt); + } + } + } + } + return list; + } + + private List getBlockTags0(Element element, DocTree.Kind... kinds) { + Optional dcTree = getDocCommentTree(element); + if (dcTree.isEmpty()) + return Collections.emptyList(); + + return filteredList(dcTree.get().getBlockTags(), kinds); + } + + public List getBlockTags(Element element) { + return getBlockTags0(element, (DocTree.Kind[]) null); + } + + public List removeBlockTag(List dctree, DocTree.Kind kind) { + return dctree.stream() + .filter(dc -> !dc.getKind().equals(kind)) + .collect(Collectors.toList()); + } + + /** + * Returns a list of visible enclosed members of given kind, + * declared in this type element, and does not include + * any inherited members or extra members. + * + * @return a list of visible enclosed members in this type + */ + public List getMembers(TypeElement te, ElementKind kind) { + return te.getEnclosedElements().stream() + .filter(e -> e.getKind() == kind && !isPrivateOrPackagePrivate(e)) + .collect(Collectors.toList()); + } + + /** + * Returns a list of methods being implemented by given method. + * When a method in an interface overrides a method its superinterface, + * it will be considered as "implemented", instead of "overridden". + * + * @return a list of implemented methods + */ + public List getImplementedMethods(String signature, TypeElement encl, List implementedMethods) { + if (encl == null) { + return implementedMethods; + } + + for (TypeElement interfaceType : getImplementedInterfaces(encl)) { + Element implementedMethod = getMemberBySignature(interfaceType, ElementKind.METHOD, signature); + if (implementedMethod != null) { + implementedMethods.add(implementedMethod); + } + // We need to search every implemented interface of the Inheritance chain. + getImplementedMethods(signature, interfaceType, implementedMethods); + } + return implementedMethods; + } + + /** + * Returns a list of implemented interface type elements of given type element. + * Follow Standard doclet, search in the order of appearance following the word implements in declaration. + * + * @return a list of implemented interfaces + */ + public List getImplementedInterfaces(TypeElement element) { + return element.getInterfaces().stream() + .map(e -> asTypeElement(e)) + .collect(Collectors.toList()); + } +} diff --git a/src/test/java/com/microsoft/samples/SuperHero.java b/src/test/java/com/microsoft/samples/SuperHero.java index 25d2da2..54276e6 100644 --- a/src/test/java/com/microsoft/samples/SuperHero.java +++ b/src/test/java/com/microsoft/samples/SuperHero.java @@ -39,7 +39,7 @@ public SuperHero(String heroName, String uniquePower, int health, int defense) { *

* * @param incomingDamage the amount of incoming damage for {@link SuperHero} - * @param damageType type of damage with similar word damageTypeLong, sure + * @param damageType type of damage with similar word damageTypeLong, sure * @return the amount of health hero has after attack * @throws IllegalArgumentException when incomingDamage is negative and thanks for {@link Exception} * @version 1.2 @@ -84,11 +84,11 @@ public void setUniquePower(String uniquePower) { this.uniquePower = uniquePower; } - public int getHealth() { + protected int getHealth() { return health; } - public void setHealth(int health) { + protected void setHealth(int health) { this.health = health; } @@ -100,7 +100,11 @@ public void setDefense(int defense) { this.defense = defense; } - private void somePrivateMethod() {} + private void setHobby(String hobby) { + this.hobby = hobby; + } - void somePackagePrivateMethod() {} + String getHobby() { + return hobby; + } } diff --git a/src/test/java/com/microsoft/samples/commentinheritance/Animal.java b/src/test/java/com/microsoft/samples/commentinheritance/Animal.java new file mode 100644 index 0000000..8e2c8fb --- /dev/null +++ b/src/test/java/com/microsoft/samples/commentinheritance/Animal.java @@ -0,0 +1,28 @@ +package com.microsoft.samples.commentinheritance; + +/** + * Animal. + */ +public abstract class Animal implements Organism{ + /** + * Breathe. + */ + public void breathe() { + } + + /** + * Communicate verbally. + */ + public abstract void verballyCommunicate(); + + /** + * Feed offspring. + */ + public abstract void feed(); + + /** + * {@inheritDoc} + * Get kind from Animal. + */ + public abstract String getKind(); +} diff --git a/src/test/java/com/microsoft/samples/commentinheritance/Carnivorous.java b/src/test/java/com/microsoft/samples/commentinheritance/Carnivorous.java new file mode 100644 index 0000000..96811e0 --- /dev/null +++ b/src/test/java/com/microsoft/samples/commentinheritance/Carnivorous.java @@ -0,0 +1,18 @@ +package com.microsoft.samples.commentinheritance; + +/** + * Marks an Animal that eats other animals. + */ +public interface Carnivorous { + /** + * Eat the provided animal. + * + * @param animalBeingEaten Animal that will be eaten. + */ + void eat(Animal animalBeingEaten); + + /** + * Get kind from Carnivorous. + */ + String getKind(); +} diff --git a/src/test/java/com/microsoft/samples/commentinheritance/Dog.java b/src/test/java/com/microsoft/samples/commentinheritance/Dog.java new file mode 100644 index 0000000..da6ca7a --- /dev/null +++ b/src/test/java/com/microsoft/samples/commentinheritance/Dog.java @@ -0,0 +1,71 @@ +package com.microsoft.samples.commentinheritance; + +import java.awt.Color; + +import static java.lang.System.out; + +/** + * Canine and man's best friend. + */ +public class Dog extends Mammal implements Omnivorous, Viviparous { + private final Color hairColor = null; + + /** + * {@inheritDoc} + * + * @param otherAnimal Tasty treat. + */ + @Override + public void eat(final Animal otherAnimal) { + } + + /** + * {@inheritDoc} + * + * @param plantToBeEaten Plant that this dog will eat. + */ + @Override + public void eat(final Plant plantToBeEaten) { + } + + /** + * {@inheritDoc} Bark. + */ + public void verballyCommunicate() { + out.println("Woof!"); + } + + /** + * {@inheritDoc} + * + * @param numberPuppies Number of puppies being born. + */ + @Override + public void giveBirth(final int numberPuppies) { + } + + /** + * Provide the color of the dog's hair. + * + * @return Color of the dog's fur. + */ + public Color getHairColor() { + return hairColor; + } + + /** + * {@inheritDoc} + */ + @Override + public void feed() { + } + + /** + * {@inheritDoc} + * Get kind from Dog. + */ + @Override + public String getKind() { + return "Dog"; + } +} diff --git a/src/test/java/com/microsoft/samples/commentinheritance/Herbivorous.java b/src/test/java/com/microsoft/samples/commentinheritance/Herbivorous.java new file mode 100644 index 0000000..32abea1 --- /dev/null +++ b/src/test/java/com/microsoft/samples/commentinheritance/Herbivorous.java @@ -0,0 +1,22 @@ +package com.microsoft.samples.commentinheritance; + +/** + * Marks animals that eat plants. + */ +public interface Herbivorous { + /** + * Eat the provided plant. + * + * @param plantToBeEaten Plant that will be eaten. + */ + void eat(Plant plantToBeEaten); + + /** + * Get kind from Herbivorous. + */ + String getKind(); + + public class Plant { + } + +} diff --git a/src/test/java/com/microsoft/samples/commentinheritance/Mammal.java b/src/test/java/com/microsoft/samples/commentinheritance/Mammal.java new file mode 100644 index 0000000..a72edc1 --- /dev/null +++ b/src/test/java/com/microsoft/samples/commentinheritance/Mammal.java @@ -0,0 +1,13 @@ +package com.microsoft.samples.commentinheritance; + +/** + * Mammal. + */ +public abstract class Mammal extends Animal { + + /** + * {@inheritDoc} + * Get kind from Mammal. + */ + public abstract String getKind(); +} diff --git a/src/test/java/com/microsoft/samples/commentinheritance/Omnivorous.java b/src/test/java/com/microsoft/samples/commentinheritance/Omnivorous.java new file mode 100644 index 0000000..b5686eb --- /dev/null +++ b/src/test/java/com/microsoft/samples/commentinheritance/Omnivorous.java @@ -0,0 +1,19 @@ +package com.microsoft.samples.commentinheritance; + +/** + * Eats plants and animals. + */ +public interface Omnivorous extends Carnivorous, Herbivorous { + @Override + void eat(Animal animalToBeEaten); + + @Override + void eat(Plant plantToBeEaten); + + /** + * {@inheritDoc} + * Get kind from Omnivorous. + */ + @Override + String getKind(); +} diff --git a/src/test/java/com/microsoft/samples/commentinheritance/Organism.java b/src/test/java/com/microsoft/samples/commentinheritance/Organism.java new file mode 100644 index 0000000..8edf9a6 --- /dev/null +++ b/src/test/java/com/microsoft/samples/commentinheritance/Organism.java @@ -0,0 +1,9 @@ +package com.microsoft.samples.commentinheritance; + +public interface Organism { + + /** + * Get kind from Organism. + */ + String getKind(); +} diff --git a/src/test/java/com/microsoft/samples/commentinheritance/Viviparous.java b/src/test/java/com/microsoft/samples/commentinheritance/Viviparous.java new file mode 100644 index 0000000..685eba4 --- /dev/null +++ b/src/test/java/com/microsoft/samples/commentinheritance/Viviparous.java @@ -0,0 +1,14 @@ +package com.microsoft.samples.commentinheritance; + +/** + * Mammals that give birth to young that develop within the mother's body. + */ +public interface Viviparous { + + void giveBirth(int numberOfOffspring); + + /** + * Get kind from Viviparous. + */ + String getKind(); +} diff --git a/src/test/java/com/microsoft/samples/subpackage/CustomException.java b/src/test/java/com/microsoft/samples/subpackage/CustomException.java index 4f7d02a..8717af6 100644 --- a/src/test/java/com/microsoft/samples/subpackage/CustomException.java +++ b/src/test/java/com/microsoft/samples/subpackage/CustomException.java @@ -14,4 +14,8 @@ public CustomException(String message) { public void makeSomething() throws CustomException { throw new CustomException("It happened!"); } + + private class PrivateException { + private String message; + } } diff --git a/src/test/java/com/microsoft/samples/subpackage/InternalException.java b/src/test/java/com/microsoft/samples/subpackage/InternalException.java new file mode 100644 index 0000000..c868a4c --- /dev/null +++ b/src/test/java/com/microsoft/samples/subpackage/InternalException.java @@ -0,0 +1,8 @@ +package com.microsoft.samples.subpackage; + +class InternalException extends Exception { + + public InternalException(String message) { + super(message); + } +} diff --git a/src/test/java/com/microsoft/util/ElementUtilTest.java b/src/test/java/com/microsoft/util/ElementUtilTest.java index 4d3780c..cf2b871 100644 --- a/src/test/java/com/microsoft/util/ElementUtilTest.java +++ b/src/test/java/com/microsoft/util/ElementUtilTest.java @@ -55,13 +55,23 @@ public void extractPackageElements() { public void extractSortedElements() { Element element = elements.getPackageElement("com.microsoft.samples.subpackage"); - List result = elementUtil.extractSortedElements(element) + List allElements = element.getEnclosedElements() + .stream().map(String::valueOf).collect(Collectors.toList()); + + // Ensure items to exclude exist. + assertThat("Wrong enclosed elements number", allElements.size(), is(6)); + assertThat("Unexpected package private class", allElements.contains("com.microsoft.samples.subpackage.InternalException"), is(true)); + assertThat("Unexpected to-exclude class", allElements.contains("com.microsoft.samples.subpackage.SomeExcludedClass"), is(true)); + + + List extractedElements = elementUtil.extractSortedElements(element) .stream().map(String::valueOf).collect(Collectors.toList()); - assertThat("Wrong result list size", result.size(), is(4)); - assertThat("Unexpected first item", result.get(0), is("com.microsoft.samples.subpackage.CustomException")); - assertThat("Unexpected second item", result.get(1), is("com.microsoft.samples.subpackage.Display")); - assertThat("Unexpected third item", result.get(2), is("com.microsoft.samples.subpackage.Person")); + // Verify filtered and sorted result + assertThat("Wrong result list size", extractedElements.size(), is(4)); + assertThat("Unexpected first item in the result list after invoke method extractSortedElements()", extractedElements.get(0), is("com.microsoft.samples.subpackage.CustomException")); + assertThat("Unexpected second item in the result list after invoke method extractSortedElements()", extractedElements.get(1), is("com.microsoft.samples.subpackage.Display")); + assertThat("Unexpected third item in the result list after invoke method extractSortedElements()", extractedElements.get(2), is("com.microsoft.samples.subpackage.Person")); } @Test @@ -73,28 +83,4 @@ public void matchAnyPattern() { assertFalse(elementUtil.matchAnyPattern(patterns, "EngineFive")); assertFalse(elementUtil.matchAnyPattern(patterns, "com.ms.Awesome")); } - - @Test - public void isPackagePrivate() { - Element element = elements.getTypeElement("com.microsoft.samples.SuperHero"); - - List result = element.getEnclosedElements() - .stream().filter(e -> ElementUtil.isPackagePrivate(e)).collect(Collectors.toList()); - - assertThat("Wrong result list size", result.size(), is(2)); - assertThat("Unexpected package private field", String.valueOf(result.get(0)), is("hobby")); - assertThat("Unexpected package private method", String.valueOf(result.get(1)), is("somePackagePrivateMethod()")); - } - - @Test - public void isPrivateOrPackagePrivate() { - Element element = elements.getTypeElement("com.microsoft.samples.SuperHero"); - - List result = element.getEnclosedElements() - .stream().filter(e -> ElementUtil.isPrivateOrPackagePrivate(e)).collect(Collectors.toList()); - - assertThat("Wrong result list size", result.size(), is(7)); - assertThat("Unexpected private method", String.valueOf(result.get(5)), is("somePrivateMethod()")); - assertThat("Unexpected package private method", String.valueOf(result.get(6)), is("somePackagePrivateMethod()")); - } } diff --git a/src/test/java/com/microsoft/util/UtilsTest.java b/src/test/java/com/microsoft/util/UtilsTest.java new file mode 100644 index 0000000..679dbd8 --- /dev/null +++ b/src/test/java/com/microsoft/util/UtilsTest.java @@ -0,0 +1,100 @@ +package com.microsoft.util; + +import java.util.List; +import java.util.stream.Collectors; + +import javax.lang.model.element.Element; +import javax.lang.model.element.ElementKind; +import javax.lang.model.util.Elements; + +import org.junit.*; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.mockito.junit.MockitoJUnitRunner; + +import com.google.testing.compile.CompilationRule; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.*; + +@RunWith(MockitoJUnitRunner.class) +public class UtilsTest { + + @Rule + public CompilationRule rule = new CompilationRule(); + private Elements elements; + private List allElements; + + @Before + public void setup() { + elements = rule.getElements(); + Element element = elements.getTypeElement("com.microsoft.samples.SuperHero"); + allElements = element.getEnclosedElements().stream().collect(Collectors.toList()); + } + + // Test isPackagePrivate() method + @Test + public void isPackagePrivate_True_PackagePrivateMethod() { + Element method = getElementByKindAndName(allElements, ElementKind.METHOD, "getHobby()"); + assertThat(Utils.isPackagePrivate(method), is(true)); + } + + @Test + public void isPackagePrivate_True_PackagePrivateField() { + Element field = getElementByKindAndName(allElements, ElementKind.FIELD, "hobby"); + assertThat(Utils.isPackagePrivate(field), is(true)); + } + + // Test isPrivate() method + @Test + public void isPrivate_True_PrivateMethod() { + Element method = getElementByKindAndName(allElements, ElementKind.METHOD, "setHobby(java.lang.String)"); + assertThat(Utils.isPrivate(method), is(true)); + } + + @Test + public void isPrivate_True_PrivateField() { + Element field = getElementByKindAndName(allElements, ElementKind.FIELD, "uniquePower"); + assertThat(Utils.isPrivate(field), is(true)); + } + + // Test isPrivateOrPackagePrivate() method + @Test + public void isPrivateOrPackagePrivate_True_PackagePrivateMethod() { + Element method = getElementByKindAndName(allElements, ElementKind.METHOD, "getHobby()"); + assertThat(Utils.isPrivateOrPackagePrivate(method), is(true)); + } + + @Test + public void isPrivateOrPackagePrivate_True_PrivateFiled() { + Element field = getElementByKindAndName(allElements, ElementKind.FIELD, "uniquePower"); + assertThat(Utils.isPrivateOrPackagePrivate(field), is(true)); + } + + @Test + public void isPrivateOrPackagePrivate_False_PublicMethod() { + Element method = getElementByKindAndName(allElements, ElementKind.METHOD, "getUniquePower()"); + assertThat(Utils.isPrivateOrPackagePrivate(method), is(false)); + } + + @Test + public void isPrivateOrPackagePrivate_False_PublicField() { + Element field = getElementByKindAndName(allElements, ElementKind.FIELD, "SOME_PUBLIC_STRING"); + assertThat(Utils.isPrivateOrPackagePrivate(field), is(false)); + } + + @Test + public void isPrivateOrPackagePrivate_False_ProtectedMethod() { + Element method = getElementByKindAndName(allElements, ElementKind.METHOD, "getHealth()"); + assertThat(Utils.isPrivateOrPackagePrivate(method), is(false)); + } + + private Element getElementByKindAndName(List elements, ElementKind elementKind, String name) { + return elements.stream() + .filter(e -> e.toString().equals(name)) + .filter(e -> e.getKind() == elementKind) + .findFirst().orElse(null); + } +} diff --git a/src/test/resources/expected-generated-files/com.microsoft.samples.BasePartnerComponentString.yml b/src/test/resources/expected-generated-files/com.microsoft.samples.BasePartnerComponentString.yml index d1f9f3d..6cee6d7 100644 --- a/src/test/resources/expected-generated-files/com.microsoft.samples.BasePartnerComponentString.yml +++ b/src/test/resources/expected-generated-files/com.microsoft.samples.BasePartnerComponentString.yml @@ -82,6 +82,7 @@ items: nameWithType: "BasePartnerComponentString.testInherited()" fullName: "com.microsoft.samples.BasePartnerComponentString.testInherited()" overload: "com.microsoft.samples.BasePartnerComponentString.testInherited*" + overridden: "com.microsoft.samples.BasePartnerComponent.testInherited()" type: "Method" package: "com.microsoft.samples" syntax: diff --git a/src/test/resources/expected-generated-files/com.microsoft.samples.SuperHero.yml b/src/test/resources/expected-generated-files/com.microsoft.samples.SuperHero.yml index b63bd8b..6a03c93 100644 --- a/src/test/resources/expected-generated-files/com.microsoft.samples.SuperHero.yml +++ b/src/test/resources/expected-generated-files/com.microsoft.samples.SuperHero.yml @@ -128,7 +128,7 @@ items: type: "Method" package: "com.microsoft.samples" syntax: - content: "public int getHealth()" + content: "protected int getHealth()" return: type: "int" - uid: "com.microsoft.samples.SuperHero.getHeroName()" @@ -155,6 +155,7 @@ items: nameWithType: "SuperHero.getLastName()" fullName: "com.microsoft.samples.SuperHero.getLastName()" overload: "com.microsoft.samples.SuperHero.getLastName*" + overridden: "com.microsoft.samples.subpackage.Person.getLastName()" type: "Method" package: "com.microsoft.samples" summary: "Get capitalized last name. But it's not the end, because of multiline comment" @@ -206,7 +207,7 @@ items: type: "Method" package: "com.microsoft.samples" syntax: - content: "public void setHealth(int health)" + content: "protected void setHealth(int health)" parameters: - id: "health" type: "int" diff --git a/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Animal.yml b/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Animal.yml new file mode 100644 index 0000000..61424db --- /dev/null +++ b/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Animal.yml @@ -0,0 +1,187 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.commentinheritance.Animal" + id: "Animal" + parent: "com.microsoft.samples.commentinheritance" + children: + - "com.microsoft.samples.commentinheritance.Animal.Animal()" + - "com.microsoft.samples.commentinheritance.Animal.breathe()" + - "com.microsoft.samples.commentinheritance.Animal.feed()" + - "com.microsoft.samples.commentinheritance.Animal.getKind()" + - "com.microsoft.samples.commentinheritance.Animal.verballyCommunicate()" + langs: + - "java" + name: "Animal" + nameWithType: "Animal" + fullName: "com.microsoft.samples.commentinheritance.Animal" + type: "Class" + package: "com.microsoft.samples.commentinheritance" + summary: "Animal." + syntax: + content: "public abstract class Animal implements Organism" + inheritance: + - "java.lang.Object" + implements: + - "com.microsoft.samples.commentinheritance.Organism" + inheritedMembers: + - "java.lang.Object.clone()" + - "java.lang.Object.equals(java.lang.Object)" + - "java.lang.Object.finalize()" + - "java.lang.Object.getClass()" + - "java.lang.Object.hashCode()" + - "java.lang.Object.notify()" + - "java.lang.Object.notifyAll()" + - "java.lang.Object.toString()" + - "java.lang.Object.wait()" + - "java.lang.Object.wait(long)" + - "java.lang.Object.wait(long,int)" +- uid: "com.microsoft.samples.commentinheritance.Animal.Animal()" + id: "Animal()" + parent: "com.microsoft.samples.commentinheritance.Animal" + langs: + - "java" + name: "Animal()" + nameWithType: "Animal.Animal()" + fullName: "com.microsoft.samples.commentinheritance.Animal.Animal()" + overload: "com.microsoft.samples.commentinheritance.Animal.Animal*" + type: "Constructor" + package: "com.microsoft.samples.commentinheritance" + syntax: + content: "public Animal()" +- uid: "com.microsoft.samples.commentinheritance.Animal.breathe()" + id: "breathe()" + parent: "com.microsoft.samples.commentinheritance.Animal" + langs: + - "java" + name: "breathe()" + nameWithType: "Animal.breathe()" + fullName: "com.microsoft.samples.commentinheritance.Animal.breathe()" + overload: "com.microsoft.samples.commentinheritance.Animal.breathe*" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + summary: "Breathe." + syntax: + content: "public void breathe()" +- uid: "com.microsoft.samples.commentinheritance.Animal.feed()" + id: "feed()" + parent: "com.microsoft.samples.commentinheritance.Animal" + langs: + - "java" + name: "feed()" + nameWithType: "Animal.feed()" + fullName: "com.microsoft.samples.commentinheritance.Animal.feed()" + overload: "com.microsoft.samples.commentinheritance.Animal.feed*" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + summary: "Feed offspring." + syntax: + content: "public abstract void feed()" +- uid: "com.microsoft.samples.commentinheritance.Animal.getKind()" + id: "getKind()" + parent: "com.microsoft.samples.commentinheritance.Animal" + langs: + - "java" + name: "getKind()" + nameWithType: "Animal.getKind()" + fullName: "com.microsoft.samples.commentinheritance.Animal.getKind()" + overload: "com.microsoft.samples.commentinheritance.Animal.getKind*" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + summary: "Get kind from Organism. Get kind from Animal." + syntax: + content: "public abstract String getKind()" + return: + type: "java.lang.String" +- uid: "com.microsoft.samples.commentinheritance.Animal.verballyCommunicate()" + id: "verballyCommunicate()" + parent: "com.microsoft.samples.commentinheritance.Animal" + langs: + - "java" + name: "verballyCommunicate()" + nameWithType: "Animal.verballyCommunicate()" + fullName: "com.microsoft.samples.commentinheritance.Animal.verballyCommunicate()" + overload: "com.microsoft.samples.commentinheritance.Animal.verballyCommunicate*" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + summary: "Communicate verbally." + syntax: + content: "public abstract void verballyCommunicate()" +references: +- uid: "com.microsoft.samples.commentinheritance.Animal.Animal*" + name: "Animal" + nameWithType: "Animal.Animal" + fullName: "com.microsoft.samples.commentinheritance.Animal.Animal" + package: "com.microsoft.samples.commentinheritance" +- uid: "com.microsoft.samples.commentinheritance.Animal.breathe*" + name: "breathe" + nameWithType: "Animal.breathe" + fullName: "com.microsoft.samples.commentinheritance.Animal.breathe" + package: "com.microsoft.samples.commentinheritance" +- uid: "com.microsoft.samples.commentinheritance.Animal.verballyCommunicate*" + name: "verballyCommunicate" + nameWithType: "Animal.verballyCommunicate" + fullName: "com.microsoft.samples.commentinheritance.Animal.verballyCommunicate" + package: "com.microsoft.samples.commentinheritance" +- uid: "com.microsoft.samples.commentinheritance.Animal.feed*" + name: "feed" + nameWithType: "Animal.feed" + fullName: "com.microsoft.samples.commentinheritance.Animal.feed" + package: "com.microsoft.samples.commentinheritance" +- uid: "java.lang.String" + spec.java: + - uid: "java.lang.String" + name: "String" + fullName: "java.lang.String" +- uid: "com.microsoft.samples.commentinheritance.Animal.getKind*" + name: "getKind" + nameWithType: "Animal.getKind" + fullName: "com.microsoft.samples.commentinheritance.Animal.getKind" + package: "com.microsoft.samples.commentinheritance" +- uid: "com.microsoft.samples.commentinheritance.Organism" + name: "Organism" + nameWithType: "Organism" + fullName: "com.microsoft.samples.commentinheritance.Organism" +- uid: "java.lang.Object.notify()" + name: "Object.notify()" + nameWithType: "Object.notify()" + fullName: "java.lang.Object.notify()" +- uid: "java.lang.Object.wait()" + name: "Object.wait()" + nameWithType: "Object.wait()" + fullName: "java.lang.Object.wait()" +- uid: "java.lang.Object.finalize()" + name: "Object.finalize()" + nameWithType: "Object.finalize()" + fullName: "java.lang.Object.finalize()" +- uid: "java.lang.Object.clone()" + name: "Object.clone()" + nameWithType: "Object.clone()" + fullName: "java.lang.Object.clone()" +- uid: "java.lang.Object.notifyAll()" + name: "Object.notifyAll()" + nameWithType: "Object.notifyAll()" + fullName: "java.lang.Object.notifyAll()" +- uid: "java.lang.Object.equals(java.lang.Object)" + name: "Object.equals(Object)" + nameWithType: "Object.equals(Object)" + fullName: "java.lang.Object.equals(java.lang.Object)" +- uid: "java.lang.Object.getClass()" + name: "Object.getClass()" + nameWithType: "Object.getClass()" + fullName: "java.lang.Object.getClass()" +- uid: "java.lang.Object.wait(long)" + name: "Object.wait(long)" + nameWithType: "Object.wait(long)" + fullName: "java.lang.Object.wait(long)" +- uid: "java.lang.Object.hashCode()" + name: "Object.hashCode()" + nameWithType: "Object.hashCode()" + fullName: "java.lang.Object.hashCode()" +- uid: "java.lang.Object.wait(long,int)" + name: "Object.wait(long,int)" + nameWithType: "Object.wait(long,int)" + fullName: "java.lang.Object.wait(long,int)" +- uid: "java.lang.Object.toString()" + name: "Object.toString()" + nameWithType: "Object.toString()" + fullName: "java.lang.Object.toString()" diff --git a/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Carnivorous.yml b/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Carnivorous.yml new file mode 100644 index 0000000..2d9e801 --- /dev/null +++ b/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Carnivorous.yml @@ -0,0 +1,72 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.commentinheritance.Carnivorous" + id: "Carnivorous" + parent: "com.microsoft.samples.commentinheritance" + children: + - "com.microsoft.samples.commentinheritance.Carnivorous.eat(com.microsoft.samples.commentinheritance.Animal)" + - "com.microsoft.samples.commentinheritance.Carnivorous.getKind()" + langs: + - "java" + name: "Carnivorous" + nameWithType: "Carnivorous" + fullName: "com.microsoft.samples.commentinheritance.Carnivorous" + type: "Interface" + package: "com.microsoft.samples.commentinheritance" + summary: "Marks an Animal that eats other animals." + syntax: + content: "public interface Carnivorous" +- uid: "com.microsoft.samples.commentinheritance.Carnivorous.eat(com.microsoft.samples.commentinheritance.Animal)" + id: "eat(com.microsoft.samples.commentinheritance.Animal)" + parent: "com.microsoft.samples.commentinheritance.Carnivorous" + langs: + - "java" + name: "eat(Animal animalBeingEaten)" + nameWithType: "Carnivorous.eat(Animal animalBeingEaten)" + fullName: "com.microsoft.samples.commentinheritance.Carnivorous.eat(Animal animalBeingEaten)" + overload: "com.microsoft.samples.commentinheritance.Carnivorous.eat*" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + summary: "Eat the provided animal." + syntax: + content: "public abstract void eat(Animal animalBeingEaten)" + parameters: + - id: "animalBeingEaten" + type: "com.microsoft.samples.commentinheritance.Animal" + description: "Animal that will be eaten." +- uid: "com.microsoft.samples.commentinheritance.Carnivorous.getKind()" + id: "getKind()" + parent: "com.microsoft.samples.commentinheritance.Carnivorous" + langs: + - "java" + name: "getKind()" + nameWithType: "Carnivorous.getKind()" + fullName: "com.microsoft.samples.commentinheritance.Carnivorous.getKind()" + overload: "com.microsoft.samples.commentinheritance.Carnivorous.getKind*" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + summary: "Get kind from Carnivorous." + syntax: + content: "public abstract String getKind()" + return: + type: "java.lang.String" +references: +- uid: "com.microsoft.samples.commentinheritance.Animal" + name: "Animal" + nameWithType: "Animal" + fullName: "com.microsoft.samples.commentinheritance.Animal" +- uid: "com.microsoft.samples.commentinheritance.Carnivorous.eat*" + name: "eat" + nameWithType: "Carnivorous.eat" + fullName: "com.microsoft.samples.commentinheritance.Carnivorous.eat" + package: "com.microsoft.samples.commentinheritance" +- uid: "java.lang.String" + spec.java: + - uid: "java.lang.String" + name: "String" + fullName: "java.lang.String" +- uid: "com.microsoft.samples.commentinheritance.Carnivorous.getKind*" + name: "getKind" + nameWithType: "Carnivorous.getKind" + fullName: "com.microsoft.samples.commentinheritance.Carnivorous.getKind" + package: "com.microsoft.samples.commentinheritance" diff --git a/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Dog.yml b/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Dog.yml new file mode 100644 index 0000000..dbd9414 --- /dev/null +++ b/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Dog.yml @@ -0,0 +1,308 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.commentinheritance.Dog" + id: "Dog" + parent: "com.microsoft.samples.commentinheritance" + children: + - "com.microsoft.samples.commentinheritance.Dog.Dog()" + - "com.microsoft.samples.commentinheritance.Dog.eat(com.microsoft.samples.commentinheritance.Animal)" + - "com.microsoft.samples.commentinheritance.Dog.eat(com.microsoft.samples.commentinheritance.Herbivorous.Plant)" + - "com.microsoft.samples.commentinheritance.Dog.feed()" + - "com.microsoft.samples.commentinheritance.Dog.getHairColor()" + - "com.microsoft.samples.commentinheritance.Dog.getKind()" + - "com.microsoft.samples.commentinheritance.Dog.giveBirth(int)" + - "com.microsoft.samples.commentinheritance.Dog.verballyCommunicate()" + langs: + - "java" + name: "Dog" + nameWithType: "Dog" + fullName: "com.microsoft.samples.commentinheritance.Dog" + type: "Class" + package: "com.microsoft.samples.commentinheritance" + summary: "Canine and man's best friend." + syntax: + content: "public class Dog extends Mammal implements Omnivorous, Viviparous" + inheritance: + - "java.lang.Object" + - "com.microsoft.samples.commentinheritance.Animal" + - "com.microsoft.samples.commentinheritance.Mammal" + implements: + - "com.microsoft.samples.commentinheritance.Omnivorous" + - "com.microsoft.samples.commentinheritance.Viviparous" + inheritedMembers: + - "com.microsoft.samples.commentinheritance.Animal.breathe()" + - "com.microsoft.samples.commentinheritance.Animal.feed()" + - "com.microsoft.samples.commentinheritance.Animal.verballyCommunicate()" + - "com.microsoft.samples.commentinheritance.Mammal.getKind()" + - "java.lang.Object.clone()" + - "java.lang.Object.equals(java.lang.Object)" + - "java.lang.Object.finalize()" + - "java.lang.Object.getClass()" + - "java.lang.Object.hashCode()" + - "java.lang.Object.notify()" + - "java.lang.Object.notifyAll()" + - "java.lang.Object.toString()" + - "java.lang.Object.wait()" + - "java.lang.Object.wait(long)" + - "java.lang.Object.wait(long,int)" +- uid: "com.microsoft.samples.commentinheritance.Dog.Dog()" + id: "Dog()" + parent: "com.microsoft.samples.commentinheritance.Dog" + langs: + - "java" + name: "Dog()" + nameWithType: "Dog.Dog()" + fullName: "com.microsoft.samples.commentinheritance.Dog.Dog()" + overload: "com.microsoft.samples.commentinheritance.Dog.Dog*" + type: "Constructor" + package: "com.microsoft.samples.commentinheritance" + syntax: + content: "public Dog()" +- uid: "com.microsoft.samples.commentinheritance.Dog.eat(com.microsoft.samples.commentinheritance.Animal)" + id: "eat(com.microsoft.samples.commentinheritance.Animal)" + parent: "com.microsoft.samples.commentinheritance.Dog" + langs: + - "java" + name: "eat(Animal otherAnimal)" + nameWithType: "Dog.eat(Animal otherAnimal)" + fullName: "com.microsoft.samples.commentinheritance.Dog.eat(Animal otherAnimal)" + overload: "com.microsoft.samples.commentinheritance.Dog.eat*" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + summary: "Eat the provided animal." + syntax: + content: "public void eat(Animal otherAnimal)" + parameters: + - id: "otherAnimal" + type: "com.microsoft.samples.commentinheritance.Animal" + description: "Tasty treat." +- uid: "com.microsoft.samples.commentinheritance.Dog.eat(com.microsoft.samples.commentinheritance.Herbivorous.Plant)" + id: "eat(com.microsoft.samples.commentinheritance.Herbivorous.Plant)" + parent: "com.microsoft.samples.commentinheritance.Dog" + langs: + - "java" + name: "eat(Herbivorous.Plant plantToBeEaten)" + nameWithType: "Dog.eat(Herbivorous.Plant plantToBeEaten)" + fullName: "com.microsoft.samples.commentinheritance.Dog.eat(Herbivorous.Plant plantToBeEaten)" + overload: "com.microsoft.samples.commentinheritance.Dog.eat*" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + summary: "Eat the provided plant." + syntax: + content: "public void eat(Herbivorous.Plant plantToBeEaten)" + parameters: + - id: "plantToBeEaten" + type: "com.microsoft.samples.commentinheritance.Herbivorous.Plant" + description: "Plant that this dog will eat." +- uid: "com.microsoft.samples.commentinheritance.Dog.feed()" + id: "feed()" + parent: "com.microsoft.samples.commentinheritance.Dog" + langs: + - "java" + name: "feed()" + nameWithType: "Dog.feed()" + fullName: "com.microsoft.samples.commentinheritance.Dog.feed()" + overload: "com.microsoft.samples.commentinheritance.Dog.feed*" + overridden: "com.microsoft.samples.commentinheritance.Animal.feed()" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + summary: "Feed offspring." + syntax: + content: "public void feed()" +- uid: "com.microsoft.samples.commentinheritance.Dog.getHairColor()" + id: "getHairColor()" + parent: "com.microsoft.samples.commentinheritance.Dog" + langs: + - "java" + name: "getHairColor()" + nameWithType: "Dog.getHairColor()" + fullName: "com.microsoft.samples.commentinheritance.Dog.getHairColor()" + overload: "com.microsoft.samples.commentinheritance.Dog.getHairColor*" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + summary: "Provide the color of the dog's hair." + syntax: + content: "public Color getHairColor()" + return: + type: "java.awt.Color" + description: "Color of the dog's fur." +- uid: "com.microsoft.samples.commentinheritance.Dog.getKind()" + id: "getKind()" + parent: "com.microsoft.samples.commentinheritance.Dog" + langs: + - "java" + name: "getKind()" + nameWithType: "Dog.getKind()" + fullName: "com.microsoft.samples.commentinheritance.Dog.getKind()" + overload: "com.microsoft.samples.commentinheritance.Dog.getKind*" + overridden: "com.microsoft.samples.commentinheritance.Mammal.getKind()" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + summary: "Get kind from Organism. Get kind from Animal. Get kind from Mammal. Get kind from Dog." + syntax: + content: "public String getKind()" + return: + type: "java.lang.String" +- uid: "com.microsoft.samples.commentinheritance.Dog.giveBirth(int)" + id: "giveBirth(int)" + parent: "com.microsoft.samples.commentinheritance.Dog" + langs: + - "java" + name: "giveBirth(int numberPuppies)" + nameWithType: "Dog.giveBirth(int numberPuppies)" + fullName: "com.microsoft.samples.commentinheritance.Dog.giveBirth(int numberPuppies)" + overload: "com.microsoft.samples.commentinheritance.Dog.giveBirth*" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + syntax: + content: "public void giveBirth(int numberPuppies)" + parameters: + - id: "numberPuppies" + type: "int" + description: "Number of puppies being born." +- uid: "com.microsoft.samples.commentinheritance.Dog.verballyCommunicate()" + id: "verballyCommunicate()" + parent: "com.microsoft.samples.commentinheritance.Dog" + langs: + - "java" + name: "verballyCommunicate()" + nameWithType: "Dog.verballyCommunicate()" + fullName: "com.microsoft.samples.commentinheritance.Dog.verballyCommunicate()" + overload: "com.microsoft.samples.commentinheritance.Dog.verballyCommunicate*" + overridden: "com.microsoft.samples.commentinheritance.Animal.verballyCommunicate()" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + summary: "Communicate verbally. Bark." + syntax: + content: "public void verballyCommunicate()" +references: +- uid: "com.microsoft.samples.commentinheritance.Dog.Dog*" + name: "Dog" + nameWithType: "Dog.Dog" + fullName: "com.microsoft.samples.commentinheritance.Dog.Dog" + package: "com.microsoft.samples.commentinheritance" +- uid: "com.microsoft.samples.commentinheritance.Animal" + name: "Animal" + nameWithType: "Animal" + fullName: "com.microsoft.samples.commentinheritance.Animal" +- uid: "com.microsoft.samples.commentinheritance.Dog.eat*" + name: "eat" + nameWithType: "Dog.eat" + fullName: "com.microsoft.samples.commentinheritance.Dog.eat" + package: "com.microsoft.samples.commentinheritance" +- uid: "com.microsoft.samples.commentinheritance.Herbivorous.Plant" + name: "Herbivorous.Plant" + nameWithType: "Herbivorous.Plant" + fullName: "com.microsoft.samples.commentinheritance.Herbivorous.Plant" +- uid: "com.microsoft.samples.commentinheritance.Dog.verballyCommunicate*" + name: "verballyCommunicate" + nameWithType: "Dog.verballyCommunicate" + fullName: "com.microsoft.samples.commentinheritance.Dog.verballyCommunicate" + package: "com.microsoft.samples.commentinheritance" +- uid: "int" + spec.java: + - uid: "int" + name: "int" + fullName: "int" +- uid: "com.microsoft.samples.commentinheritance.Dog.giveBirth*" + name: "giveBirth" + nameWithType: "Dog.giveBirth" + fullName: "com.microsoft.samples.commentinheritance.Dog.giveBirth" + package: "com.microsoft.samples.commentinheritance" +- uid: "java.awt.Color" + spec.java: + - uid: "java.awt.Color" + name: "Color" + fullName: "java.awt.Color" +- uid: "com.microsoft.samples.commentinheritance.Dog.getHairColor*" + name: "getHairColor" + nameWithType: "Dog.getHairColor" + fullName: "com.microsoft.samples.commentinheritance.Dog.getHairColor" + package: "com.microsoft.samples.commentinheritance" +- uid: "com.microsoft.samples.commentinheritance.Dog.feed*" + name: "feed" + nameWithType: "Dog.feed" + fullName: "com.microsoft.samples.commentinheritance.Dog.feed" + package: "com.microsoft.samples.commentinheritance" +- uid: "java.lang.String" + spec.java: + - uid: "java.lang.String" + name: "String" + fullName: "java.lang.String" +- uid: "com.microsoft.samples.commentinheritance.Dog.getKind*" + name: "getKind" + nameWithType: "Dog.getKind" + fullName: "com.microsoft.samples.commentinheritance.Dog.getKind" + package: "com.microsoft.samples.commentinheritance" +- uid: "com.microsoft.samples.commentinheritance.Mammal" + name: "Mammal" + nameWithType: "Mammal" + fullName: "com.microsoft.samples.commentinheritance.Mammal" +- uid: "com.microsoft.samples.commentinheritance.Omnivorous" + name: "Omnivorous" + nameWithType: "Omnivorous" + fullName: "com.microsoft.samples.commentinheritance.Omnivorous" +- uid: "com.microsoft.samples.commentinheritance.Viviparous" + name: "Viviparous" + nameWithType: "Viviparous" + fullName: "com.microsoft.samples.commentinheritance.Viviparous" +- uid: "java.lang.Object.notify()" + name: "Object.notify()" + nameWithType: "Object.notify()" + fullName: "java.lang.Object.notify()" +- uid: "java.lang.Object.wait()" + name: "Object.wait()" + nameWithType: "Object.wait()" + fullName: "java.lang.Object.wait()" +- uid: "java.lang.Object.finalize()" + name: "Object.finalize()" + nameWithType: "Object.finalize()" + fullName: "java.lang.Object.finalize()" +- uid: "java.lang.Object.notifyAll()" + name: "Object.notifyAll()" + nameWithType: "Object.notifyAll()" + fullName: "java.lang.Object.notifyAll()" +- uid: "java.lang.Object.clone()" + name: "Object.clone()" + nameWithType: "Object.clone()" + fullName: "java.lang.Object.clone()" +- uid: "java.lang.Object.equals(java.lang.Object)" + name: "Object.equals(Object)" + nameWithType: "Object.equals(Object)" + fullName: "java.lang.Object.equals(java.lang.Object)" +- uid: "com.microsoft.samples.commentinheritance.Animal.breathe()" + name: "Animal.breathe()" + nameWithType: "Animal.breathe()" + fullName: "com.microsoft.samples.commentinheritance.Animal.breathe()" +- uid: "java.lang.Object.toString()" + name: "Object.toString()" + nameWithType: "Object.toString()" + fullName: "java.lang.Object.toString()" +- uid: "com.microsoft.samples.commentinheritance.Mammal.getKind()" + name: "Mammal.getKind()" + nameWithType: "Mammal.getKind()" + fullName: "com.microsoft.samples.commentinheritance.Mammal.getKind()" +- uid: "java.lang.Object.getClass()" + name: "Object.getClass()" + nameWithType: "Object.getClass()" + fullName: "java.lang.Object.getClass()" +- uid: "java.lang.Object.wait(long)" + name: "Object.wait(long)" + nameWithType: "Object.wait(long)" + fullName: "java.lang.Object.wait(long)" +- uid: "java.lang.Object.hashCode()" + name: "Object.hashCode()" + nameWithType: "Object.hashCode()" + fullName: "java.lang.Object.hashCode()" +- uid: "java.lang.Object.wait(long,int)" + name: "Object.wait(long,int)" + nameWithType: "Object.wait(long,int)" + fullName: "java.lang.Object.wait(long,int)" +- uid: "com.microsoft.samples.commentinheritance.Animal.verballyCommunicate()" + name: "Animal.verballyCommunicate()" + nameWithType: "Animal.verballyCommunicate()" + fullName: "com.microsoft.samples.commentinheritance.Animal.verballyCommunicate()" +- uid: "com.microsoft.samples.commentinheritance.Animal.feed()" + name: "Animal.feed()" + nameWithType: "Animal.feed()" + fullName: "com.microsoft.samples.commentinheritance.Animal.feed()" diff --git a/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Herbivorous.Plant.yml b/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Herbivorous.Plant.yml new file mode 100644 index 0000000..780526c --- /dev/null +++ b/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Herbivorous.Plant.yml @@ -0,0 +1,93 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.commentinheritance.Herbivorous.Plant" + id: "Plant" + parent: "com.microsoft.samples.commentinheritance" + children: + - "com.microsoft.samples.commentinheritance.Herbivorous.Plant.Plant()" + langs: + - "java" + name: "Herbivorous.Plant" + nameWithType: "Herbivorous.Plant" + fullName: "com.microsoft.samples.commentinheritance.Herbivorous.Plant" + type: "Class" + package: "com.microsoft.samples.commentinheritance" + syntax: + content: "public static class Herbivorous.Plant" + inheritance: + - "java.lang.Object" + inheritedMembers: + - "java.lang.Object.clone()" + - "java.lang.Object.equals(java.lang.Object)" + - "java.lang.Object.finalize()" + - "java.lang.Object.getClass()" + - "java.lang.Object.hashCode()" + - "java.lang.Object.notify()" + - "java.lang.Object.notifyAll()" + - "java.lang.Object.toString()" + - "java.lang.Object.wait()" + - "java.lang.Object.wait(long)" + - "java.lang.Object.wait(long,int)" +- uid: "com.microsoft.samples.commentinheritance.Herbivorous.Plant.Plant()" + id: "Plant()" + parent: "com.microsoft.samples.commentinheritance.Herbivorous.Plant" + langs: + - "java" + name: "Plant()" + nameWithType: "Herbivorous.Plant.Plant()" + fullName: "com.microsoft.samples.commentinheritance.Herbivorous.Plant.Plant()" + overload: "com.microsoft.samples.commentinheritance.Herbivorous.Plant.Plant*" + type: "Constructor" + package: "com.microsoft.samples.commentinheritance" + syntax: + content: "public Plant()" +references: +- uid: "com.microsoft.samples.commentinheritance.Herbivorous.Plant.Plant*" + name: "Plant" + nameWithType: "Herbivorous.Plant.Plant" + fullName: "com.microsoft.samples.commentinheritance.Herbivorous.Plant.Plant" + package: "com.microsoft.samples.commentinheritance" +- uid: "java.lang.Object.notify()" + name: "Object.notify()" + nameWithType: "Object.notify()" + fullName: "java.lang.Object.notify()" +- uid: "java.lang.Object.wait()" + name: "Object.wait()" + nameWithType: "Object.wait()" + fullName: "java.lang.Object.wait()" +- uid: "java.lang.Object.finalize()" + name: "Object.finalize()" + nameWithType: "Object.finalize()" + fullName: "java.lang.Object.finalize()" +- uid: "java.lang.Object.clone()" + name: "Object.clone()" + nameWithType: "Object.clone()" + fullName: "java.lang.Object.clone()" +- uid: "java.lang.Object.notifyAll()" + name: "Object.notifyAll()" + nameWithType: "Object.notifyAll()" + fullName: "java.lang.Object.notifyAll()" +- uid: "java.lang.Object.equals(java.lang.Object)" + name: "Object.equals(Object)" + nameWithType: "Object.equals(Object)" + fullName: "java.lang.Object.equals(java.lang.Object)" +- uid: "java.lang.Object.getClass()" + name: "Object.getClass()" + nameWithType: "Object.getClass()" + fullName: "java.lang.Object.getClass()" +- uid: "java.lang.Object.wait(long)" + name: "Object.wait(long)" + nameWithType: "Object.wait(long)" + fullName: "java.lang.Object.wait(long)" +- uid: "java.lang.Object.hashCode()" + name: "Object.hashCode()" + nameWithType: "Object.hashCode()" + fullName: "java.lang.Object.hashCode()" +- uid: "java.lang.Object.wait(long,int)" + name: "Object.wait(long,int)" + nameWithType: "Object.wait(long,int)" + fullName: "java.lang.Object.wait(long,int)" +- uid: "java.lang.Object.toString()" + name: "Object.toString()" + nameWithType: "Object.toString()" + fullName: "java.lang.Object.toString()" diff --git a/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Herbivorous.yml b/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Herbivorous.yml new file mode 100644 index 0000000..4c84584 --- /dev/null +++ b/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Herbivorous.yml @@ -0,0 +1,73 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.commentinheritance.Herbivorous" + id: "Herbivorous" + parent: "com.microsoft.samples.commentinheritance" + children: + - "com.microsoft.samples.commentinheritance.Herbivorous.Plant" + - "com.microsoft.samples.commentinheritance.Herbivorous.eat(com.microsoft.samples.commentinheritance.Herbivorous.Plant)" + - "com.microsoft.samples.commentinheritance.Herbivorous.getKind()" + langs: + - "java" + name: "Herbivorous" + nameWithType: "Herbivorous" + fullName: "com.microsoft.samples.commentinheritance.Herbivorous" + type: "Interface" + package: "com.microsoft.samples.commentinheritance" + summary: "Marks animals that eat plants." + syntax: + content: "public interface Herbivorous" +- uid: "com.microsoft.samples.commentinheritance.Herbivorous.eat(com.microsoft.samples.commentinheritance.Herbivorous.Plant)" + id: "eat(com.microsoft.samples.commentinheritance.Herbivorous.Plant)" + parent: "com.microsoft.samples.commentinheritance.Herbivorous" + langs: + - "java" + name: "eat(Herbivorous.Plant plantToBeEaten)" + nameWithType: "Herbivorous.eat(Herbivorous.Plant plantToBeEaten)" + fullName: "com.microsoft.samples.commentinheritance.Herbivorous.eat(Herbivorous.Plant plantToBeEaten)" + overload: "com.microsoft.samples.commentinheritance.Herbivorous.eat*" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + summary: "Eat the provided plant." + syntax: + content: "public abstract void eat(Herbivorous.Plant plantToBeEaten)" + parameters: + - id: "plantToBeEaten" + type: "com.microsoft.samples.commentinheritance.Herbivorous.Plant" + description: "Plant that will be eaten." +- uid: "com.microsoft.samples.commentinheritance.Herbivorous.getKind()" + id: "getKind()" + parent: "com.microsoft.samples.commentinheritance.Herbivorous" + langs: + - "java" + name: "getKind()" + nameWithType: "Herbivorous.getKind()" + fullName: "com.microsoft.samples.commentinheritance.Herbivorous.getKind()" + overload: "com.microsoft.samples.commentinheritance.Herbivorous.getKind*" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + summary: "Get kind from Herbivorous." + syntax: + content: "public abstract String getKind()" + return: + type: "java.lang.String" +references: +- uid: "com.microsoft.samples.commentinheritance.Herbivorous.Plant" + name: "Herbivorous.Plant" + nameWithType: "Herbivorous.Plant" + fullName: "com.microsoft.samples.commentinheritance.Herbivorous.Plant" +- uid: "com.microsoft.samples.commentinheritance.Herbivorous.eat*" + name: "eat" + nameWithType: "Herbivorous.eat" + fullName: "com.microsoft.samples.commentinheritance.Herbivorous.eat" + package: "com.microsoft.samples.commentinheritance" +- uid: "java.lang.String" + spec.java: + - uid: "java.lang.String" + name: "String" + fullName: "java.lang.String" +- uid: "com.microsoft.samples.commentinheritance.Herbivorous.getKind*" + name: "getKind" + nameWithType: "Herbivorous.getKind" + fullName: "com.microsoft.samples.commentinheritance.Herbivorous.getKind" + package: "com.microsoft.samples.commentinheritance" diff --git a/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Mammal.yml b/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Mammal.yml new file mode 100644 index 0000000..22689cd --- /dev/null +++ b/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Mammal.yml @@ -0,0 +1,147 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.commentinheritance.Mammal" + id: "Mammal" + parent: "com.microsoft.samples.commentinheritance" + children: + - "com.microsoft.samples.commentinheritance.Mammal.Mammal()" + - "com.microsoft.samples.commentinheritance.Mammal.getKind()" + langs: + - "java" + name: "Mammal" + nameWithType: "Mammal" + fullName: "com.microsoft.samples.commentinheritance.Mammal" + type: "Class" + package: "com.microsoft.samples.commentinheritance" + summary: "Mammal." + syntax: + content: "public abstract class Mammal extends Animal" + inheritance: + - "java.lang.Object" + - "com.microsoft.samples.commentinheritance.Animal" + inheritedMembers: + - "com.microsoft.samples.commentinheritance.Animal.breathe()" + - "com.microsoft.samples.commentinheritance.Animal.feed()" + - "com.microsoft.samples.commentinheritance.Animal.getKind()" + - "com.microsoft.samples.commentinheritance.Animal.verballyCommunicate()" + - "java.lang.Object.clone()" + - "java.lang.Object.equals(java.lang.Object)" + - "java.lang.Object.finalize()" + - "java.lang.Object.getClass()" + - "java.lang.Object.hashCode()" + - "java.lang.Object.notify()" + - "java.lang.Object.notifyAll()" + - "java.lang.Object.toString()" + - "java.lang.Object.wait()" + - "java.lang.Object.wait(long)" + - "java.lang.Object.wait(long,int)" +- uid: "com.microsoft.samples.commentinheritance.Mammal.Mammal()" + id: "Mammal()" + parent: "com.microsoft.samples.commentinheritance.Mammal" + langs: + - "java" + name: "Mammal()" + nameWithType: "Mammal.Mammal()" + fullName: "com.microsoft.samples.commentinheritance.Mammal.Mammal()" + overload: "com.microsoft.samples.commentinheritance.Mammal.Mammal*" + type: "Constructor" + package: "com.microsoft.samples.commentinheritance" + syntax: + content: "public Mammal()" +- uid: "com.microsoft.samples.commentinheritance.Mammal.getKind()" + id: "getKind()" + parent: "com.microsoft.samples.commentinheritance.Mammal" + langs: + - "java" + name: "getKind()" + nameWithType: "Mammal.getKind()" + fullName: "com.microsoft.samples.commentinheritance.Mammal.getKind()" + overload: "com.microsoft.samples.commentinheritance.Mammal.getKind*" + overridden: "com.microsoft.samples.commentinheritance.Animal.getKind()" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + summary: "Get kind from Organism. Get kind from Animal. Get kind from Mammal." + syntax: + content: "public abstract String getKind()" + return: + type: "java.lang.String" +references: +- uid: "com.microsoft.samples.commentinheritance.Mammal.Mammal*" + name: "Mammal" + nameWithType: "Mammal.Mammal" + fullName: "com.microsoft.samples.commentinheritance.Mammal.Mammal" + package: "com.microsoft.samples.commentinheritance" +- uid: "java.lang.String" + spec.java: + - uid: "java.lang.String" + name: "String" + fullName: "java.lang.String" +- uid: "com.microsoft.samples.commentinheritance.Mammal.getKind*" + name: "getKind" + nameWithType: "Mammal.getKind" + fullName: "com.microsoft.samples.commentinheritance.Mammal.getKind" + package: "com.microsoft.samples.commentinheritance" +- uid: "com.microsoft.samples.commentinheritance.Animal" + name: "Animal" + nameWithType: "Animal" + fullName: "com.microsoft.samples.commentinheritance.Animal" +- uid: "java.lang.Object.notify()" + name: "Object.notify()" + nameWithType: "Object.notify()" + fullName: "java.lang.Object.notify()" +- uid: "java.lang.Object.wait()" + name: "Object.wait()" + nameWithType: "Object.wait()" + fullName: "java.lang.Object.wait()" +- uid: "java.lang.Object.finalize()" + name: "Object.finalize()" + nameWithType: "Object.finalize()" + fullName: "java.lang.Object.finalize()" +- uid: "java.lang.Object.notifyAll()" + name: "Object.notifyAll()" + nameWithType: "Object.notifyAll()" + fullName: "java.lang.Object.notifyAll()" +- uid: "java.lang.Object.clone()" + name: "Object.clone()" + nameWithType: "Object.clone()" + fullName: "java.lang.Object.clone()" +- uid: "java.lang.Object.equals(java.lang.Object)" + name: "Object.equals(Object)" + nameWithType: "Object.equals(Object)" + fullName: "java.lang.Object.equals(java.lang.Object)" +- uid: "com.microsoft.samples.commentinheritance.Animal.breathe()" + name: "Animal.breathe()" + nameWithType: "Animal.breathe()" + fullName: "com.microsoft.samples.commentinheritance.Animal.breathe()" +- uid: "java.lang.Object.toString()" + name: "Object.toString()" + nameWithType: "Object.toString()" + fullName: "java.lang.Object.toString()" +- uid: "java.lang.Object.getClass()" + name: "Object.getClass()" + nameWithType: "Object.getClass()" + fullName: "java.lang.Object.getClass()" +- uid: "java.lang.Object.wait(long)" + name: "Object.wait(long)" + nameWithType: "Object.wait(long)" + fullName: "java.lang.Object.wait(long)" +- uid: "java.lang.Object.hashCode()" + name: "Object.hashCode()" + nameWithType: "Object.hashCode()" + fullName: "java.lang.Object.hashCode()" +- uid: "com.microsoft.samples.commentinheritance.Animal.getKind()" + name: "Animal.getKind()" + nameWithType: "Animal.getKind()" + fullName: "com.microsoft.samples.commentinheritance.Animal.getKind()" +- uid: "java.lang.Object.wait(long,int)" + name: "Object.wait(long,int)" + nameWithType: "Object.wait(long,int)" + fullName: "java.lang.Object.wait(long,int)" +- uid: "com.microsoft.samples.commentinheritance.Animal.verballyCommunicate()" + name: "Animal.verballyCommunicate()" + nameWithType: "Animal.verballyCommunicate()" + fullName: "com.microsoft.samples.commentinheritance.Animal.verballyCommunicate()" +- uid: "com.microsoft.samples.commentinheritance.Animal.feed()" + name: "Animal.feed()" + nameWithType: "Animal.feed()" + fullName: "com.microsoft.samples.commentinheritance.Animal.feed()" diff --git a/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Omnivorous.yml b/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Omnivorous.yml new file mode 100644 index 0000000..7995ebf --- /dev/null +++ b/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Omnivorous.yml @@ -0,0 +1,104 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.commentinheritance.Omnivorous" + id: "Omnivorous" + parent: "com.microsoft.samples.commentinheritance" + children: + - "com.microsoft.samples.commentinheritance.Omnivorous.eat(com.microsoft.samples.commentinheritance.Animal)" + - "com.microsoft.samples.commentinheritance.Omnivorous.eat(com.microsoft.samples.commentinheritance.Herbivorous.Plant)" + - "com.microsoft.samples.commentinheritance.Omnivorous.getKind()" + langs: + - "java" + name: "Omnivorous" + nameWithType: "Omnivorous" + fullName: "com.microsoft.samples.commentinheritance.Omnivorous" + type: "Interface" + package: "com.microsoft.samples.commentinheritance" + summary: "Eats plants and animals." + syntax: + content: "public interface Omnivorous extends Carnivorous, Herbivorous" + implements: + - "com.microsoft.samples.commentinheritance.Carnivorous" + - "com.microsoft.samples.commentinheritance.Herbivorous" +- uid: "com.microsoft.samples.commentinheritance.Omnivorous.eat(com.microsoft.samples.commentinheritance.Animal)" + id: "eat(com.microsoft.samples.commentinheritance.Animal)" + parent: "com.microsoft.samples.commentinheritance.Omnivorous" + langs: + - "java" + name: "eat(Animal animalToBeEaten)" + nameWithType: "Omnivorous.eat(Animal animalToBeEaten)" + fullName: "com.microsoft.samples.commentinheritance.Omnivorous.eat(Animal animalToBeEaten)" + overload: "com.microsoft.samples.commentinheritance.Omnivorous.eat*" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + summary: "Eat the provided animal." + syntax: + content: "public abstract void eat(Animal animalToBeEaten)" + parameters: + - id: "animalToBeEaten" + type: "com.microsoft.samples.commentinheritance.Animal" +- uid: "com.microsoft.samples.commentinheritance.Omnivorous.eat(com.microsoft.samples.commentinheritance.Herbivorous.Plant)" + id: "eat(com.microsoft.samples.commentinheritance.Herbivorous.Plant)" + parent: "com.microsoft.samples.commentinheritance.Omnivorous" + langs: + - "java" + name: "eat(Herbivorous.Plant plantToBeEaten)" + nameWithType: "Omnivorous.eat(Herbivorous.Plant plantToBeEaten)" + fullName: "com.microsoft.samples.commentinheritance.Omnivorous.eat(Herbivorous.Plant plantToBeEaten)" + overload: "com.microsoft.samples.commentinheritance.Omnivorous.eat*" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + summary: "Eat the provided plant." + syntax: + content: "public abstract void eat(Herbivorous.Plant plantToBeEaten)" + parameters: + - id: "plantToBeEaten" + type: "com.microsoft.samples.commentinheritance.Herbivorous.Plant" +- uid: "com.microsoft.samples.commentinheritance.Omnivorous.getKind()" + id: "getKind()" + parent: "com.microsoft.samples.commentinheritance.Omnivorous" + langs: + - "java" + name: "getKind()" + nameWithType: "Omnivorous.getKind()" + fullName: "com.microsoft.samples.commentinheritance.Omnivorous.getKind()" + overload: "com.microsoft.samples.commentinheritance.Omnivorous.getKind*" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + summary: "Get kind from Carnivorous. Get kind from Omnivorous." + syntax: + content: "public abstract String getKind()" + return: + type: "java.lang.String" +references: +- uid: "com.microsoft.samples.commentinheritance.Animal" + name: "Animal" + nameWithType: "Animal" + fullName: "com.microsoft.samples.commentinheritance.Animal" +- uid: "com.microsoft.samples.commentinheritance.Omnivorous.eat*" + name: "eat" + nameWithType: "Omnivorous.eat" + fullName: "com.microsoft.samples.commentinheritance.Omnivorous.eat" + package: "com.microsoft.samples.commentinheritance" +- uid: "com.microsoft.samples.commentinheritance.Herbivorous.Plant" + name: "Herbivorous.Plant" + nameWithType: "Herbivorous.Plant" + fullName: "com.microsoft.samples.commentinheritance.Herbivorous.Plant" +- uid: "java.lang.String" + spec.java: + - uid: "java.lang.String" + name: "String" + fullName: "java.lang.String" +- uid: "com.microsoft.samples.commentinheritance.Omnivorous.getKind*" + name: "getKind" + nameWithType: "Omnivorous.getKind" + fullName: "com.microsoft.samples.commentinheritance.Omnivorous.getKind" + package: "com.microsoft.samples.commentinheritance" +- uid: "com.microsoft.samples.commentinheritance.Herbivorous" + name: "Herbivorous" + nameWithType: "Herbivorous" + fullName: "com.microsoft.samples.commentinheritance.Herbivorous" +- uid: "com.microsoft.samples.commentinheritance.Carnivorous" + name: "Carnivorous" + nameWithType: "Carnivorous" + fullName: "com.microsoft.samples.commentinheritance.Carnivorous" diff --git a/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Organism.yml b/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Organism.yml new file mode 100644 index 0000000..fc7597c --- /dev/null +++ b/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Organism.yml @@ -0,0 +1,43 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.commentinheritance.Organism" + id: "Organism" + parent: "com.microsoft.samples.commentinheritance" + children: + - "com.microsoft.samples.commentinheritance.Organism.getKind()" + langs: + - "java" + name: "Organism" + nameWithType: "Organism" + fullName: "com.microsoft.samples.commentinheritance.Organism" + type: "Interface" + package: "com.microsoft.samples.commentinheritance" + syntax: + content: "public interface Organism" +- uid: "com.microsoft.samples.commentinheritance.Organism.getKind()" + id: "getKind()" + parent: "com.microsoft.samples.commentinheritance.Organism" + langs: + - "java" + name: "getKind()" + nameWithType: "Organism.getKind()" + fullName: "com.microsoft.samples.commentinheritance.Organism.getKind()" + overload: "com.microsoft.samples.commentinheritance.Organism.getKind*" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + summary: "Get kind from Organism." + syntax: + content: "public abstract String getKind()" + return: + type: "java.lang.String" +references: +- uid: "java.lang.String" + spec.java: + - uid: "java.lang.String" + name: "String" + fullName: "java.lang.String" +- uid: "com.microsoft.samples.commentinheritance.Organism.getKind*" + name: "getKind" + nameWithType: "Organism.getKind" + fullName: "com.microsoft.samples.commentinheritance.Organism.getKind" + package: "com.microsoft.samples.commentinheritance" diff --git a/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Viviparous.yml b/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Viviparous.yml new file mode 100644 index 0000000..d56df7c --- /dev/null +++ b/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Viviparous.yml @@ -0,0 +1,71 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.commentinheritance.Viviparous" + id: "Viviparous" + parent: "com.microsoft.samples.commentinheritance" + children: + - "com.microsoft.samples.commentinheritance.Viviparous.getKind()" + - "com.microsoft.samples.commentinheritance.Viviparous.giveBirth(int)" + langs: + - "java" + name: "Viviparous" + nameWithType: "Viviparous" + fullName: "com.microsoft.samples.commentinheritance.Viviparous" + type: "Interface" + package: "com.microsoft.samples.commentinheritance" + summary: "Mammals that give birth to young that develop within the mother's body." + syntax: + content: "public interface Viviparous" +- uid: "com.microsoft.samples.commentinheritance.Viviparous.getKind()" + id: "getKind()" + parent: "com.microsoft.samples.commentinheritance.Viviparous" + langs: + - "java" + name: "getKind()" + nameWithType: "Viviparous.getKind()" + fullName: "com.microsoft.samples.commentinheritance.Viviparous.getKind()" + overload: "com.microsoft.samples.commentinheritance.Viviparous.getKind*" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + summary: "Get kind from Viviparous." + syntax: + content: "public abstract String getKind()" + return: + type: "java.lang.String" +- uid: "com.microsoft.samples.commentinheritance.Viviparous.giveBirth(int)" + id: "giveBirth(int)" + parent: "com.microsoft.samples.commentinheritance.Viviparous" + langs: + - "java" + name: "giveBirth(int numberOfOffspring)" + nameWithType: "Viviparous.giveBirth(int numberOfOffspring)" + fullName: "com.microsoft.samples.commentinheritance.Viviparous.giveBirth(int numberOfOffspring)" + overload: "com.microsoft.samples.commentinheritance.Viviparous.giveBirth*" + type: "Method" + package: "com.microsoft.samples.commentinheritance" + syntax: + content: "public abstract void giveBirth(int numberOfOffspring)" + parameters: + - id: "numberOfOffspring" + type: "int" +references: +- uid: "int" + spec.java: + - uid: "int" + name: "int" + fullName: "int" +- uid: "com.microsoft.samples.commentinheritance.Viviparous.giveBirth*" + name: "giveBirth" + nameWithType: "Viviparous.giveBirth" + fullName: "com.microsoft.samples.commentinheritance.Viviparous.giveBirth" + package: "com.microsoft.samples.commentinheritance" +- uid: "java.lang.String" + spec.java: + - uid: "java.lang.String" + name: "String" + fullName: "java.lang.String" +- uid: "com.microsoft.samples.commentinheritance.Viviparous.getKind*" + name: "getKind" + nameWithType: "Viviparous.getKind" + fullName: "com.microsoft.samples.commentinheritance.Viviparous.getKind" + package: "com.microsoft.samples.commentinheritance" diff --git a/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.yml b/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.yml new file mode 100644 index 0000000..5842c9d --- /dev/null +++ b/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.yml @@ -0,0 +1,59 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.commentinheritance" + id: "commentinheritance" + children: + - "com.microsoft.samples.commentinheritance.Animal" + - "com.microsoft.samples.commentinheritance.Carnivorous" + - "com.microsoft.samples.commentinheritance.Dog" + - "com.microsoft.samples.commentinheritance.Herbivorous" + - "com.microsoft.samples.commentinheritance.Herbivorous.Plant" + - "com.microsoft.samples.commentinheritance.Mammal" + - "com.microsoft.samples.commentinheritance.Omnivorous" + - "com.microsoft.samples.commentinheritance.Organism" + - "com.microsoft.samples.commentinheritance.Viviparous" + langs: + - "java" + name: "com.microsoft.samples.commentinheritance" + nameWithType: "com.microsoft.samples.commentinheritance" + fullName: "com.microsoft.samples.commentinheritance" + type: "Namespace" + syntax: + content: "package com.microsoft.samples.commentinheritance" +references: +- uid: "com.microsoft.samples.commentinheritance.Animal" + name: "Animal" + nameWithType: "Animal" + fullName: "com.microsoft.samples.commentinheritance.Animal" +- uid: "com.microsoft.samples.commentinheritance.Carnivorous" + name: "Carnivorous" + nameWithType: "Carnivorous" + fullName: "com.microsoft.samples.commentinheritance.Carnivorous" +- uid: "com.microsoft.samples.commentinheritance.Dog" + name: "Dog" + nameWithType: "Dog" + fullName: "com.microsoft.samples.commentinheritance.Dog" +- uid: "com.microsoft.samples.commentinheritance.Herbivorous" + name: "Herbivorous" + nameWithType: "Herbivorous" + fullName: "com.microsoft.samples.commentinheritance.Herbivorous" +- uid: "com.microsoft.samples.commentinheritance.Herbivorous.Plant" + name: "Herbivorous.Plant" + nameWithType: "Herbivorous.Plant" + fullName: "com.microsoft.samples.commentinheritance.Herbivorous.Plant" +- uid: "com.microsoft.samples.commentinheritance.Mammal" + name: "Mammal" + nameWithType: "Mammal" + fullName: "com.microsoft.samples.commentinheritance.Mammal" +- uid: "com.microsoft.samples.commentinheritance.Omnivorous" + name: "Omnivorous" + nameWithType: "Omnivorous" + fullName: "com.microsoft.samples.commentinheritance.Omnivorous" +- uid: "com.microsoft.samples.commentinheritance.Organism" + name: "Organism" + nameWithType: "Organism" + fullName: "com.microsoft.samples.commentinheritance.Organism" +- uid: "com.microsoft.samples.commentinheritance.Viviparous" + name: "Viviparous" + nameWithType: "Viviparous" + fullName: "com.microsoft.samples.commentinheritance.Viviparous" diff --git a/src/test/resources/expected-generated-files/toc.yml b/src/test/resources/expected-generated-files/toc.yml index 8d40a83..a4e2eff 100644 --- a/src/test/resources/expected-generated-files/toc.yml +++ b/src/test/resources/expected-generated-files/toc.yml @@ -10,6 +10,27 @@ name: "IAgreementDetailsCollection" - uid: "com.microsoft.samples.agreements.ResourceCollection" name: "ResourceCollection" +- uid: "com.microsoft.samples.commentinheritance" + name: "com.microsoft.samples.commentinheritance" + items: + - uid: "com.microsoft.samples.commentinheritance.Animal" + name: "Animal" + - uid: "com.microsoft.samples.commentinheritance.Carnivorous" + name: "Carnivorous" + - uid: "com.microsoft.samples.commentinheritance.Dog" + name: "Dog" + - uid: "com.microsoft.samples.commentinheritance.Herbivorous" + name: "Herbivorous" + - uid: "com.microsoft.samples.commentinheritance.Herbivorous.Plant" + name: "Herbivorous.Plant" + - uid: "com.microsoft.samples.commentinheritance.Mammal" + name: "Mammal" + - uid: "com.microsoft.samples.commentinheritance.Omnivorous" + name: "Omnivorous" + - uid: "com.microsoft.samples.commentinheritance.Organism" + name: "Organism" + - uid: "com.microsoft.samples.commentinheritance.Viviparous" + name: "Viviparous" - uid: "com.microsoft.samples.offers" name: "com.microsoft.samples.offers" items: