Class JSDocInfo
- java.lang.Object
-
- com.google.javascript.rhino.JSDocInfo
-
- All Implemented Interfaces:
java.io.Serializable
public class JSDocInfo extends java.lang.Object implements java.io.SerializableJSDoc information describing JavaScript code. JSDoc is represented as a unified object with fields for each JSDoc annotation, even though some combinations are incorrect. For instance, if a JSDoc describes an enum, it cannot have information about a return type. This implementation takes advantage of such incompatibilities to reuse fields for multiple purposes, reducing memory consumption.Constructing
JSDocInfoobjects is simplified byJSDocInfo.Builderwhich provides early incompatibility detection.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJSDocInfo.BuilderA builder forJSDocInfoobjects.static classJSDocInfo.MarkerDefines a class for containing the parsing information for this JSDocInfo.static classJSDocInfo.NamePositionA piece of information (found in a marker) which contains a position with a name node.static classJSDocInfo.StringPositionA piece of information (found in a marker) which contains a position with a string.static classJSDocInfo.TypePositionA piece of information (found in a marker) which contains a position with a type expression syntax tree.static classJSDocInfo.VisibilityVisibility categories.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static booleanareEquivalent(JSDocInfo jsDoc1, JSDocInfo jsDoc2)static JSDocInfo.Builderbuilder()Create a new JSDocInfo.Builder object.JSDocInfoclone()JSDocInfoclone(boolean cloneTypeNodes)JSDocInfocloneAndReplaceTypeNames(java.util.Set<java.lang.String> names)Clones this JSDoc but replaces the given names in any type related annotation with unknown type.booleancontainsDeclaration()Returns whether there is a declaration present on thisJSDocInfo, including a typeless @const like/** @const * / a.b.c = 0booleancontainsDeclarationExcludingTypelessConst()Returns whether there is a declaration present on thisJSDocInfo.booleancontainsFunctionDeclaration()Deprecated.This method is quite heuristic, looking for @type annotations that start with "function".booleancontainsTypeDeclaration()Returns whether this JSDoc contains a type declaration such as/** @type {string}booleancontainsTypeDefinition()java.lang.StringgetAlternateMessageId()Gets the alternate message ID specified by the@alternateMessageIdannotation.java.util.List<java.lang.String>getAuthors()Returns the list of authors or null if none.JSTypeExpressiongetBaseType()Gets the base type specified by the@extendsannotation.java.lang.StringgetBlockDescription()Returns the block-level description or null if none specified.java.lang.StringgetClosurePrimitiveId()Returns the@closurePrimitive {id}identifierjava.lang.StringgetDeprecationReason()Returns the deprecation reason or null if none specified.java.lang.StringgetDescription()Gets the description specified by the@descannotation.@Nullable java.lang.StringgetDescriptionForParameter(java.lang.String name)Returns the description for the parameter with the given name, if its exists.java.lang.StringgetEnhance()Returns the enhanced namespace or null if none is specified.JSTypeExpressiongetEnumParameterType()Gets the enum parameter type specified by the@enumannotation.java.util.List<JSTypeExpression>getExtendedInterfaces()Returns the interfaces extended by an interfaceintgetExtendedInterfacesCount()Gets the number of extended interfaces specifiedjava.lang.StringgetFileOverview()Returns the file overview or null if none specified.intgetImplementedInterfaceCount()Gets the number of interfaces specified by the@implementsannotation.java.util.List<JSTypeExpression>getImplementedInterfaces()Returns the types specified by the@implementsannotation.JSTypeExpressiongetLendsName()Gets the name we're lending to in a@lendsannotation.java.lang.StringgetLicense()Gets the description specified by the@licenseannotation.java.util.Collection<JSDocInfo.Marker>getMarkers()Gets the list of all markers for the documentation in this JSDoc.java.lang.StringgetMeaning()Gets the meaning specified by the@meaningannotation.java.util.Set<java.lang.String>getModifies()Returns the set of sideeffect notations.intgetOriginalCommentPosition()java.lang.StringgetOriginalCommentString()Returns the original JSDoc comment string.intgetParameterCount()Gets the number of parameters defined.@Nullable java.lang.StringgetParameterNameAt(int index)Returns the nth name in the defined parameters.java.util.Set<java.lang.String>getParameterNames()Returns the set of names of the defined parameters.@Nullable JSTypeExpressiongetParameterType(java.lang.String parameter)Gets the type of a given named parameter.protected java.lang.ObjectgetPropertyValueByIndex(int index)java.util.List<java.lang.String>getReferences()Returns the list of references or null if none.java.lang.StringgetReturnDescription()Returns the description of the returned object or null if none specified.JSTypeExpressiongetReturnType()Gets the return type specified by the@returnannotation.java.util.Set<java.lang.String>getSuppressions()Returns the set of suppressed warnings.com.google.common.collect.ImmutableMap<com.google.common.collect.ImmutableSet<java.lang.String>,java.lang.String>getSuppressionsAndTheirDescription()Returns a map containing key=set of suppressions, and value=the corresponding description for the set.com.google.common.collect.ImmutableList<java.lang.String>getTemplateTypeNames()Gets the @template type names.com.google.common.collect.ImmutableMap<java.lang.String,JSTypeExpression>getTemplateTypes()JSTypeExpressiongetThisType()Gets the type specified by the@thisannotation.java.util.List<java.lang.String>getThrowsAnnotations()Returns the list of thrown types and descriptions as text.com.google.common.collect.ImmutableList<java.lang.String>getTsTypes()Gets the ts type declarations specified by the@tsTypeannotations.JSTypeExpressiongetType()Gets the type specified by the@typeannotation.JSTypeExpressiongetTypedefType()Gets the typedef type specified by the@typeannotation.java.util.Collection<JSTypeExpression>getTypeExpressions()Returns a collection of all JSTypeExpressions that are a part of this JSDocInfo.java.util.Collection<Node>getTypeNodes()Returns a collection of all type nodes that are a part of this JSDocInfo.com.google.common.collect.ImmutableMap<java.lang.String,Node>getTypeTransformations()Gets the type transformations.JSDocInfo.VisibilitygetVisibility()Gets the visibility specified by@private,@protectedor@publicannotation.booleanhasBaseType()Returns whether thisJSDocInfocontains a type for@extendsannotation.booleanhasClosurePrimitiveId()Whether this JSDoc is annotated with@closurePrimitivebooleanhasConstAnnotation()Returns whether the@constannotation is present on thisJSDocInfo.booleanhasDescriptionForParameter(java.lang.String name)Returns whether a description exists for the parameter with the specified name.booleanhasEnhance()Returns whether this has an enhanced namespace.booleanhasEnumParameterType()Returns whether an enum parameter type, specified using the@enumannotation, is present on this JSDoc.booleanhasFileOverview()Returns whether this has a fileoverview flag.booleanhasLendsName()booleanhasModifies()booleanhasParameter(java.lang.String parameter)Returns whether the parameter is defined.booleanhasParameterType(java.lang.String parameter)Returns whether the parameter has an attached type.booleanhasReturnType()Returns whether thisJSDocInfocontains a type for@returnannotation.booleanhasSideEffectsArgumentsAnnotation()Returns whether the @modifies annotation includes "arguments" or any named parameters.booleanhasThisType()Returns whether thisJSDocInfocontains a type for@thisannotation.booleanhasType()Returns whether a type, specified using the@typeannotation, is present on this JSDoc.booleanhasTypedefType()Returns whether a typedef parameter type, specified using the@typedefannotation, is present on this JSDoc.booleanhasTypeInformation()booleanisAbstract()Returns whether the@abstractannotation is present on thisJSDocInfo.booleanisAnyIdGenerator()Returns whether any@idGeneratororidGenerator {?}annotation is present.booleanisAtSignCodePresent()Returns whether the@codeis present within thisJSDocInfo.booleanisCollapsibleOrBreakMyCode()Returns whether the@collapsibleOrBreakMyCodeannotation is present on thisJSDocInfo.booleanisConsistentIdGenerator()Returns whether the@idGenerator {consistent}is present on thisJSDocInfo.booleanisConstant()Returns whether thisJSDocInfoimplies that annotated value is constant.booleanisConstructor()Returns whether the@constructorannotation is present on thisJSDocInfo.booleanisConstructorOrInterface()booleanisCustomElement()Returns whether JSDoc is annotated with@customElementannotation.booleanisDefine()Returns whether the@defineannotation is present on thisJSDocInfo.booleanisDeprecated()Returns whether the@deprecatedannotation is present on thisJSDocInfo.booleanisExport()Returns whether the@exportannotation is present on thisJSDocInfo.booleanisExterns()Returns whether the@externsannotation is present on thisJSDocInfo.booleanisFinal()Returns whether the@finalannotation is present on thisJSDocInfo.booleanisHidden()Returns whether the@hiddenannotation is present on thisJSDocInfo.booleanisIdGenerator()Returns whether the@idGeneratoris present on thisJSDocInfo.booleanisImplicitCast()Returns whether the@implicitCastannotation is present on thisJSDocInfo.booleanisInlineType()Returns whether the type annotation was inlined.booleanisInterface()Returns whether the@interfaceannotation is present on thisJSDocInfo.booleanisMappedIdGenerator()Returns whether the@idGenerator {mapped}is present on thisJSDocInfo.booleanisMixinClass()Returns whether JSDoc is annotated with@mixinClassannotation.booleanisMixinFunction()Returns whether JSDoc is annotated with@mixinFunctionannotation.booleanisNgInject()Returns whether JSDoc is annotated with@ngInjectannotation.booleanisNoCollapse()Returns whether the@nocollapseannotation is present on thisJSDocInfo.booleanisNoCompile()Returns whether the@nocompileannotation is present on thisJSDocInfo.booleanisNoDts()Returns whether the@nodtsannotation is present on thisJSDocInfo.booleanisNoInline()Returns whether the@noinlineannotation is present on thisJSDocInfo.booleanisNoSideEffects()Returns whether the@nosideeffectsannotation is present on thisJSDocInfo.booleanisOverride()Returns whether the@overrideannotation is present on thisJSDocInfo.booleanisPolymer()Returns whether JSDoc is annotated with@polymerannotation.booleanisPolymerBehavior()Returns whether JSDoc is annotated with@polymerBehaviorannotation.booleanisProvideAlreadyProvided()Returns whether the@provideAlreadyProvidedannotation is present on thisJSDocInfo.booleanisProvideGoog()Returns whether the@provideGoogannotation is present on thisJSDocInfo.booleanisPureOrBreakMyCode()Returns whether the@pureOrBreakMyCodeannotation is present on thisJSDocInfo.booleanisStableIdGenerator()Returns whether the@idGenerator {stable}is present on thisJSDocInfo.booleanisTypeSummary()Returns whether the@typeSummaryannotation is present on thisJSDocInfo.booleanisWizaction()Returns whether JSDoc is annotated with@wizactionannotation.booleanisWizcallback()Returns if JSDoc is annotated with@wizcallbackannotation.booleanisXidGenerator()Returns whether the@idGenerator {xid}is present on thisJSDocInfo.booleanmakesDicts()Returns whether the@dictannotation is present on thisJSDocInfo.booleanmakesStructs()Returns whether the@structannotation is present on thisJSDocInfo.booleanmakesUnrestricted()Returns whether the@unrestrictedannotation is present on thisJSDocInfo.booleanmodifiesThis()Get the value of the @modifies{this} annotation stored in the doc info.JSDocInfo.BuildertoBuilder()java.lang.StringtoString()java.lang.StringtoStringVerbose()booleanusesImplicitMatch()Returns whether the@recordannotation is present on thisJSDocInfo.
-
-
-
Method Detail
-
builder
public static JSDocInfo.Builder builder()
Create a new JSDocInfo.Builder object.
-
toBuilder
public JSDocInfo.Builder toBuilder()
-
clone
public JSDocInfo clone()
- Overrides:
clonein classjava.lang.Object
-
cloneAndReplaceTypeNames
public JSDocInfo cloneAndReplaceTypeNames(java.util.Set<java.lang.String> names)
Clones this JSDoc but replaces the given names in any type related annotation with unknown type.- Returns:
- returns the the cloned JSDocInfo
-
clone
public JSDocInfo clone(boolean cloneTypeNodes)
-
isAnyIdGenerator
public boolean isAnyIdGenerator()
Returns whether any@idGeneratororidGenerator {?}annotation is present.
-
isConsistentIdGenerator
public boolean isConsistentIdGenerator()
Returns whether the@idGenerator {consistent}is present on thisJSDocInfo.
-
isStableIdGenerator
public boolean isStableIdGenerator()
Returns whether the@idGenerator {stable}is present on thisJSDocInfo.
-
isXidGenerator
public boolean isXidGenerator()
Returns whether the@idGenerator {xid}is present on thisJSDocInfo.
-
isMappedIdGenerator
public boolean isMappedIdGenerator()
Returns whether the@idGenerator {mapped}is present on thisJSDocInfo.
-
isIdGenerator
public boolean isIdGenerator()
Returns whether the@idGeneratoris present on thisJSDocInfo.
-
isConstant
public boolean isConstant()
Returns whether thisJSDocInfoimplies that annotated value is constant.
-
hasConstAnnotation
public boolean hasConstAnnotation()
Returns whether the@constannotation is present on thisJSDocInfo.
-
isFinal
public boolean isFinal()
Returns whether the@finalannotation is present on thisJSDocInfo.
-
isConstructor
public boolean isConstructor()
Returns whether the@constructorannotation is present on thisJSDocInfo.
-
isAbstract
public boolean isAbstract()
Returns whether the@abstractannotation is present on thisJSDocInfo.
-
usesImplicitMatch
public boolean usesImplicitMatch()
Returns whether the@recordannotation is present on thisJSDocInfo.
-
makesUnrestricted
public boolean makesUnrestricted()
Returns whether the@unrestrictedannotation is present on thisJSDocInfo.
-
makesStructs
public boolean makesStructs()
Returns whether the@structannotation is present on thisJSDocInfo.
-
makesDicts
public boolean makesDicts()
Returns whether the@dictannotation is present on thisJSDocInfo.
-
isDefine
public boolean isDefine()
-
isHidden
public boolean isHidden()
Returns whether the@hiddenannotation is present on thisJSDocInfo.
-
isOverride
public boolean isOverride()
Returns whether the@overrideannotation is present on thisJSDocInfo.
-
isDeprecated
public boolean isDeprecated()
Returns whether the@deprecatedannotation is present on thisJSDocInfo.
-
isInterface
public boolean isInterface()
Returns whether the@interfaceannotation is present on thisJSDocInfo.
-
isConstructorOrInterface
public boolean isConstructorOrInterface()
-
isExport
public boolean isExport()
Returns whether the@exportannotation is present on thisJSDocInfo.
-
isImplicitCast
public boolean isImplicitCast()
Returns whether the@implicitCastannotation is present on thisJSDocInfo.
-
isNoSideEffects
public boolean isNoSideEffects()
Returns whether the@nosideeffectsannotation is present on thisJSDocInfo.
-
isExterns
public boolean isExterns()
Returns whether the@externsannotation is present on thisJSDocInfo.
-
isTypeSummary
public boolean isTypeSummary()
Returns whether the@typeSummaryannotation is present on thisJSDocInfo.
-
isNoCompile
public boolean isNoCompile()
Returns whether the@nocompileannotation is present on thisJSDocInfo.
-
isNoDts
public boolean isNoDts()
Returns whether the@nodtsannotation is present on thisJSDocInfo.
-
isNoCollapse
public boolean isNoCollapse()
Returns whether the@nocollapseannotation is present on thisJSDocInfo.
-
isNoInline
public boolean isNoInline()
Returns whether the@noinlineannotation is present on thisJSDocInfo.
-
isCollapsibleOrBreakMyCode
public boolean isCollapsibleOrBreakMyCode()
Returns whether the@collapsibleOrBreakMyCodeannotation is present on thisJSDocInfo.
-
isPureOrBreakMyCode
public boolean isPureOrBreakMyCode()
Returns whether the@pureOrBreakMyCodeannotation is present on thisJSDocInfo.
-
isProvideGoog
public boolean isProvideGoog()
Returns whether the@provideGoogannotation is present on thisJSDocInfo.
-
isProvideAlreadyProvided
public boolean isProvideAlreadyProvided()
Returns whether the@provideAlreadyProvidedannotation is present on thisJSDocInfo.
-
containsDeclarationExcludingTypelessConst
public boolean containsDeclarationExcludingTypelessConst()
Returns whether there is a declaration present on thisJSDocInfo.Does not consider `@const` (without a following type) to indicate a declaration. Whether you want this method, or the`containsDeclaration` that includes const, depends on whether you want to consider
/** @const * / a.b.c = 0a declaration or not.
-
containsTypeDeclaration
public boolean containsTypeDeclaration()
Returns whether this JSDoc contains a type declaration such as/** @type {string}
-
containsDeclaration
public boolean containsDeclaration()
Returns whether there is a declaration present on thisJSDocInfo, including a typeless @const like/** @const * / a.b.c = 0
-
containsFunctionDeclaration
@Deprecated public boolean containsFunctionDeclaration()
Deprecated.This method is quite heuristic, looking for @type annotations that start with "function". Other methods like containsDeclaration() and containsTypeDefinition are generally preferred.- Returns:
- Whether there is a declaration of a callable type.
-
containsTypeDefinition
public boolean containsTypeDefinition()
-
isAtSignCodePresent
public boolean isAtSignCodePresent()
Returns whether the@codeis present within thisJSDocInfo.
-
getVisibility
public JSDocInfo.Visibility getVisibility()
Gets the visibility specified by@private,@protectedor@publicannotation. If no visibility is specified, visibility is inherited from the base class.
-
getParameterType
public @Nullable JSTypeExpression getParameterType(java.lang.String parameter)
Gets the type of a given named parameter.- Parameters:
parameter- the parameter's name- Returns:
- the parameter's type or
nullif this parameter is not defined or has anulltype
-
hasParameter
public boolean hasParameter(java.lang.String parameter)
Returns whether the parameter is defined.
-
hasParameterType
public boolean hasParameterType(java.lang.String parameter)
Returns whether the parameter has an attached type.- Returns:
trueif the parameter has an attached type,falseif the parameter has no attached type or does not exist.
-
getParameterNames
public java.util.Set<java.lang.String> getParameterNames()
Returns the set of names of the defined parameters. The iteration order of the returned set is the order in which parameters are defined in the JSDoc, rather than the order in which the function declares them.- Returns:
- the set of names of the defined parameters. The returned set is immutable.
-
getParameterNameAt
public @Nullable java.lang.String getParameterNameAt(int index)
Returns the nth name in the defined parameters. The iteration order is the order in which parameters are defined in the JSDoc, rather than the order in which the function declares them.
-
getParameterCount
public int getParameterCount()
Gets the number of parameters defined.
-
getThrowsAnnotations
public java.util.List<java.lang.String> getThrowsAnnotations()
Returns the list of thrown types and descriptions as text.
-
hasEnumParameterType
public boolean hasEnumParameterType()
Returns whether an enum parameter type, specified using the@enumannotation, is present on this JSDoc.
-
hasTypedefType
public boolean hasTypedefType()
Returns whether a typedef parameter type, specified using the@typedefannotation, is present on this JSDoc.
-
hasReturnType
public boolean hasReturnType()
Returns whether thisJSDocInfocontains a type for@returnannotation.
-
hasType
public boolean hasType()
Returns whether a type, specified using the@typeannotation, is present on this JSDoc.
-
hasTypeInformation
public boolean hasTypeInformation()
-
isInlineType
public boolean isInlineType()
Returns whether the type annotation was inlined.
-
getReturnType
public JSTypeExpression getReturnType()
Gets the return type specified by the@returnannotation.
-
getEnumParameterType
public JSTypeExpression getEnumParameterType()
Gets the enum parameter type specified by the@enumannotation.
-
getTypedefType
public JSTypeExpression getTypedefType()
Gets the typedef type specified by the@typeannotation.
-
getType
public JSTypeExpression getType()
Gets the type specified by the@typeannotation.
-
getThisType
public JSTypeExpression getThisType()
Gets the type specified by the@thisannotation.
-
hasThisType
public boolean hasThisType()
Returns whether thisJSDocInfocontains a type for@thisannotation.
-
getBaseType
public JSTypeExpression getBaseType()
Gets the base type specified by the@extendsannotation.
-
getDescription
public java.lang.String getDescription()
Gets the description specified by the@descannotation.
-
getTsTypes
public com.google.common.collect.ImmutableList<java.lang.String> getTsTypes()
Gets the ts type declarations specified by the@tsTypeannotations.
-
getMeaning
public java.lang.String getMeaning()
Gets the meaning specified by the@meaningannotation.In localization systems, two messages with the same content but different "meanings" may be translated differently. By default, we use the name of the variable that the message is initialized to as the "meaning" of the message.
But some code generators (like Closure Templates) inject their own meaning with the jsdoc
@meaningannotation.
-
getAlternateMessageId
public java.lang.String getAlternateMessageId()
Gets the alternate message ID specified by the@alternateMessageIdannotation.In localization systems, if we migrate from one message ID algorithm to another, we can specify the old one via
@alternateMessageId. This allows the product to use the previous translation while waiting for the new one to be translated.Some code generators (like Closure Templates) inject this.
-
getLendsName
public JSTypeExpression getLendsName()
Gets the name we're lending to in a@lendsannotation.In many reflection APIs, you pass an anonymous object to a function, and that function mixes the anonymous object into another object. The
@lendsannotation allows the type system to track those property assignments.
-
hasLendsName
public boolean hasLendsName()
-
getClosurePrimitiveId
public java.lang.String getClosurePrimitiveId()
Returns the@closurePrimitive {id}identifier
-
hasClosurePrimitiveId
public boolean hasClosurePrimitiveId()
Whether this JSDoc is annotated with@closurePrimitive
-
isNgInject
public boolean isNgInject()
Returns whether JSDoc is annotated with@ngInjectannotation.
-
isWizaction
public boolean isWizaction()
Returns whether JSDoc is annotated with@wizactionannotation.
-
isWizcallback
public boolean isWizcallback()
Returns if JSDoc is annotated with@wizcallbackannotation.
-
isPolymerBehavior
public boolean isPolymerBehavior()
Returns whether JSDoc is annotated with@polymerBehaviorannotation.
-
isPolymer
public boolean isPolymer()
Returns whether JSDoc is annotated with@polymerannotation.
-
isCustomElement
public boolean isCustomElement()
Returns whether JSDoc is annotated with@customElementannotation.
-
isMixinClass
public boolean isMixinClass()
Returns whether JSDoc is annotated with@mixinClassannotation.
-
isMixinFunction
public boolean isMixinFunction()
Returns whether JSDoc is annotated with@mixinFunctionannotation.
-
getLicense
public java.lang.String getLicense()
Gets the description specified by the@licenseannotation.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toStringVerbose
public java.lang.String toStringVerbose()
-
hasBaseType
public boolean hasBaseType()
Returns whether thisJSDocInfocontains a type for@extendsannotation.
-
getImplementedInterfaces
public java.util.List<JSTypeExpression> getImplementedInterfaces()
Returns the types specified by the@implementsannotation.- Returns:
- An immutable list of JSTypeExpression objects that can be resolved to types.
-
getImplementedInterfaceCount
public int getImplementedInterfaceCount()
Gets the number of interfaces specified by the@implementsannotation.
-
getExtendedInterfaces
public java.util.List<JSTypeExpression> getExtendedInterfaces()
Returns the interfaces extended by an interface- Returns:
- An immutable list of JSTypeExpression objects that can be resolved to types.
-
getExtendedInterfacesCount
public int getExtendedInterfacesCount()
Gets the number of extended interfaces specified
-
getDeprecationReason
public java.lang.String getDeprecationReason()
Returns the deprecation reason or null if none specified.
-
getSuppressions
public java.util.Set<java.lang.String> getSuppressions()
Returns the set of suppressed warnings.
-
getSuppressionsAndTheirDescription
public com.google.common.collect.ImmutableMap<com.google.common.collect.ImmutableSet<java.lang.String>,java.lang.String> getSuppressionsAndTheirDescription()
Returns a map containing key=set of suppressions, and value=the corresponding description for the set.
-
getModifies
public java.util.Set<java.lang.String> getModifies()
Returns the set of sideeffect notations.
-
hasDescriptionForParameter
public boolean hasDescriptionForParameter(java.lang.String name)
Returns whether a description exists for the parameter with the specified name.
-
getDescriptionForParameter
public @Nullable java.lang.String getDescriptionForParameter(java.lang.String name)
Returns the description for the parameter with the given name, if its exists.
-
getAuthors
public java.util.List<java.lang.String> getAuthors()
Returns the list of authors or null if none.
-
getReferences
public java.util.List<java.lang.String> getReferences()
Returns the list of references or null if none.
-
getReturnDescription
public java.lang.String getReturnDescription()
Returns the description of the returned object or null if none specified.
-
getBlockDescription
public java.lang.String getBlockDescription()
Returns the block-level description or null if none specified.
-
hasFileOverview
public boolean hasFileOverview()
Returns whether this has a fileoverview flag.
-
getFileOverview
public java.lang.String getFileOverview()
Returns the file overview or null if none specified.
-
hasEnhance
public boolean hasEnhance()
Returns whether this has an enhanced namespace.
-
getEnhance
public java.lang.String getEnhance()
Returns the enhanced namespace or null if none is specified.
-
getMarkers
public java.util.Collection<JSDocInfo.Marker> getMarkers()
Gets the list of all markers for the documentation in this JSDoc.
-
getTemplateTypeNames
public com.google.common.collect.ImmutableList<java.lang.String> getTemplateTypeNames()
Gets the @template type names.Excludes @template types from TTL; get those with
getTypeTransformations()
-
getTemplateTypes
public com.google.common.collect.ImmutableMap<java.lang.String,JSTypeExpression> getTemplateTypes()
-
getTypeTransformations
public com.google.common.collect.ImmutableMap<java.lang.String,Node> getTypeTransformations()
Gets the type transformations.
-
getTypeExpressions
public java.util.Collection<JSTypeExpression> getTypeExpressions()
Returns a collection of all JSTypeExpressions that are a part of this JSDocInfo.This includes:
- base type
- @extends
- @implements
- @lend
- @param
- @return
- @template
- @this
- @throws
- @type
- Returns:
- collection of all type nodes
-
getTypeNodes
public java.util.Collection<Node> getTypeNodes()
Returns a collection of all type nodes that are a part of this JSDocInfo.This includes:
- @extends
- @implements
- @lend
- @param
- @return
- @template
- @this
- @throws
- @type
- Returns:
- collection of all type nodes
-
hasModifies
public boolean hasModifies()
-
getOriginalCommentString
public java.lang.String getOriginalCommentString()
Returns the original JSDoc comment string. Returns null unless parseJsDocDocumentation is enabled via the ParserConfig.
-
getOriginalCommentPosition
public int getOriginalCommentPosition()
-
modifiesThis
public boolean modifiesThis()
Get the value of the @modifies{this} annotation stored in the doc info.
-
hasSideEffectsArgumentsAnnotation
public boolean hasSideEffectsArgumentsAnnotation()
Returns whether the @modifies annotation includes "arguments" or any named parameters.
-
getPropertyValueByIndex
protected java.lang.Object getPropertyValueByIndex(int index)
-
-