public abstract class AbstractJavadocParser extends java.lang.Object implements JavadocParser
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractJavadocParser.FirstPassParameter
Holder for the first pass over parameters
|
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
WS_CHARS
Use this because some of the white characters aren't regular whitespace
|
protected static java.lang.String |
WS_CHARS_ONE_OR_MORE
Use this because some of the white characters aren't regular whitespace
|
protected static java.lang.String |
WS_CHARS_ZERO_OR_MORE
Use this because some of the white characters aren't regular whitespace
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractJavadocParser(java.lang.String... baseDocURLs) |
Modifier and Type | Method and Description |
---|---|
void |
addBaseDocURL(java.lang.String baseDocURL)
Adds a new documentation base url (it is appended to the current list)
|
void |
clearBaseDocURLs()
Clears all base doc urls for the provider
|
java.util.List<java.lang.String> |
getAllPossibleClasses()
Uses the base urls and returns a list of all classes this parser should be able to load docs for (based on the root allclasses doc file(s))
|
protected abstract java.util.Map<java.lang.String,SimpleTrie<java.lang.String,java.lang.Boolean>> |
getAvailableClassesMap()
Returns the mapping of URLs to available classes we can document from that url
|
java.util.List<java.lang.String> |
getBaseDocURLs()
Returns the BaseDocURLs for the provider (as a copy of the internal list)
|
protected org.jsoup.nodes.Element |
getFirstMatchingChildRecursive(org.jsoup.select.Elements elements,
java.lang.String tagName,
java.lang.String attributeName,
java.lang.String attributeValue,
java.lang.String textContent) |
protected org.jsoup.nodes.Element |
getFirstMatchingSibling(org.jsoup.nodes.Element element,
java.lang.String tagName,
java.lang.String attributeName,
java.lang.String attributeValue,
java.lang.String textContent) |
ClassDocumentation |
parseFromFile(java.io.File file)
Attempts to download the documentation from the internet and return it
|
ClassDocumentation |
parseFromURL(java.lang.Class clazz,
java.io.File cachedDocFileLocalCache)
Attempts to download the documentation from the internet and return it
|
boolean |
removeBaseDocURL(java.lang.String baseDocURL)
Removes a documentation base url if present
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
parseHTML
protected static final java.lang.String WS_CHARS
protected static final java.lang.String WS_CHARS_ZERO_OR_MORE
protected static final java.lang.String WS_CHARS_ONE_OR_MORE
protected AbstractJavadocParser(@NotNull java.lang.String... baseDocURLs)
protected abstract java.util.Map<java.lang.String,SimpleTrie<java.lang.String,java.lang.Boolean>> getAvailableClassesMap()
@NotNull public java.util.List<java.lang.String> getBaseDocURLs()
public void addBaseDocURL(@NotNull java.lang.String baseDocURL)
baseDocURL
- The url to addpublic boolean removeBaseDocURL(@NotNull java.lang.String baseDocURL)
baseDocURL
- The url to removepublic void clearBaseDocURLs()
@NotNull public ClassDocumentation parseFromFile(@NotNull java.io.File file) throws java.io.IOException
JavadocParser
parseFromFile
in interface JavadocParser
file
- The file containing the docjava.io.IOException
- If there is an error reading the file@NotNull public ClassDocumentation parseFromURL(@NotNull java.lang.Class clazz, @Nullable java.io.File cachedDocFileLocalCache) throws java.io.IOException
JavadocParser
parseFromURL
in interface JavadocParser
clazz
- The class to get the docs forcachedDocFileLocalCache
- The location in which to store the downloaded file, if we found one that downloaded and parsed successfully. Null means
don't cachejava.io.IOException
- If there is an error reading the URL@NotNull public java.util.List<java.lang.String> getAllPossibleClasses()
JavadocParser
getAllPossibleClasses
in interface JavadocParser
@Nullable protected org.jsoup.nodes.Element getFirstMatchingChildRecursive(@NotNull org.jsoup.select.Elements elements, @Nullable java.lang.String tagName, @Nullable java.lang.String attributeName, @Nullable java.lang.String attributeValue, @Nullable java.lang.String textContent)