public final class JSDocInfoBuilder extends Object
Constructor and Description |
---|
JSDocInfoBuilder(boolean parseDocumentation) |
Modifier and Type | Method and Description |
---|---|
boolean |
addAuthor(String author)
Adds an author to the current information.
|
boolean |
addReference(String reference)
Adds a reference ("@see") to the current information.
|
JSDocInfo |
build(Node associatedNode)
Builds a
JSDocInfo object based on the populated information and
returns it. |
boolean |
hasParameter(String name) |
boolean |
isConstructorRecorded()
|
boolean |
isDescriptionRecorded()
Returns whether this builder recorded a description.
|
boolean |
isInterfaceRecorded()
|
boolean |
isJavaDispatch()
|
boolean |
isPopulated()
Returns whether this builder is populated with information that can be
used to
build(com.google.javascript.rhino.Node) a JSDocInfo object. |
boolean |
isPopulatedWithFileOverview()
Returns whether this builder is populated with information that can be
used to
build(com.google.javascript.rhino.Node) a JSDocInfo object that has a
fileoverview tag. |
void |
markAnnotation(String annotation,
int lineno,
int charno)
Adds a marker to the current JSDocInfo and populates the marker with the
annotation information.
|
void |
markName(String name,
int lineno,
int charno)
Deprecated.
Use #markName(String, StaticSourceFile, int, int)
|
void |
markName(String name,
StaticSourceFile file,
int lineno,
int charno)
Adds a name declaration to the current marker.
|
void |
markText(String text,
int startLineno,
int startCharno,
int endLineno,
int endCharno)
Adds a textual block to the current marker.
|
void |
markTypeNode(Node typeNode,
int lineno,
int startCharno,
int endLineno,
int endCharno,
boolean hasLC)
Adds a type declaration to the current marker.
|
boolean |
recordBaseType(JSTypeExpression jsType)
Records a base type.
|
boolean |
recordBlockDescription(String description)
Records a block-level description.
|
boolean |
recordConsistentIdGenerator()
Records that the
JSDocInfo being built should have its
JSDocInfo.isConsistentIdGenerator() flag set to
true . |
boolean |
recordConstancy()
|
boolean |
recordConstructor()
|
boolean |
recordDefineType(JSTypeExpression type)
Records the type of a define.
|
boolean |
recordDeprecated()
|
boolean |
recordDeprecationReason(String reason)
Records the deprecation reason.
|
boolean |
recordDescription(String description)
Records a description giving context for translation (i18n).
|
boolean |
recordEnumParameterType(JSTypeExpression type)
Records a parameter type to an enum.
|
boolean |
recordExport()
|
boolean |
recordExpose()
|
boolean |
recordExtendedInterface(JSTypeExpression interfaceType)
Records an extended interface type.
|
boolean |
recordExterns()
|
boolean |
recordFileOverview(String description)
Records a fileoverview description.
|
boolean |
recordHiddenness()
|
boolean |
recordIdGenerator()
|
boolean |
recordImplementedInterface(JSTypeExpression interfaceName)
Records an implemented interface.
|
boolean |
recordImplicitCast()
|
boolean |
recordInterface()
|
boolean |
recordJavaDispatch()
|
boolean |
recordLends(String name)
Records that we're lending to another name.
|
boolean |
recordMeaning(String meaning)
Records a meaning giving context for translation (i18n).
|
boolean |
recordModifies(Set<String> modifies)
Records the list of modifies warnings.
|
boolean |
recordNoAlias()
|
boolean |
recordNoCompile()
|
boolean |
recordNoShadow()
|
boolean |
recordNoSideEffects()
Records that the
JSDocInfo being built should have its
JSDocInfo.isNoSideEffects() flag set to true . |
boolean |
recordNoTypeCheck()
|
void |
recordOriginalCommentString(String sourceComment)
Sets the original JSDoc comment string.
|
boolean |
recordOverride()
|
boolean |
recordParameter(String parameterName,
JSTypeExpression type)
Records a typed parameter.
|
boolean |
recordParameterDescription(String parameterName,
String description)
Records a parameter's description.
|
boolean |
recordPreserveTry()
Records that the
JSDocInfo being built should have its
JSDocInfo.shouldPreserveTry() flag set to true . |
boolean |
recordReturnDescription(String description)
Records a return description
|
boolean |
recordReturnType(JSTypeExpression jsType)
Records a return type.
|
boolean |
recordSuppressions(Set<String> suppressions)
Records the list of suppressed warnings.
|
boolean |
recordTemplateTypeNames(List<String> names)
Records a template type name.
|
boolean |
recordThisType(JSTypeExpression type)
Records a type for
@this annotation. |
boolean |
recordThrowDescription(JSTypeExpression type,
String description)
Records a throw type's description.
|
boolean |
recordThrowType(JSTypeExpression type)
Records a thrown type.
|
boolean |
recordType(JSTypeExpression type)
Records a type.
|
boolean |
recordTypedef(JSTypeExpression type)
Records that the
JSDocInfo being built should be populated
with a typedef 'd type. |
boolean |
recordVersion(String version)
Records the version.
|
boolean |
recordVisibility(JSDocInfo.Visibility visibility)
Records a visibility.
|
boolean |
shouldParseDocumentation() |
public void recordOriginalCommentString(String sourceComment)
public boolean shouldParseDocumentation()
public boolean isPopulated()
build(com.google.javascript.rhino.Node)
a JSDocInfo
object.public boolean isPopulatedWithFileOverview()
build(com.google.javascript.rhino.Node)
a JSDocInfo
object that has a
fileoverview tag.public boolean isDescriptionRecorded()
public JSDocInfo build(Node associatedNode)
JSDocInfo
object based on the populated information and
returns it. Once this method is called, the builder can be reused to build
another JSDocInfo
object.associatedNode
- The source node containing the JSDoc.JSDocInfo
object populated with the values given to this
builder. If no value was populated, this method simply returns
null
public void markAnnotation(String annotation, int lineno, int charno)
public void markText(String text, int startLineno, int startCharno, int endLineno, int endCharno)
public void markTypeNode(Node typeNode, int lineno, int startCharno, int endLineno, int endCharno, boolean hasLC)
@Deprecated public void markName(String name, int lineno, int charno)
public void markName(String name, StaticSourceFile file, int lineno, int charno)
public boolean recordBlockDescription(String description)
true
if the description was recorded.public boolean recordVisibility(JSDocInfo.Visibility visibility)
true
if the visibility was recorded and false
if it was already definedpublic boolean recordParameter(String parameterName, JSTypeExpression type)
true
if the typed parameter was recorded and
false
if a parameter with the same name was already definedpublic boolean recordParameterDescription(String parameterName, String description)
true
if the parameter's description was recorded and
false
if a parameter with the same name was already definedpublic boolean recordTemplateTypeNames(List<String> names)
true
if the template type name was recorded and
false
if a template type name was already defined.public boolean recordThrowType(JSTypeExpression type)
public boolean recordThrowDescription(JSTypeExpression type, String description)
true
if the type's description was recorded and
false
if a description with the same type was already definedpublic boolean addAuthor(String author)
public boolean addReference(String reference)
public boolean recordConsistentIdGenerator()
JSDocInfo
being built should have its
JSDocInfo.isConsistentIdGenerator()
flag set to
true
.true
if the consistentIdGenerator flag was recorded and
false
if it was already recordedpublic boolean recordVersion(String version)
public boolean recordDeprecationReason(String reason)
public boolean recordSuppressions(Set<String> suppressions)
public boolean recordModifies(Set<String> modifies)
public boolean recordType(JSTypeExpression type)
true
if the type was recorded and false
if
it is invalid or was already definedpublic boolean recordTypedef(JSTypeExpression type)
JSDocInfo
being built should be populated
with a typedef
'd type.public boolean recordIdGenerator()
true
if the idGenerator flag was recorded and false
if it was already recordedpublic boolean recordReturnType(JSTypeExpression jsType)
true
if the return type was recorded and false
if
it is invalid or was already definedpublic boolean recordReturnDescription(String description)
true
if the return description was recorded and
false
if it is invalid or was already definedpublic boolean recordDefineType(JSTypeExpression type)
public boolean recordEnumParameterType(JSTypeExpression type)
true
if the enum's parameter type was recorded and
false
if it was invalid or already definedpublic boolean recordThisType(JSTypeExpression type)
@this
annotation.true
if the type was recorded and
false
if it is invalid or if it collided with @enum
or
@type
annotationspublic boolean recordBaseType(JSTypeExpression jsType)
true
if the base type was recorded and false
if it was already definedpublic boolean recordConstancy()
true
if the constancy was recorded and false
if it was already definedpublic boolean recordDescription(String description)
true
if the description was recorded and false
if the description was invalid or was already definedpublic boolean recordMeaning(String meaning)
true
If the meaning was successfully updated.public boolean recordFileOverview(String description)
true
if the description was recorded and false
if the description was invalid or was already defined.public boolean recordHiddenness()
true
if the hiddenness was recorded and false
if it was already definedpublic boolean recordNoCompile()
true
if the no compile flag was recorded and false
if it was already recordedpublic boolean recordNoTypeCheck()
true
if the no check flag was recorded and false
if it was already recordedpublic boolean recordConstructor()
true
if the constructor was recorded and false
if it was already defined or it was incompatible with the existing
flagspublic boolean isConstructorRecorded()
public boolean recordJavaDispatch()
true
if the javadispatch was recorded and false
if it was already defined or it was incompatible with the existing
flagspublic boolean isJavaDispatch()
public boolean recordPreserveTry()
JSDocInfo
being built should have its
JSDocInfo.shouldPreserveTry()
flag set to true
.public boolean recordOverride()
public boolean recordNoAlias()
public boolean recordDeprecated()
public boolean recordInterface()
true
if the flag was recorded and false
if it was already defined or it was incompatible with the existing
flagspublic boolean recordExport()
public boolean recordExpose()
public boolean recordNoShadow()
public boolean recordImplicitCast()
public boolean recordNoSideEffects()
JSDocInfo
being built should have its
JSDocInfo.isNoSideEffects()
flag set to true
.public boolean recordExterns()
public boolean isInterfaceRecorded()
public boolean hasParameter(String name)
public boolean recordImplementedInterface(JSTypeExpression interfaceName)
public boolean recordExtendedInterface(JSTypeExpression interfaceType)
public boolean recordLends(String name)