public class NewJavaDocLinkReplacerFor extends Object
Convenience functions for creating com.github.xbn.regexutil.RegexReplacers that replace a class, constructor, function, or object name with a clickable JavaDoc link.
aliteralmind __DASH__ github __AT__ yahoo __DOT__ com), dual-licensed under the LGPL (version 3.0 or later) or the ASL (version 2.0). See source code for details. http://codelet.aliteralmind.com, https://github.com/aliteralmind/codeletNewJDLinkForWordOccuranceNum| Modifier and Type | Method and Description |
|---|---|
static RegexReplacer |
cclass(CodeletInstance instance,
Class target,
Appendable dbgDest_ifNonNull)
Changes a class name to a JavaDoc link.
|
static RegexReplacer |
constructor(CodeletInstance instance,
Constructor<?> target,
Appendable dbgDest_ifNonNull)
Changes a constructor name to a JavaDoc link.
|
static RegexReplacer |
field(CodeletInstance instance,
Field target,
Appendable dbgDest_ifNonNull)
Changes a field name (an object existing in another class) to a JavaDoc link.
|
static String |
getDocRootUrlToTargetClass(CodeletInstance instance,
Class<?> target)
Get the
{@docRoot} url for a package, which may be internal or external. |
static RegexReplacer |
method(CodeletInstance instance,
Method target,
Appendable dbgDest_ifNonNull)
Changes a function name to a JavaDoc link.
|
static RegexReplacer |
newReplaceCnstrFuncNameOpenParenWith(String word_findWhat,
String link_rplcWith,
Appendable dbgDest_ifNonNull)
A new replacer for replacing the first occurance of a whole word with a link.
|
static RegexReplacer |
newReplaceWordOnlyWith(String word_findWhat,
String link_rplcWith,
Appendable dbgDest_ifNonNull)
A new replacer for replacing the first occurance of a class or field name with a link.
|
public static final RegexReplacer cclass(CodeletInstance instance, Class target, Appendable dbgDest_ifNonNull)
Changes a class name to a JavaDoc link.
instance - May not be null.target - May not be null.newReplaceWordOnlyWith(
target.getName(), link, dbgDest_ifNonNull)
link's url is
JavaDocUtil.getUrlToClass(instance.getRelativeUrlToDocRoot(), target)
public static final RegexReplacer newReplaceCnstrFuncNameOpenParenWith(String word_findWhat, String link_rplcWith, Appendable dbgDest_ifNonNull)
A new replacer for replacing the first occurance of a whole word with a link.
new RegexReplacer_Cfg().
com.github.xbn.regexutil.z.RegexReplacer_CfgForNeeder#direct(String, Object)(Pattern.compile("\\b" + word_findWhat + "\\b([ \\t]\*\()"), link_rplcWith + "$1").
debugTo(dbgDest_ifNonNull).first().build()newReplaceWordOnlyWithpublic static final RegexReplacer newReplaceWordOnlyWith(String word_findWhat, String link_rplcWith, Appendable dbgDest_ifNonNull)
A new replacer for replacing the first occurance of a class or field name with a link.
new RegexReplacer_Cfg().
com.github.xbn.regexutil.z.RegexReplacer_CfgForNeeder#direct(String, Object)(Pattern.compile("\\b" + word_findWhat + "\\b"), link_rplcWith).
debugTo(dbgDest_ifNonNull).first().build()newReplaceCnstrFuncNameOpenParenWithpublic static final RegexReplacer constructor(CodeletInstance instance, Constructor<?> target, Appendable dbgDest_ifNonNull)
Changes a constructor name to a JavaDoc link.
public static final RegexReplacer method(CodeletInstance instance, Method target, Appendable dbgDest_ifNonNull)
Changes a function name to a JavaDoc link.
instance - May not be null.target - May not be null.newReplaceCnstrFuncNameOpenParenWith(
target.getName(), link, dbgDest_ifNonNull)
link's url is
JavaDocUtil.getUrlToMethod(instance.getRelativeUrlToDocRoot(), target)
public static final RegexReplacer field(CodeletInstance instance, Field target, Appendable dbgDest_ifNonNull)
Changes a field name (an object existing in another class) to a JavaDoc link.
instance - May not be null.target - May not be null.newReplaceWordOnlyWith(target.getName(), link, dbgDest_ifNonNull)
link's url is
JavaDocUtil.getUrlToField(instance.getRelativeUrlToDocRoot(), target)
public static final String getDocRootUrlToTargetClass(CodeletInstance instance, Class<?> target)
Get the {@docRoot} url for a package, which may be internal or external.
instance - May not be null.target - The class being linked to. May not be null, and must be in a package (target.getPackage().getName() must be non-empty).CodeletBaseConfig.getAllJavaDocRoots().getPkgToUrlMap().get(target.getPackage().getName()) isnull: The value returned from the map.null: instance.getRelativeUrlToDocRoot()Copyright 2014, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.
https://github.com/aliteralmind/codelet