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 empty
IllegalArgumentException
- if the parameter is null
public static JavadocBlockInfo fetchBlockInfo(JavadocScanner scanner)
scanner
- the target scannernull
IllegalArgumentException
- if the parameter is null
public 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 anythingnull
IllegalArgumentException
- if scanner
is null
public 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 anythingnull
IllegalArgumentException
- if scanner
is null
public 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 anythingnull
IllegalArgumentException
- if scanner
is null
public 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 anythingnull
IllegalArgumentException
- if scanner
is null
public 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 anythingnull
IllegalArgumentException
- if scanner
is null
public 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 anythingnull
IllegalArgumentException
- if scanner
is null
public 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 anythingnull
IllegalArgumentException
- if scanner
is null
public 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 anythingnull
IllegalArgumentException
- if scanner
is null
public 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 anythingnull
IllegalArgumentException
- if scanner
is null
public static String buildString(List<? extends JavadocToken> tokens)
tokens
- the target tokensCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.