diff --git a/src/main/java/com/microsoft/lookup/ClassItemsLookup.java b/src/main/java/com/microsoft/lookup/ClassItemsLookup.java index 1b23454..18436b9 100644 --- a/src/main/java/com/microsoft/lookup/ClassItemsLookup.java +++ b/src/main/java/com/microsoft/lookup/ClassItemsLookup.java @@ -1,17 +1,24 @@ 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.*; import javax.lang.model.type.TypeKind; @@ -64,6 +71,7 @@ protected ExtendedMetadataFileItem buildMetadataFileItem(Element element) { 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())); @@ -145,4 +153,46 @@ String extractOverriddenUid(ExecutableElement ovr) { 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/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/Utils.java b/src/main/java/com/microsoft/util/Utils.java index 0e4b7e3..df8e08b 100644 --- a/src/main/java/com/microsoft/util/Utils.java +++ b/src/main/java/com/microsoft/util/Utils.java @@ -10,10 +10,7 @@ import javax.lang.model.util.SimpleElementVisitor9; import javax.lang.model.util.Types; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Optional; +import java.util.*; import java.util.stream.Collectors; import jdk.javadoc.doclet.DocletEnvironment; @@ -77,6 +74,21 @@ public boolean isSimpleOverride(ExecutableElement m) { (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"); } @@ -193,6 +205,12 @@ 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 @@ -205,4 +223,39 @@ public List getMembers(TypeElement te, ElementKind kind) { .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/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/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: