public final class JavadocBlockParserUtil extends Object
JavadocBlockParser.| Modifier and Type | Field and Description |
|---|---|
static Set<JavadocTokenKind> |
S_WHITE
The white-space token kinds.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
buildString(List<? extends JavadocToken> tokens)
Concatenates the token images.
|
static int |
countWhileTagName(JavadocScanner scanner,
int start)
Returns the number of tokens in the current block body.
|
static IrDocBasicType |
fetchBasicType(JavadocScanner scanner,
Set<JavadocTokenKind> follow)
Consumes tokens from the scanner and returns the corresponded basic type.
|
static JavadocBlockInfo |
fetchBlockInfo(JavadocScanner scanner)
Consumes tokens from the scanner and returns the corresponded inline block.
|
static IrDocField |
fetchField(JavadocScanner scanner,
Set<JavadocTokenKind> follow)
Consumes tokens from the scanner and returns the corresponded field.
|
static IrDocFragment |
fetchLinkTarget(JavadocScanner scanner,
Set<JavadocTokenKind> follow)
Consumes tokens from the scanner and returns the corresponded link target.
|
static IrDocMethod |
fetchMethod(JavadocScanner scanner,
Set<JavadocTokenKind> follow)
Consumes tokens from the scanner and returns the corresponded method or constructor.
|
static IrDocName |
fetchName(JavadocScanner scanner,
Set<JavadocTokenKind> follow)
Consumes tokens from the scanner and returns the corresponded (simple or qualified) name.
|
static IrDocNamedType |
fetchNamedType(JavadocScanner scanner,
Set<JavadocTokenKind> follow)
Consumes tokens from the scanner and returns the corresponded named type.
|
static IrDocBasicType |
fetchPrimitiveType(JavadocScanner scanner,
Set<JavadocTokenKind> follow)
Consumes tokens from the scanner and returns the corresponded primitive type.
|
static IrDocSimpleName |
fetchSimpleName(JavadocScanner scanner,
Set<JavadocTokenKind> follow)
Consumes tokens from the scanner and returns the corresponded simple name.
|
static IrDocText |
fetchText(JavadocScanner scanner,
boolean trimHead,
boolean trimTail)
Consumes tokens from the scanner and returns the corresponded plain text.
|
static IrDocType |
fetchType(JavadocScanner scanner,
Set<JavadocTokenKind> follow)
Consumes tokens from the scanner and returns the corresponded type.
|
static <T extends IrDocElement> |
setLocation(T elem,
IrLocation start,
IrLocation stop)
Sets the location information for the target element.
|
static <T extends IrDocElement> |
setLocation(T elem,
JavadocToken start,
JavadocToken stop)
Sets the location information for the target element.
|
public static final Set<JavadocTokenKind> S_WHITE
public static <T extends IrDocElement> T setLocation(T elem, JavadocToken start, JavadocToken stop)
T - the element typeelem - the target elementstart - the first tokenstop - the last tokenpublic static <T extends IrDocElement> T setLocation(T elem, IrLocation start, IrLocation stop)
T - the element typeelem - the target elementstart - the first locationstop - the last locationpublic static IrDocText fetchText(JavadocScanner scanner, boolean trimHead, boolean trimTail)
null (operation failed).scanner - the target scannertrimHead - true to trim leading white-spacestrimTail - true to trim trailing while-spacesnull if it will be emptyIllegalArgumentException - if the parameter is nullpublic static JavadocBlockInfo fetchBlockInfo(JavadocScanner scanner)
scanner - the target scannernullIllegalArgumentException - if the parameter is nullpublic static int countWhileTagName(JavadocScanner scanner, int start)
scanner - the target scannerstart - the starting offsetpublic static IrDocSimpleName fetchSimpleName(JavadocScanner scanner, Set<JavadocTokenKind> follow)
scanner - the target scannerfollow - the acceptable token kinds after this operation was finished, or null to accept anythingnullIllegalArgumentException - if scanner is nullpublic static IrDocName fetchName(JavadocScanner scanner, Set<JavadocTokenKind> follow)
scanner - the target scannerfollow - the acceptable token kinds after this operation was finished, or null to accept anythingnullIllegalArgumentException - if scanner is nullpublic static IrDocBasicType fetchBasicType(JavadocScanner scanner, Set<JavadocTokenKind> follow)
scanner - the target scannerfollow - the acceptable token kinds after this operation was finished, or null to accept anythingnullIllegalArgumentException - if scanner is nullpublic static IrDocBasicType fetchPrimitiveType(JavadocScanner scanner, Set<JavadocTokenKind> follow)
scanner - the target scannerfollow - the acceptable token kinds after this operation was finished, or null to accept anythingnullIllegalArgumentException - if scanner is nullpublic static IrDocNamedType fetchNamedType(JavadocScanner scanner, Set<JavadocTokenKind> follow)
scanner - the target scannerfollow - the acceptable token kinds after this operation was finished, or null to accept anythingnullIllegalArgumentException - if scanner is nullpublic static IrDocType fetchType(JavadocScanner scanner, Set<JavadocTokenKind> follow)
scanner - the target scannerfollow - the acceptable token kinds after this operation was finished, or null to accept anythingnullIllegalArgumentException - if scanner is nullpublic static IrDocField fetchField(JavadocScanner scanner, Set<JavadocTokenKind> follow)
scanner - the target scannerfollow - the acceptable token kinds after this operation was finished, or null to accept anythingnullIllegalArgumentException - if scanner is nullpublic static IrDocMethod fetchMethod(JavadocScanner scanner, Set<JavadocTokenKind> follow)
scanner - the target scannerfollow - the acceptable token kinds after this operation was finished, or null to accept anythingnullIllegalArgumentException - if scanner is nullpublic static IrDocFragment fetchLinkTarget(JavadocScanner scanner, Set<JavadocTokenKind> follow)
scanner - the target scannerfollow - the acceptable token kinds after this operation was finished, or null to accept anythingnullIllegalArgumentException - if scanner is nullpublic static String buildString(List<? extends JavadocToken> tokens)
tokens - the target tokensCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.