public final class JSDocInfoBuilder
extends java.lang.Object
Constructor and Description |
---|
JSDocInfoBuilder(boolean parseDocumentation) |
Modifier and Type | Method and Description |
---|---|
boolean |
addAuthor(java.lang.String author)
Adds an author to the current information.
|
boolean |
addLicense(java.lang.String license) |
boolean |
addReference(java.lang.String reference)
Adds a reference ("@see") to the current information.
|
void |
addSuppression(java.lang.String suppression) |
JSDocInfo |
build()
Builds a
JSDocInfo object based on the populated information and returns it. |
JSDocInfo |
build(boolean always)
Builds a
JSDocInfo object based on the populated information and
returns it. |
JSDocInfo |
buildAndReset()
Builds a
JSDocInfo object based on the populated information and
returns it. |
boolean |
changeBaseType(JSTypeExpression jsType)
Changes a base type, even if one has already been set on currentInfo.
|
static JSDocInfoBuilder |
copyFrom(JSDocInfo info) |
boolean |
hasParameter(java.lang.String name) |
boolean |
isConstructorRecorded()
|
boolean |
isCustomElementRecorded()
Returns whether current JSDoc is annotated with
@customElement . |
boolean |
isDeprecationReasonRecorded()
Returns whether a deprecation reason has been recorded.
|
boolean |
isDescriptionRecorded()
Returns whether this builder recorded a description.
|
boolean |
isDictRecorded() |
boolean |
isInterfaceRecorded()
|
boolean |
isMixinClassRecorded()
Returns whether current JSDoc is annotated with
@mixinClass . |
boolean |
isMixinFunctionRecorded()
Returns whether current JSDoc is annotated with
@mixinFunction . |
boolean |
isNgInjectRecorded()
Returns whether current JSDoc is annotated with
@ngInject . |
boolean |
isPolymerBehaviorRecorded()
Returns whether current JSDoc is annotated with
@polymerBehavior . |
boolean |
isPolymerRecorded()
Returns whether current JSDoc is annotated with
@polymer . |
boolean |
isPopulated()
|
boolean |
isPopulatedWithFileOverview()
|
boolean |
isStructRecorded() |
boolean |
isUnrestrictedRecorded() |
boolean |
isWizactionRecorded()
Returns whether current JSDoc is annotated with
@wizaction . |
void |
markAnnotation(java.lang.String annotation,
int lineno,
int charno)
Adds a marker to the current JSDocInfo and populates the marker with the
annotation information.
|
void |
markName(java.lang.String name,
Node templateNode,
int lineno,
int charno)
Adds a name declaration to the current marker.
|
void |
markText(java.lang.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.
|
static JSDocInfoBuilder |
maybeCopyFrom(JSDocInfo info) |
void |
mergePropertyBitfieldFrom(JSDocInfo other) |
void |
overwriteVisibility(JSDocInfo.Visibility visibility) |
boolean |
recordAbstract()
|
boolean |
recordBaseType(JSTypeExpression jsType)
Records a base type.
|
boolean |
recordBlockDescription(java.lang.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 |
recordCustomElement()
Records that this method is to be exposed as a customElement.
|
boolean |
recordDefineType(JSTypeExpression type)
Records the type of a define.
|
boolean |
recordDeprecated()
|
boolean |
recordDeprecationReason(java.lang.String reason)
Records the deprecation reason.
|
boolean |
recordDescription(java.lang.String description)
Records a description giving context for translation (i18n).
|
boolean |
recordDict()
|
boolean |
recordDisposesParameter(java.util.List<java.lang.String> parameterNames)
Records a parameter that gets disposed.
|
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(java.lang.String description)
Records a fileoverview description.
|
boolean |
recordFinality()
|
boolean |
recordHiddenness()
|
boolean |
recordIdGenerator()
|
boolean |
recordImplementedInterface(JSTypeExpression interfaceName)
Records an implemented interface.
|
boolean |
recordImplicitCast()
|
boolean |
recordImplicitMatch()
Records that the
JSDocInfo being built should have its
JSDocInfo.usesImplicitMatch() flag set to true . |
void |
recordInlineType() |
boolean |
recordInterface()
|
boolean |
recordLends(JSTypeExpression name)
Records that we're lending to another name.
|
boolean |
recordLicense(java.lang.String license) |
boolean |
recordMappedIdGenerator()
Records that the
JSDocInfo being built should have its JSDocInfo.isStableIdGenerator() flag set to true . |
boolean |
recordMeaning(java.lang.String meaning)
Records a meaning giving context for translation (i18n).
|
boolean |
recordMixinClass()
Records that this method is to be exposed as a mixinClass.
|
boolean |
recordMixinFunction()
Records that this method is to be exposed as a mixinFunction.
|
boolean |
recordModifies(java.util.Set<java.lang.String> modifies)
Records the list of modifies warnings.
|
boolean |
recordNgInject(boolean ngInject)
Records that we'd like to add
$inject property inferred from
parameters. |
boolean |
recordNoCollapse()
|
boolean |
recordNoCompile()
|
boolean |
recordNoInline()
|
boolean |
recordNoSideEffects()
Records that the
JSDocInfo being built should have its
JSDocInfo.isNoSideEffects() flag set to true . |
void |
recordOriginalCommentPosition(int position)
Sets the position of original JSDoc comment.
|
void |
recordOriginalCommentString(java.lang.String sourceComment)
Sets the original JSDoc comment string.
|
boolean |
recordOverride()
|
boolean |
recordParameter(java.lang.String parameterName,
JSTypeExpression type)
Records a typed parameter.
|
boolean |
recordParameterDescription(java.lang.String parameterName,
java.lang.String description)
Records a parameter's description.
|
boolean |
recordPolymer()
Records that this method is to be exposed as a polymer element.
|
boolean |
recordPolymerBehavior()
Records that this method is to be exposed as a polymerBehavior.
|
boolean |
recordReturnDescription(java.lang.String description)
Records a return description
|
boolean |
recordReturnType(JSTypeExpression jsType)
Records a return type.
|
boolean |
recordStableIdGenerator()
Records that the
JSDocInfo being built should have its JSDocInfo.isStableIdGenerator() flag set to true . |
boolean |
recordStruct()
|
void |
recordSuppressions(java.util.Set<java.lang.String> suppressions)
Records the list of suppressed warnings, possibly adding to the set of already configured
warnings.
|
boolean |
recordTemplateTypeName(java.lang.String name)
Records a template type name.
|
boolean |
recordThisType(JSTypeExpression type)
Records a type for
@this annotation. |
boolean |
recordThrowDescription(JSTypeExpression type,
java.lang.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 |
recordTypeSummary()
|
boolean |
recordTypeTransformation(java.lang.String name,
Node expr)
Records a type transformation expression together with its template
type name.
|
boolean |
recordUnrestricted()
Records that the
JSDocInfo being built should have its
JSDocInfo.makesUnrestricted() flag set to true . |
boolean |
recordVersion(java.lang.String version)
Records the version.
|
boolean |
recordVisibility(JSDocInfo.Visibility visibility)
Records a visibility.
|
boolean |
recordWizaction()
Records that this method is to be exposed as a wizaction.
|
boolean |
recordXidGenerator()
|
boolean |
shouldParseDocumentation() |
public static JSDocInfoBuilder copyFrom(JSDocInfo info)
public static JSDocInfoBuilder maybeCopyFrom(@Nullable JSDocInfo info)
public void recordOriginalCommentString(java.lang.String sourceComment)
public void recordOriginalCommentPosition(int position)
public boolean shouldParseDocumentation()
public boolean isPopulated()
public boolean isPopulatedWithFileOverview()
public boolean isDescriptionRecorded()
public JSDocInfo build()
JSDocInfo
object based on the populated information and returns it.JSDocInfo
object populated with the values given to this builder. If no value
was populated, this method simply returns null
public JSDocInfo build(boolean always)
JSDocInfo
object based on the populated information and
returns it.always
- Return an default JSDoc object.JSDocInfo
object populated with the values given to this
builder. If no value was populated and always
is false, returns
null
. If always
is true, returns a default JSDocInfo.public JSDocInfo buildAndReset()
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.JSDocInfo
object populated with the values given to this
builder. If no value was populated, this method simply returns
null
public void markAnnotation(java.lang.String annotation, int lineno, int charno)
public void markText(java.lang.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)
public void markName(java.lang.String name, Node templateNode, int lineno, int charno)
public boolean recordBlockDescription(java.lang.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 void overwriteVisibility(JSDocInfo.Visibility visibility)
public boolean recordParameter(java.lang.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(java.lang.String parameterName, java.lang.String description)
true
if the parameter's description was recorded and
false
if a parameter with the same name was already definedpublic boolean recordTemplateTypeName(java.lang.String name)
true
if the template type name was recorded and
false
if the input template type name was already defined.public boolean recordTypeTransformation(java.lang.String name, Node expr)
public boolean recordThrowType(JSTypeExpression type)
public boolean recordThrowDescription(JSTypeExpression type, java.lang.String description)
true
if the type's description was recorded and
false
if a description with the same type was already definedpublic boolean addAuthor(java.lang.String author)
public boolean addReference(java.lang.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 recordStableIdGenerator()
JSDocInfo
being built should have its JSDocInfo.isStableIdGenerator()
flag set to true
.true
if the stableIdGenerator flag was recorded and false
if it was
already recorded.public boolean recordXidGenerator()
true
if the isXidGenerator flag was recorded and false
if it was
already recorded.public boolean recordMappedIdGenerator()
JSDocInfo
being built should have its JSDocInfo.isStableIdGenerator()
flag set to true
.true
if the stableIdGenerator flag was recorded and false
if it was
already recorded.public boolean recordVersion(java.lang.String version)
public boolean recordDeprecationReason(java.lang.String reason)
public boolean isDeprecationReasonRecorded()
public void recordSuppressions(java.util.Set<java.lang.String> suppressions)
public void addSuppression(java.lang.String suppression)
public boolean recordModifies(java.util.Set<java.lang.String> modifies)
public boolean recordType(JSTypeExpression type)
true
if the type was recorded and false
if
it is invalid or was already definedpublic void recordInlineType()
public 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(java.lang.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 changeBaseType(JSTypeExpression jsType)
true
if the base type was changed successfully.public boolean recordConstancy()
true
if the constancy was recorded and false
if it was already definedpublic boolean recordFinality()
true
if the finality was recorded and false
if it was already definedpublic boolean recordDescription(java.lang.String description)
true
if the description was recorded and false
if the description was invalid or was already definedpublic boolean recordMeaning(java.lang.String meaning)
true
If the meaning was successfully updated.public boolean recordFileOverview(java.lang.String description)
true
if the description was recorded and false
if the description was invalid or was already defined.public boolean recordLicense(java.lang.String license)
public boolean addLicense(java.lang.String license)
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 recordNoCollapse()
true
if the no collapse flag was recorded and false
if it was already recordedpublic boolean recordNoInline()
true
if the no inline 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 recordImplicitMatch()
JSDocInfo
being built should have its
JSDocInfo.usesImplicitMatch()
flag set to true
.true
if the @record
tag was recorded and false
if it was already defined or it was incompatible with the existing
flagspublic boolean isConstructorRecorded()
public boolean recordUnrestricted()
JSDocInfo
being built should have its
JSDocInfo.makesUnrestricted()
flag set to true
.true
if annotation was recorded and false
if it was already defined or it was incompatible with the existing flagspublic boolean isUnrestrictedRecorded()
public boolean recordAbstract()
true
if the flag was recorded and false
if it was already defined or it was incompatible with the existing flagspublic boolean recordStruct()
true
if the struct was recorded and false
if it was already defined or it was incompatible with the existing flagspublic boolean isStructRecorded()
public boolean recordDict()
true
if the dict was recorded and false
if it was already defined or it was incompatible with the existing flagspublic boolean isDictRecorded()
public boolean recordOverride()
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 recordImplicitCast()
public boolean recordNoSideEffects()
JSDocInfo
being built should have its
JSDocInfo.isNoSideEffects()
flag set to true
.public boolean recordExterns()
public boolean recordTypeSummary()
public boolean isInterfaceRecorded()
public boolean hasParameter(java.lang.String name)
public boolean recordImplementedInterface(JSTypeExpression interfaceName)
public boolean recordExtendedInterface(JSTypeExpression interfaceType)
public boolean recordLends(JSTypeExpression name)
public boolean isNgInjectRecorded()
@ngInject
.public boolean recordNgInject(boolean ngInject)
$inject
property inferred from
parameters.public boolean isWizactionRecorded()
@wizaction
.public boolean recordWizaction()
public boolean isPolymerBehaviorRecorded()
@polymerBehavior
.public boolean recordPolymerBehavior()
public boolean isPolymerRecorded()
@polymer
.public boolean recordPolymer()
public boolean isCustomElementRecorded()
@customElement
.public boolean recordCustomElement()
public boolean isMixinClassRecorded()
@mixinClass
.public boolean recordMixinClass()
public boolean isMixinFunctionRecorded()
@mixinFunction
.public boolean recordMixinFunction()
public void mergePropertyBitfieldFrom(JSDocInfo other)
public boolean recordDisposesParameter(java.util.List<java.lang.String> parameterNames)
true
if all the parameters was recorded and
false
if a parameter with the same name was already definedCopyright © 2009-2018 Google. All Rights Reserved.