Klasse IndexItem
Items are primarily defined by their position in the documentation, which is one of:
- An element (module, package, type or member)
- One of a small set of tags in the doc comment for an element: {@index ...}, {@systemProperty ...}, etc
- One of a small set of outliers, corresponding to summary pages: "All Classes", "All Packages", etc
All items have a "label", which is the presentation string used to display the item in the list of matching choices. The label is specified when the item is created. Items also have a "url" and a "description", which are provided by the specific doclet.
Each item provides details to be included in the search index files read and processed by JavaScript. Items have a "category", which is normally derived from the element kind or doc tree kind; it corresponds to the JavaScript file in which this item will be written.
Items for an element may have one or more of the following: "containing module", "containing package", "containing type".
Items for a node in a doc tree have a "holder", which is a text form of the enclosing element or page. They will typically also have a "description" derived from content in the doc tree node.
-
Verschachtelte Klassen - Übersicht
Modifizierer und TypKlasseBeschreibungstatic enum
The “category” used to group items for the interactive search index. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungReturns the category for this item, that indicates the JavaScript file in which this item should be written.protected IndexItem.Category
getCategory
(DocTree docTree) protected IndexItem.Category
getCategory
(Element element) Returns the type element that is documented as containing a member element, or null if this item does not represent a member element.Returns a description of the tag for this item or null if this is not a item for a tag for an item in a documentation tag.Returns the documentation tree node for this item, of null if this item does not represent a documentation tree node.Returns the element associate with this item, or null.getFullyQualifiedLabel
(Utils utils) Returns the label with a fully-qualified type name.Returns a description of the element owning the documentation comment for this item, or null if this is not a item for a tag for an item in a documentation tag.getLabel()
Returns the label of the item.Returns the part of the label after the last dot, or the whole label if there are no dots.getUrl()
Returns the URL for this item, or an empty string if no value has been set.boolean
Returns true if this index is for an element.boolean
isKind
(DocTree.Kind kind) Returns true if this index is for a specific kind of tag in a doc comment.boolean
Returns true if this index is for a tag in a doc comment.static IndexItem
Creates an index item for a node in the doc comment for an element.static IndexItem
of
(ModuleElement moduleElement, Utils utils) Creates an index item for a module element.static IndexItem
of
(PackageElement packageElement, Utils utils) Creates an index item for a package element.static IndexItem
of
(TypeElement typeElement, Element member, Utils utils) Creates an index item for a member element.static IndexItem
of
(TypeElement typeElement, Utils utils) Creates an index item for a type element.static IndexItem
of
(IndexItem.Category category, String label, DocPath path) Creates an index item for a summary page, that is not associated with any element or node in a doc comment.Sets the name of the containing class for this item.Sets the name of the containing module for this item.Sets the name of the containing package for this item.Sets the URL for the item, when it cannot otherwise be inferred from other fields.toJSON()
Returns a string representing this item in JSON notation.
-
Methodendetails
-
of
Creates an index item for a module element.- Parameter:
moduleElement
- the elementutils
- the common utilities class- Gibt zurück:
- the item
-
of
Creates an index item for a package element.- Parameter:
packageElement
- the elementutils
- the common utilities class- Gibt zurück:
- the item
-
of
Creates an index item for a type element.Note: use getElement() to access this value, not getTypeElement.
- Parameter:
typeElement
- the elementutils
- the common utilities class- Gibt zurück:
- the item
-
of
Creates an index item for a member element.Note: the given type element may not be the same as the enclosing element of the member in cases where the enclosing element is not visible in the documentation.
- Parameter:
typeElement
- the element that contains the membermember
- the memberutils
- the common utilities class- Gibt zurück:
- the item
- Siehe auch:
-
of
public static IndexItem of(Element element, DocTree docTree, String label, String holder, String description, DocLink link) Creates an index item for a node in the doc comment for an element.The node should only be one that gives rise to an entry in the index.
- Parameter:
element
- the elementdocTree
- the node in the doc commentlabel
- the labelholder
- the holder for the commentdescription
- the description of the itemlink
- the root-relative link to the item in the generated docs- Gibt zurück:
- the item
-
of
Creates an index item for a summary page, that is not associated with any element or node in a doc comment.- Parameter:
category
- the category for the itemlabel
- the label for the itempath
- the path for the page- Gibt zurück:
- the item
-
getLabel
Returns the label of the item.- Gibt zurück:
- the label
-
getSimpleName
Returns the part of the label after the last dot, or the whole label if there are no dots.- Gibt zurück:
- the simple name
-
getFullyQualifiedLabel
Returns the label with a fully-qualified type name.(Used to determine if labels are unique or need to be qualified.)
- Parameter:
utils
- the common utilities class- Gibt zurück:
- the fully qualified name
-
getElement
Returns the element associate with this item, or null.- Gibt zurück:
- the element
-
getCategory
Returns the category for this item, that indicates the JavaScript file in which this item should be written.- Gibt zurück:
- the category
-
getCategory
-
getCategory
-
getContainingTypeElement
Returns the type element that is documented as containing a member element, or null if this item does not represent a member element.- Gibt zurück:
- the type element
-
getDocTree
Returns the documentation tree node for this item, of null if this item does not represent a documentation tree node.- Gibt zurück:
- the documentation tree node
-
isElementItem
Returns true if this index is for an element.- Gibt zurück:
- true if this index is for an element
-
isTagItem
Returns true if this index is for a tag in a doc comment.- Gibt zurück:
- true if this index is for a tag in a doc comment
-
isKind
Returns true if this index is for a specific kind of tag in a doc comment.- Gibt zurück:
- true if this index is for a specific kind of tag in a doc comment
-
setUrl
Sets the URL for the item, when it cannot otherwise be inferred from other fields.- Parameter:
u
- the url- Gibt zurück:
- this item
-
getUrl
Returns the URL for this item, or an empty string if no value has been set.- Gibt zurück:
- the URL for this item, or an empty string if no value has been set
-
setContainingModule
Sets the name of the containing module for this item.- Parameter:
m
- the module- Gibt zurück:
- this item
-
setContainingPackage
Sets the name of the containing package for this item.- Parameter:
p
- the package- Gibt zurück:
- this item
-
setContainingClass
Sets the name of the containing class for this item.- Parameter:
c
- the class- Gibt zurück:
- this item
-
getHolder
Returns a description of the element owning the documentation comment for this item, or null if this is not a item for a tag for an item in a documentation tag.- Gibt zurück:
- the description of the element that owns this item
-
getDescription
Returns a description of the tag for this item or null if this is not a item for a tag for an item in a documentation tag.- Gibt zurück:
- the description of the tag
-
toJSON
Returns a string representing this item in JSON notation.- Gibt zurück:
- a string representing this item in JSON notation
-