public class

RefLocator

extends RefProvider

 java.lang.Object

com.parrot.docdown.data.RefProvider

↳com.parrot.docdown.data.RefLocator

Overview

Locate references to documentation pages and resources.

References can be:

  • name of a markup document: doc1
  • relative of absolute path of markup document
  • package name: com.parrot.package
  • unqualified class name: MyClass
  • qualified class name: com.parrot.MyClass
  • class field: MyClass#value or com.parrot.MyClass#value
  • class method: MyClass#getValue or MyClass#getValue(int)

Summary

Fields
private final RootProjectDocprojectRootDoc

private final com.sun.javadoc.RootDocrootDoc

from RefProviderapiRefProviderList, unknownRefProvider
Constructors
publicRefLocator(DocPageStore store, Collection<IRefProvider> externalProviders, com.sun.javadoc.RootDoc rootDoc, RootProjectDoc projectRootDoc)

Constructor

Methods
private voidaddMatchingClassDocRefs(String name, List<DocReferenceable> matches)

Add DocReferenceable to classes matching the given name to the matches list.

private voidaddMatchingExecutableRef(String className, String member, List<DocReferenceable> matches)

Add DocReferenceable to methods matching the given name to the matches list.

private voidaddMatchingFieldRef(String className, String member, List<DocReferenceable> matches)

Add DocReferenceable to fields matching the given name to the matches list.

private voidaddMatchingMarkupDocRefs(String name, List<DocReferenceable> matches)

Add DocReferenceable to markup documents matching the given name to the matches list.

private voidaddMatchingPackageDocRefs(String name, List<DocReferenceable> matches)

Add DocReferenceable to packages matching the given name to the matches list.

private voidaddMatchingResourceDocRefs(String name, List<DocReferenceable> matches)

Add DocReferenceable to resource files matching the given name to the matches list.

public DocReferenceablefind(String name, com.sun.javadoc.SourcePosition sourcePosition)

Look for a reference to a package, class, field, method or markup document

public DocReferenceablefind(String name, com.sun.javadoc.SourcePosition sourcePosition, String markupDocContainer)

Look for a reference to a package, class, field, method or markup document, in the context of a markup document path

private List<DocReferenceable>findAll(String name)

Find a markup doc, package, class, or field or method.

public StringfindIncludedCode(String name, String id, com.sun.javadoc.SourcePosition sourcePosition)

private MarkupDocfindMarkupDoc(String markupDocPath, String markupDocContainer)

Find a markup doc in the given path, relative or absolute.

private ResourceDocfindResourceFile(String resourceFilePath, String markupDocContainer)

Find a resource doc in the given path, relative or absolute.

from RefProvidergetClassDocRef, getExecutableMemberDocRef, getFieldDocRef, getMarkupDocRef, getPackageDocRef, getResourceFileRef
from Object, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait

Fields

private final com.sun.javadoc.RootDoc rootDoc

private final RootProjectDoc projectRootDoc

Constructors

public RefLocator(DocPageStore store, Collection<IRefProvider> externalProviders, com.sun.javadoc.RootDoc rootDoc, RootProjectDoc projectRootDoc)

Constructor

Parameters:

store: page store instance
externalProviders: collection of external reference provider
rootDoc: docClass rootDoc
projectRootDoc: project rootDoc

Methods

public DocReferenceable find(String name, com.sun.javadoc.SourcePosition sourcePosition)

Look for a reference to a package, class, field, method or markup document

Parameters:

name: reference name
sourcePosition: current position in the source containing the reference

Returns:

a DocReferenceable, null if not found

public DocReferenceable find(String name, com.sun.javadoc.SourcePosition sourcePosition, String markupDocContainer)

Look for a reference to a package, class, field, method or markup document, in the context of a markup document path

Parameters:

name: reference name.
sourcePosition: current position in the source containing the reference.
markupDocContainer: markup doc container to search for relative references.

Returns:

a DocReferenceable, null if not found.

public String findIncludedCode(String name, String id, com.sun.javadoc.SourcePosition sourcePosition)

private MarkupDoc findMarkupDoc(String markupDocPath, String markupDocContainer)

Find a markup doc in the given path, relative or absolute.

Parameters:

markupDocPath: path of the doc to find.
markupDocContainer: container path to start for relative paths.

Returns:

a DocReferenceable, null if not found.

private ResourceDoc findResourceFile(String resourceFilePath, String markupDocContainer)

Find a resource doc in the given path, relative or absolute.

Parameters:

resourceFilePath: path of the doc to find.
markupDocContainer: container path to start for relative paths.

Returns:

a DocReferenceable, null if not found.

private List<DocReferenceable> findAll(String name)

Find a markup doc, package, class, or field or method.

Parameters:

name: name to search

Returns:

list of matching DocReferenceable

private void addMatchingMarkupDocRefs(String name, List<DocReferenceable> matches)

Add DocReferenceable to markup documents matching the given name to the matches list.

Parameters:

name: name to search
matches: the list of match to add result to

private void addMatchingResourceDocRefs(String name, List<DocReferenceable> matches)

Add DocReferenceable to resource files matching the given name to the matches list.

Parameters:

name: name to search
matches: the list of match to add result to

private void addMatchingPackageDocRefs(String name, List<DocReferenceable> matches)

Add DocReferenceable to packages matching the given name to the matches list.

Parameters:

name: name to search
matches: the list of match to add result to

private void addMatchingClassDocRefs(String name, List<DocReferenceable> matches)

Add DocReferenceable to classes matching the given name to the matches list.

Parameters:

name: name to search
matches: the list of match to add result to

private void addMatchingFieldRef(String className, String member, List<DocReferenceable> matches)

Add DocReferenceable to fields matching the given name to the matches list.

Parameters:

className: name of the class to search the field
member: name of the field to search
matches: the list of match to add result to

private void addMatchingExecutableRef(String className, String member, List<DocReferenceable> matches)

Add DocReferenceable to methods matching the given name to the matches list.

Parameters:

className: name of the class to search the field
member: name of the method to search
matches: the list of match to add result to