Record Class TopicHeader
java.lang.Object
java.lang.Record
network.ike.docs.plugin.registry.TopicHeader
- Record Components:
file- the file, relative to the scan root, with/separatorstopic- whether the file declares a:topic-id:before its headingid- the topic id, ornullfor a file that is not a topictitle- the first heading's text: the level-1 heading for a topic; for any other file the first heading of any level, so a chapter file that starts at==still has a titlelevel- the heading level oftitle()(1 for=), or 0 when the file has no headingattributes- every:topic-*:attribute in declaration order, keyed without thetopic-prefixdocumentAttributes- every other:name: valueattribute in the header, before the heading or in the contiguous block after it (doctype,toc, ...), in orderanchor-present,missingormismatchedfor a topic;nullfor other filescharCount- characters from the anchor line (or the heading, when there is no anchor) to the end of the fileincludes- the number ofinclude::lines in the filefindings- what is wrong with the header, empty when nothing is
public record TopicHeader(String file, boolean topic, String id, String title, int level, Map<String,String> attributes, Map<String,String> documentAttributes, String anchor, long charCount, int includes, List<String> findings)
extends Record
The parsed header of one AsciiDoc file: the
:topic-*: attribute
block, the anchor and the level-1 heading, read line by line without
AsciidoctorJ. The layout is the one IKE-ASCIIDOC-FRAGMENT.md
prescribes: an optional comment header, the attribute block (values may
continue on the next line with a trailing backslash), a literal
[[anchor]] equal to the topic id, then = Title.
A file with no :topic-id: before its heading is not a topic;
it is recorded as an assembly (when it carries include:: lines)
or a plain file, with its title and document attributes, and gets no
header findings. Every kind of module the doc pipeline renders is
covered: topic libraries, assemblies, doc-only and hybrid projects.
- Since:
- 109
-
Field Summary
FieldsModifier and TypeFieldDescriptionAttributes every topic must declare, without thetopic-prefix.The topic statusesIKE-TOPIC-REGISTRY.mdallows.The topic typesIKE-TOPIC-REGISTRY.mdallows, plusprocedure, whichike-doc-ingestwrites for task topics. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionanchor()Returns the value of theanchorrecord component.Returns the value of theattributesrecord component.longReturns the value of thecharCountrecord component.Returns the value of thedocumentAttributesrecord component.final booleanIndicates whether some other object is "equal to" this one.file()Returns the value of thefilerecord component.findings()Returns the value of thefindingsrecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.intincludes()Returns the value of theincludesrecord component.keywords()The:topic-keywords:value split on commas and trimmed.intlevel()Returns the value of thelevelrecord component.The required attributes this header lacks, in the order ofREQUIRED.static TopicHeaderParse file content already in memory.static TopicHeaderParse one file.title()Returns the value of thetitlerecord component.booleantopic()Returns the value of thetopicrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
REQUIRED
-
TYPES
-
STATUSES
-
-
Constructor Details
-
TopicHeader
public TopicHeader(String file, boolean topic, String id, String title, int level, Map<String, String> attributes, Map<String, String> documentAttributes, String anchor, long charCount, int includes, List<String> findings) Creates an instance of aTopicHeaderrecord class.- Parameters:
file- the value for thefilerecord componenttopic- the value for thetopicrecord componentid- the value for theidrecord componenttitle- the value for thetitlerecord componentlevel- the value for thelevelrecord componentattributes- the value for theattributesrecord componentdocumentAttributes- the value for thedocumentAttributesrecord componentanchor- the value for theanchorrecord componentcharCount- the value for thecharCountrecord componentincludes- the value for theincludesrecord componentfindings- the value for thefindingsrecord component
-
-
Method Details
-
parse
Parse one file.- Parameters:
file- the file to read, UTF-8root- the scan root the file lies under;file()is expressed relative to it- Returns:
- the parsed header
- Throws:
IOException- if the file cannot be read
-
parse
Parse file content already in memory.- Parameters:
relative- the file's path relative to its scan rootcontent- the file content- Returns:
- the parsed header
-
missingRequired
-
keywords
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
file
-
topic
-
id
-
title
-
level
-
attributes
Returns the value of theattributesrecord component.- Returns:
- the value of the
attributesrecord component
-
documentAttributes
Returns the value of thedocumentAttributesrecord component.- Returns:
- the value of the
documentAttributesrecord component
-
anchor
-
charCount
-
includes
-
findings
-