A parent is the name and therefore a reference to a document the referencing document is considered a child of. A element may have any number of parents, including none.
Annotations found at the type level (i.e. a Java class) are not inherited to the elements defined in this type.
This is a filing element.
The following examples show how the DocParent annotation can be used.
The examples show the parent names as string literals. Please consider using constants that define these values. This way it is easier to ensure that the parents are correctly spelled and also may be changed later more easily.
The annotation is provided at element level and associates the given parent to that element only.
public interface ExampleInterface { @DocParent("sample-parent") String element(); }
The parent sample-parent is assigned to the Element element.
The annotation allows to reference a collection of parents.
public interface ExampleInterface { @DocParent({ "sample-parent one", "sample-parent two", "sample-parent three" }) String element(); }
The parents sample-parent one, sample-parent two, and sample-parent three are assigned to the Element element.
Parents specified at type level will not be inherited to the elements. This is in contrast to the inheritance strategy provides by categories and tags.
@DocParent("type-parent") public interface TestProperties { String inheritAll(); @DocParent({ "sample one" }) String oneValue(); @DocParent({ "sample one", "sample two", "sample three" }) String multipleValues(); }
The element inheritAll is associated with no parent, the element oneValue is associated with sample one and the element multipleValues is associated with its own three parents only.