APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jdk.javadoc.internal.doclets.formats.html.taglets.snippet

public final Class Parser

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Iterator, .LinkedList, .List, .Map, .Objects, .Optional, .Queue, .Set, java.util.regex.Matcher, .Pattern, .PatternSyntaxException, jdk.javadoc.internal.doclets.formats.html.taglets.SnippetTaglet, jdk.javadoc.internal.doclets.toolkit.Resources

A parser of snippet content.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static interface
public static class
public static record
pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final Pattern
private final MarkupParser
private static final Pattern
private final Parser.Regions
private final Resources
private final Queue<Parser.Tag>

Constructor Summary

AccessConstructor and Description
public
Parser(Resources resources)

Method Summary

Modifier and TypeMethod and Description
private void
private void
private Pattern
private Pattern
createRegexPattern(Optional<Attribute.Valued> substring, Optional<Attribute.Valued> regex, String defaultRegex, int offset)

pack-priv static void
private ParseException
newParseException(int pos, String key, Object... args)

public Parser.Result
private Parser.Result
parse(SnippetTaglet.Diags diags, Pattern commentPattern, String source)

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

JAVA_COMMENTback to summary
private static final Pattern JAVA_COMMENT
markupParserback to summary
private final MarkupParser markupParser
PROPERTIES_COMMENTback to summary
private static final Pattern PROPERTIES_COMMENT
regionsback to summary
private final Parser.Regions regions
resourcesback to summary
private final Resources resources
tagsback to summary
private final Queue<Parser.Tag> tags

Constructor Detail

Parserback to summary
public Parser(Resources resources)

Method Detail

appendback to summary
private void append(StyledText text, Set<Style> style, CharSequence s)
completeTagback to summary
private void completeTag(Parser.Tag start, Parser.Tag end)
createRegexPatternback to summary
private Pattern createRegexPattern(Optional<Attribute.Valued> substring, Optional<Attribute.Valued> regex, int offset) throws ParseException
createRegexPatternback to summary
private Pattern createRegexPattern(Optional<Attribute.Valued> substring, Optional<Attribute.Valued> regex, String defaultRegex, int offset) throws ParseException
forEachLineback to summary
pack-priv static void forEachLine(String s, Parser.LineConsumer consumer)
newParseExceptionback to summary
private ParseException newParseException(int pos, String key, Object... args)
parseback to summary
public Parser.Result parse(SnippetTaglet.Diags diags, SnippetTaglet.Language language, String source) throws ParseException
parseback to summary
private Parser.Result parse(SnippetTaglet.Diags diags, Pattern commentPattern, String source) throws ParseException
processTagback to summary
private void processTag(Parser.Tag t) throws ParseException
jdk.javadoc.internal.doclets.formats.html.taglets.snippet back to summary

pack-priv Interface Parser.LineConsumer

Annotations
@FunctionalInterface

Method Summary

Modifier and TypeMethod and Description
public void
accept(int offset, String line)

Method Detail

acceptback to summary
public void accept(int offset, String line)
jdk.javadoc.internal.doclets.formats.html.taglets.snippet back to summary

public final Class Parser.Regions

extends Object
Class Inheritance
  • java.lang.Object
  • jdk.javadoc.internal.doclets.formats.html.taglets.snippet.Parser.Regions

Field Summary

Modifier and TypeField and Description
private final ArrayList<Map.Entry<Optional<String>, Parser.Tag>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv boolean
pack-priv void
pack-priv boolean
pack-priv Optional<Parser.Tag>
pack-priv Optional<Parser.Tag>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

tagsback to summary
private final ArrayList<Map.Entry<Optional<String>, Parser.Tag>> tags

Constructor Detail

Regionsback to summary
public Regions()

Method Detail

addAnonymousback to summary
pack-priv void addAnonymous(Parser.Tag i)
addNamedback to summary
pack-priv boolean addNamed(String name, Parser.Tag i)
clearback to summary
pack-priv void clear()
isEmptyback to summary
pack-priv boolean isEmpty()
removeLastback to summary
pack-priv Optional<Parser.Tag> removeLast()
removeNamedback to summary
pack-priv Optional<Parser.Tag> removeNamed(String name)
jdk.javadoc.internal.doclets.formats.html.taglets.snippet back to summary

public final Record Parser.Result

extends Record
Class Inheritance
Record Components
text:StyledText 
actions:Queue<Action> 

Field Summary

Modifier and TypeField and Description
private final Queue<Action>
actions

Record Component accessed by actions().

private final StyledText
text

Record Component accessed by text().

Constructor Summary

AccessConstructor and Description
public
Result(StyledText text, Queue<Action> actions)

Method Summary

Modifier and TypeMethod and Description
public Queue<Action>
actions()

Record Component getter of actions.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public StyledText
text()

Record Component getter of text.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

actionsback to summary
private final Queue<Action> actions

Record Component accessed by actions().

textback to summary
private final StyledText text

Record Component accessed by text().

Constructor Detail

Resultback to summary
public Result(StyledText text, Queue<Action> actions)

Method Detail

actionsback to summary
public Queue<Action> actions()

Record Component getter of actions.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

textback to summary
public StyledText text()

Record Component getter of text.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

jdk.javadoc.internal.doclets.formats.html.taglets.snippet back to summary

pack-priv final Class Parser.Tag

extends Object
Class Inheritance
  • java.lang.Object
  • jdk.javadoc.internal.doclets.formats.html.taglets.snippet.Parser.Tag

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv List<Attribute>
pack-priv int
pack-priv int
pack-priv int
pack-priv String
pack-priv int
pack-priv int

Constructor Summary

AccessConstructor and Description
pack-priv
Tag()

Method Summary

Modifier and TypeMethod and Description
pack-priv List<Attribute>
pack-priv int
end()

pack-priv String
name()

pack-priv int
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

appliesToNextLineback to summary
pack-priv boolean appliesToNextLine
attributesback to summary
pack-priv List<Attribute> attributes
endback to summary
pack-priv int end
lineSourceOffsetback to summary
pack-priv int lineSourceOffset
markupLineOffsetback to summary
pack-priv int markupLineOffset
nameback to summary
pack-priv String name
nameLineOffsetback to summary
pack-priv int nameLineOffset
startback to summary
pack-priv int start

Constructor Detail

Tagback to summary
pack-priv Tag()

Method Detail

attributesback to summary
pack-priv List<Attribute> attributes()
endback to summary
pack-priv int end()
nameback to summary
pack-priv String name()
startback to summary
pack-priv int start()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override