public class Util
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
docCommentToHtml(java.lang.String dc)
Converts a Java documentation comment to HTML.
|
static java.lang.String |
forXML(java.lang.String aText) |
static CompilationUnit |
getCompilationUnitFromDisk(SourceLocation loc,
ClassFile cf)
Used by
MemberCompletion.Data implementations to get an AST
from a source file in a SourceLocation. |
static java.lang.String |
getUnqualified(java.lang.String clazz)
Returns the "unqualified" version of a (possibly) fully-qualified
class name.
|
static boolean |
isFullyQualified(java.lang.String str)
Returns whether the specified string is "fully qualified," that is,
whether it contains a '
.' character. |
static java.lang.String[] |
splitOnChar(java.lang.String str,
int ch)
A faster way to split on a single char than String#split(), since
we'll be doing this in a tight loop possibly thousands of times (rt.jar).
|
public static final java.lang.String docCommentToHtml(java.lang.String dc)
This is a pre block
dc - The documentation comment.public static java.lang.String forXML(java.lang.String aText)
public static CompilationUnit getCompilationUnitFromDisk(SourceLocation loc, ClassFile cf)
MemberCompletion.Data implementations to get an AST
from a source file in a SourceLocation. Classes should prefer
this method over calling into the location directly since this method
caches the most recent result for performance.loc - A directory or zip/jar file.cf - The ClassFile representing the source grab from the
location.null if it is not found
or an IO error occurs.public static final java.lang.String getUnqualified(java.lang.String clazz)
clazz - The class name.public static final boolean isFullyQualified(java.lang.String str)
.' character.str - The string to check.getUnqualified(String)public static final java.lang.String[] splitOnChar(java.lang.String str,
int ch)
String.split(String)),
in the case where str ends with ch - this
method will return an empty item at the end of the returned array, while
String#split() will not.str - The string to split.ch - The char to split on.