public class JSDocInfo
extends java.lang.Object
implements java.io.Serializable
JSDoc 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 JSDocInfo
objects is simplified by
JSDocInfoBuilder
which provides early incompatibility detection.
Modifier and Type | Class and Description |
---|---|
private static class |
JSDocInfo.LazilyInitializedDocumentation |
private static class |
JSDocInfo.LazilyInitializedInfo |
static class |
JSDocInfo.Marker
Defines a class for containing the parsing information
for this JSDocInfo.
|
static class |
JSDocInfo.NamePosition
A piece of information (found in a marker) which contains a position
with a name node.
|
(package private) class |
JSDocInfo.Property |
static class |
JSDocInfo.StringPosition
A piece of information (found in a marker) which contains a position
with a string.
|
(package private) static class |
JSDocInfo.TrimmedStringPosition
A piece of information (found in a marker) which contains a position
with a string that has no leading or trailing whitespace.
|
static class |
JSDocInfo.TypePosition
A piece of information (found in a marker) which contains a position
with a type expression syntax tree.
|
static class |
JSDocInfo.Visibility
Visibility categories.
|
Modifier and Type | Field and Description |
---|---|
private int |
bitset
The
isConstant() , isConstructor() , isInterface() ,
isHidden() and shouldPreserveTry() flags as well as
whether the type field stores a value for getType() ,
getReturnType() or getEnumParameterType() . |
private JSDocInfo.LazilyInitializedDocumentation |
documentation |
private boolean |
includeDocumentation
Whether to include documentation.
|
private JSDocInfo.LazilyInitializedInfo |
info |
private boolean |
inlineType
Whether the type annotation was inlined.
|
private static int |
MASK_CONSISTIDGEN |
private static int |
MASK_CONSTANT |
private static int |
MASK_CONSTRUCTOR |
private static int |
MASK_DEFINE |
private static int |
MASK_DEPRECATED |
private static int |
MASK_DICT |
private static int |
MASK_EXPORT |
private static int |
MASK_EXPOSE |
private static int |
MASK_EXTERNS |
private static int |
MASK_FILEOVERVIEW |
private static int |
MASK_FLAGS |
private static int |
MASK_HIDDEN |
private static int |
MASK_IDGEN |
private static int |
MASK_IMPLICITCAST |
private static int |
MASK_INTERFACE |
private static int |
MASK_MAPPEDIDGEN |
private static int |
MASK_NOALIAS |
private static int |
MASK_NOCOLLAPSE |
private static int |
MASK_NOCOMPILE |
private static int |
MASK_NOSIDEEFFECTS |
private static int |
MASK_OVERRIDE |
private static int |
MASK_PRESERVETRY |
private static int |
MASK_RECORD |
private static int |
MASK_STALBEIDGEN |
private static int |
MASK_STRUCT |
private static int |
MASK_TYPEFIELD |
private static int |
MASK_UNRESTRICTED |
private static int |
MASK_UNUSED_1 |
private static int |
MASK_UNUSED_2 |
private int |
originalCommentPosition
Position of the original comment.
|
private static long |
serialVersionUID |
private JSTypeExpression |
thisType
The type for
getThisType() . |
private JSTypeExpression |
type
|
private static int |
TYPEFIELD_ENUM |
private static int |
TYPEFIELD_RETURN |
private static int |
TYPEFIELD_TYPE |
private static int |
TYPEFIELD_TYPEDEF |
private JSDocInfo.Visibility |
visibility |
Constructor and Description |
---|
JSDocInfo() |
JSDocInfo(boolean includeDocumentation)
Creates a
JSDocInfo object. |
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
addExtendedInterface(JSTypeExpression type)
Adds an extended interface (for interface only).
|
(package private) boolean |
addImplementedInterface(JSTypeExpression interfaceName)
Adds an implemented interface.
|
(package private) JSDocInfo.Marker |
addMarker()
Adds a marker to the documentation (if it exists) and
returns the marker.
|
(package private) void |
addSuppression(java.lang.String suppression)
Add a suppressed warning.
|
static boolean |
areEquivalent(JSDocInfo jsDoc1,
JSDocInfo jsDoc2) |
JSDocInfo |
clone() |
boolean |
containsDeclaration() |
boolean |
containsFunctionDeclaration() |
(package private) boolean |
declareParam(JSTypeExpression jsType,
java.lang.String parameter)
Declares a parameter.
|
(package private) boolean |
declareTemplateTypeName(java.lang.String newTemplateTypeName)
Declares a template type name.
|
(package private) boolean |
declareThrows(JSTypeExpression jsType)
Declares that the method throws a given type.
|
(package private) boolean |
declareTypedefType(JSTypeExpression type) |
(package private) boolean |
declareTypeTransformation(java.lang.String newName,
Node expr)
Declares a type transformation expression.
|
boolean |
disposesOf(java.lang.String parameterName)
Return whether the function disposes of specified parameter.
|
(package private) boolean |
documentAuthor(java.lang.String author)
Documents the author (i.e.
|
(package private) boolean |
documentBlock(java.lang.String description)
Documents the block-level comment/description.
|
(package private) boolean |
documentFileOverview(java.lang.String description)
Documents the fileoverview comment/description.
|
(package private) boolean |
documentParam(java.lang.String parameter,
java.lang.String description)
Documents a parameter.
|
(package private) boolean |
documentReference(java.lang.String reference)
Documents a reference (i.e.
|
(package private) boolean |
documentReturn(java.lang.String description)
Documents the return value.
|
(package private) boolean |
documentThrows(JSTypeExpression type,
java.lang.String throwsDescription)
Documents the throws (i.e.
|
(package private) boolean |
documentVersion(java.lang.String version)
Documents the version.
|
java.util.Collection<java.lang.String> |
getAuthors()
Returns the list of authors or null if none.
|
JSTypeExpression |
getBaseType()
Gets the base type specified by the
@extends annotation. |
java.lang.String |
getBlockDescription()
Returns the block-level description or null if none specified.
|
java.lang.String |
getDeprecationReason()
Returns the deprecation reason or null if none specified.
|
java.lang.String |
getDescription()
Gets the description specified by the
@desc annotation. |
java.lang.String |
getDescriptionForParameter(java.lang.String name)
Returns the description for the parameter with the given name, if its
exists.
|
JSTypeExpression |
getEnumParameterType()
Gets the enum parameter type specified by the
@enum annotation. |
java.util.List<JSTypeExpression> |
getExtendedInterfaces()
Returns the interfaces extended by an interface
|
int |
getExtendedInterfacesCount()
Gets the number of extended interfaces specified
|
java.lang.String |
getFileOverview()
Returns the file overview or null if none specified.
|
private boolean |
getFlag(int mask) |
int |
getImplementedInterfaceCount()
Gets the number of interfaces specified by the
@implements
annotation. |
java.util.List<JSTypeExpression> |
getImplementedInterfaces()
Returns the types specified by the
@implements annotation. |
java.lang.String |
getLendsName()
Gets the name we're lending to in a
@lends annotation. |
java.lang.String |
getLicense()
Gets the description specified by the
@license annotation. |
java.util.Collection<JSDocInfo.Marker> |
getMarkers()
Gets the list of all markers for the documentation in this JSDoc.
|
java.lang.String |
getMeaning()
Gets the meaning specified by the
@meaning annotation. |
java.util.Set<java.lang.String> |
getModifies()
Returns the set of sideeffect notations.
|
int |
getOriginalCommentPosition() |
java.lang.String |
getOriginalCommentString()
Returns the original JSDoc comment string.
|
int |
getParameterCount()
Gets the number of parameters defined.
|
java.lang.String |
getParameterNameAt(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.
|
JSTypeExpression |
getParameterType(java.lang.String parameter)
Gets the type of a given named parameter.
|
private java.lang.Integer |
getPropertyBitField() |
java.util.Collection<java.lang.String> |
getReferences()
Returns the list of references or null if none.
|
java.lang.String |
getReturnDescription()
Returns the description of the returned object or null if none specified.
|
JSTypeExpression |
getReturnType()
Gets the return type specified by the
@return annotation. |
java.util.Set<java.lang.String> |
getSuppressions()
Returns the set of suppressed warnings.
|
com.google.common.collect.ImmutableList<java.lang.String> |
getTemplateTypeNames()
Gets the template type name.
|
JSTypeExpression |
getThisType()
Gets the type specified by the
@this annotation. |
java.util.List<JSTypeExpression> |
getThrownTypes()
Returns the list of thrown types.
|
java.lang.String |
getThrowsDescriptionForType(JSTypeExpression type)
Get the message for a given thrown type.
|
JSTypeExpression |
getType()
Gets the type specified by the
@type annotation. |
private JSTypeExpression |
getType(int typefield) |
JSTypeExpression |
getTypedefType()
Gets the typedef type specified by the
@type annotation. |
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.
|
java.lang.String |
getVersion()
Returns the version or null if none.
|
JSDocInfo.Visibility |
getVisibility()
Gets the visibility specified by
@private , @protected or
@public annotation. |
boolean |
hasBaseType()
Returns whether this
JSDocInfo contains a type for @extends
annotation. |
boolean |
hasConstAnnotation() |
boolean |
hasDescriptionForParameter(java.lang.String name)
Returns whether a description exists for the parameter with the specified
name.
|
boolean |
hasEnumParameterType()
Returns whether an enum parameter type, specified using the
@enum
annotation, is present on this JSDoc. |
boolean |
hasFileOverview()
Returns whether this has a fileoverview flag.
|
boolean |
hasModifies() |
boolean |
hasParameter(java.lang.String parameter)
Returns whether the parameter is defined.
|
boolean |
hasParameterType(java.lang.String parameter)
Returns whether the parameter has an attached type.
|
boolean |
hasReturnType()
Returns whether this
JSDocInfo contains a type for @return
annotation. |
boolean |
hasThisType()
Returns whether this
JSDocInfo contains a type for @this
annotation. |
boolean |
hasType()
Returns whether a type, specified using the
@type annotation, is
present on this JSDoc. |
private boolean |
hasType(int mask) |
boolean |
hasTypedefType()
Returns whether a typedef parameter type, specified using the
@typedef annotation, is present on this JSDoc. |
boolean |
hasTypeInformation() |
boolean |
isConsistentIdGenerator() |
boolean |
isConstant()
Returns whether the
@const annotation is present on this
JSDocInfo . |
boolean |
isConstructor()
Returns whether the
@constructor annotation is present on this
JSDocInfo . |
boolean |
isConstructorOrInterface() |
boolean |
isDefine()
Returns whether the
@define annotation is present on this
JSDocInfo . |
boolean |
isDeprecated()
Returns whether the
@deprecated annotation is present on this
JSDocInfo . |
boolean |
isDisposes()
Returns whether JSDoc is annotated with
@disposes annotation. |
(package private) boolean |
isDocumentationIncluded() |
boolean |
isExport()
Returns whether the
@export annotation is present on this
JSDocInfo . |
boolean |
isExpose()
Returns whether the
@expose annotation is present on this
JSDocInfo . |
boolean |
isExterns()
Returns whether the
@externs annotation is present on this
JSDocInfo . |
boolean |
isHidden()
Returns whether the
@hidden annotation is present on this
JSDocInfo . |
boolean |
isIdGenerator() |
boolean |
isImplicitCast()
Returns whether the
@implicitCast annotation is present on this
JSDocInfo . |
boolean |
isInlineType()
Returns whether the type annotation was inlined.
|
boolean |
isInterface()
Returns whether the
@interface annotation is present on this
JSDocInfo . |
boolean |
isJaggerInject()
Returns whether JSDoc is annotated with
@jaggerInject annotation. |
boolean |
isJaggerModule()
Returns whether JSDoc is annotated with
@jaggerModule annotation. |
boolean |
isJaggerProvide()
Returns whether JSDoc is annotated with
@jaggerProvidePromise annotation. |
boolean |
isJaggerProvidePromise()
Returns whether JSDoc is annotated with
@jaggerProvidePromise annotation. |
boolean |
isMappedIdGenerator() |
boolean |
isNgInject()
Returns whether JSDoc is annotated with
@ngInject annotation. |
boolean |
isNoAlias()
Returns whether the
@noalias annotation is present on this
JSDocInfo . |
boolean |
isNoCollapse()
Returns whether the
@nocompile annotation is present on this
JSDocInfo . |
boolean |
isNoCompile()
Returns whether the
@nocompile annotation is present on this
JSDocInfo . |
boolean |
isNoSideEffects()
Returns whether the
@nosideeffects annotation is present on this
JSDocInfo . |
boolean |
isOverride()
Returns whether the
@override annotation is present on this
JSDocInfo . |
boolean |
isPolymerBehavior()
Returns whether JSDoc is annotated with
@polymerBehavior annotation. |
boolean |
isStableIdGenerator() |
private boolean |
isTemplateTypeName(java.lang.String name) |
private boolean |
isTypeTransformationName(java.lang.String name) |
boolean |
isWizaction()
Returns whether JSDoc is annotated with
@wizaction annotation. |
private boolean |
lazyInitDocumentation()
Lazily initializes the documentation information object, but only
if the JSDocInfo was told to keep such information around.
|
private void |
lazyInitInfo() |
boolean |
makesDicts()
Returns whether the
@dict annotation is present on this
JSDocInfo . |
boolean |
makesStructs()
Returns whether the
@struct annotation is present on this
JSDocInfo . |
boolean |
makesUnrestricted()
Returns whether the
@unrestricted annotation is present on this
JSDocInfo . |
(package private) void |
mergePropertyBitfieldFrom(JSDocInfo other) |
(package private) void |
setBaseType(JSTypeExpression type) |
(package private) void |
setConsistentIdGenerator(boolean value) |
(package private) void |
setConstant(boolean value) |
(package private) void |
setConstructor(boolean value) |
(package private) void |
setDefine(boolean value) |
(package private) void |
setDeprecated(boolean value) |
(package private) boolean |
setDeprecationReason(java.lang.String reason)
Sets the deprecation reason.
|
(package private) void |
setDescription(java.lang.String desc) |
(package private) void |
setDict() |
(package private) boolean |
setDisposedParameter(java.lang.String parameterName) |
(package private) void |
setEnumParameterType(JSTypeExpression type) |
(package private) void |
setExport(boolean value) |
(package private) void |
setExpose(boolean value) |
(package private) void |
setExterns(boolean value) |
private void |
setFlag(boolean value,
int mask) |
(package private) void |
setHidden(boolean value) |
(package private) void |
setIdGenerator(boolean value) |
(package private) void |
setImplicitCast(boolean value) |
(package private) void |
setImplicitMatch(boolean value) |
(package private) void |
setInlineType() |
(package private) void |
setInterface(boolean value) |
(package private) void |
setJaggerInject(boolean jaggerInject) |
(package private) void |
setJaggerModule(boolean jaggerModule) |
(package private) void |
setJaggerProvide(boolean jaggerProvide) |
(package private) void |
setJaggerProvidePromise(boolean jaggerProvidePromise) |
(package private) void |
setLendsName(java.lang.String name) |
(package private) void |
setLicense(java.lang.String license) |
(package private) void |
setMappedIdGenerator(boolean value) |
(package private) void |
setMeaning(java.lang.String meaning) |
(package private) boolean |
setModifies(java.util.Set<java.lang.String> modifies)
Sets modifies values.
|
(package private) void |
setNgInject(boolean ngInject) |
(package private) void |
setNoAlias(boolean value) |
(package private) void |
setNoCollapse(boolean value) |
(package private) void |
setNoCompile(boolean value) |
(package private) void |
setNoSideEffects(boolean value) |
(package private) void |
setOriginalCommentPosition(int position) |
(package private) void |
setOriginalCommentString(java.lang.String sourceComment) |
(package private) void |
setOverride(boolean value) |
(package private) void |
setPolymerBehavior(boolean polymerBehavior) |
(package private) void |
setReturnType(JSTypeExpression type) |
(package private) void |
setShouldPreserveTry(boolean value) |
(package private) void |
setStableIdGenerator(boolean value) |
(package private) void |
setStruct() |
(package private) boolean |
setSuppressions(java.util.Set<java.lang.String> suppressions)
Sets suppressed warnings.
|
(package private) void |
setThisType(JSTypeExpression type)
Sets the type specified by the
@this annotation. |
(package private) void |
setType(JSTypeExpression type) |
private void |
setType(JSTypeExpression type,
int mask) |
(package private) void |
setUnrestricted() |
(package private) void |
setVisibility(JSDocInfo.Visibility visibility) |
(package private) void |
setWizaction(boolean wizaction) |
boolean |
shouldPreserveTry()
Returns whether the
@preserveTry annotation is present on this
JSDocInfo . |
java.lang.String |
toString() |
java.lang.String |
toStringVerbose() |
boolean |
usesImplicitMatch()
Returns whether the
@record annotation is present on this
JSDocInfo . |
private static final long serialVersionUID
private JSDocInfo.LazilyInitializedInfo info
private JSDocInfo.LazilyInitializedDocumentation documentation
private JSDocInfo.Visibility visibility
private int bitset
isConstant()
, isConstructor()
, isInterface()
,
isHidden()
and shouldPreserveTry()
flags as well as
whether the type
field stores a value for getType()
,
getReturnType()
or getEnumParameterType()
.private JSTypeExpression type
getType()
, getReturnType()
or
getEnumParameterType()
. The knowledge of which one is recorded is
stored in the bitset
field.setType(JSTypeExpression, int)
,
getType(int)
private JSTypeExpression thisType
getThisType()
.private boolean inlineType
private boolean includeDocumentation
JSDocInfo.LazilyInitializedDocumentation
private int originalCommentPosition
private static final int MASK_FLAGS
private static final int MASK_CONSTANT
private static final int MASK_CONSTRUCTOR
private static final int MASK_DEFINE
private static final int MASK_HIDDEN
private static final int MASK_PRESERVETRY
private static final int MASK_UNUSED_1
private static final int MASK_OVERRIDE
private static final int MASK_NOALIAS
private static final int MASK_DEPRECATED
private static final int MASK_INTERFACE
private static final int MASK_EXPORT
private static final int MASK_FILEOVERVIEW
private static final int MASK_IMPLICITCAST
private static final int MASK_NOSIDEEFFECTS
private static final int MASK_EXTERNS
private static final int MASK_UNUSED_2
private static final int MASK_NOCOMPILE
private static final int MASK_CONSISTIDGEN
private static final int MASK_IDGEN
private static final int MASK_EXPOSE
private static final int MASK_UNRESTRICTED
private static final int MASK_STRUCT
private static final int MASK_DICT
private static final int MASK_STALBEIDGEN
private static final int MASK_MAPPEDIDGEN
private static final int MASK_NOCOLLAPSE
private static final int MASK_RECORD
private static final int MASK_TYPEFIELD
private static final int TYPEFIELD_TYPE
private static final int TYPEFIELD_RETURN
private static final int TYPEFIELD_ENUM
private static final int TYPEFIELD_TYPEDEF
JSDocInfo(boolean includeDocumentation)
JSDocInfo
object. This object should be created using
a JSDocInfoBuilder
.JSDocInfo()
public JSDocInfo clone()
clone
in class java.lang.Object
boolean isDocumentationIncluded()
void setConsistentIdGenerator(boolean value)
void setStableIdGenerator(boolean value)
void setMappedIdGenerator(boolean value)
void setConstant(boolean value)
void setConstructor(boolean value)
void setUnrestricted()
void setStruct()
void setDict()
void setDefine(boolean value)
void setHidden(boolean value)
void setShouldPreserveTry(boolean value)
void setOverride(boolean value)
void setNoAlias(boolean value)
void setDeprecated(boolean value)
void setInterface(boolean value)
void setExport(boolean value)
void setExpose(boolean value)
void setIdGenerator(boolean value)
void setImplicitCast(boolean value)
void setNoSideEffects(boolean value)
void setExterns(boolean value)
void setNoCompile(boolean value)
void setNoCollapse(boolean value)
private void setFlag(boolean value, int mask)
void setImplicitMatch(boolean value)
public boolean isConsistentIdGenerator()
@consistentIdGenerator
is present on
this JSDocInfo
public boolean isStableIdGenerator()
@stableIdGenerator
is present on this JSDocInfo
.public boolean isMappedIdGenerator()
@stableIdGenerator
is present on this JSDocInfo
.public boolean isConstant()
@const
annotation is present on this
JSDocInfo
.public boolean hasConstAnnotation()
public boolean isConstructor()
@constructor
annotation is present on this
JSDocInfo
.public boolean usesImplicitMatch()
@record
annotation is present on this
JSDocInfo
.public boolean makesUnrestricted()
@unrestricted
annotation is present on this
JSDocInfo
.public boolean makesStructs()
@struct
annotation is present on this
JSDocInfo
.public boolean makesDicts()
@dict
annotation is present on this
JSDocInfo
.public boolean isDefine()
public boolean isHidden()
@hidden
annotation is present on this
JSDocInfo
.public boolean shouldPreserveTry()
@preserveTry
annotation is present on this
JSDocInfo
.public boolean isOverride()
@override
annotation is present on this
JSDocInfo
.public boolean isNoAlias()
@noalias
annotation is present on this
JSDocInfo
.public boolean isDeprecated()
@deprecated
annotation is present on this
JSDocInfo
.public boolean isInterface()
@interface
annotation is present on this
JSDocInfo
.public boolean isConstructorOrInterface()
public boolean isExport()
@export
annotation is present on this
JSDocInfo
.public boolean isExpose()
@expose
annotation is present on this
JSDocInfo
.public boolean isIdGenerator()
@idGenerator
is present on
this JSDocInfo
public boolean isImplicitCast()
@implicitCast
annotation is present on this
JSDocInfo
.public boolean isNoSideEffects()
@nosideeffects
annotation is present on this
JSDocInfo
.public boolean isExterns()
@externs
annotation is present on this
JSDocInfo
.public boolean isNoCompile()
@nocompile
annotation is present on this
JSDocInfo
.public boolean isNoCollapse()
@nocompile
annotation is present on this
JSDocInfo
.public boolean containsDeclaration()
JSDocInfo
.public boolean containsFunctionDeclaration()
private boolean getFlag(int mask)
void setVisibility(JSDocInfo.Visibility visibility)
private void lazyInitInfo()
private boolean lazyInitDocumentation()
JSDocInfo.Marker addMarker()
boolean setDeprecationReason(java.lang.String reason)
reason
- The deprecation reasonvoid addSuppression(java.lang.String suppression)
boolean setSuppressions(java.util.Set<java.lang.String> suppressions)
suppressions
- A list of suppressed warning types.boolean setModifies(java.util.Set<java.lang.String> modifies)
modifies
- A list of modifies types.boolean documentVersion(java.lang.String version)
boolean documentReference(java.lang.String reference)
boolean documentAuthor(java.lang.String author)
boolean documentThrows(JSTypeExpression type, java.lang.String throwsDescription)
boolean documentParam(java.lang.String parameter, java.lang.String description)
@param
annotation.parameter
- the parameter's namedescription
- the parameter's descriptionboolean documentBlock(java.lang.String description)
description
- the descriptionboolean documentFileOverview(java.lang.String description)
description
- the descriptionboolean documentReturn(java.lang.String description)
@return
annotation.description
- the return value's descriptionboolean declareParam(JSTypeExpression jsType, java.lang.String parameter)
@param
annotation.jsType
- the parameter's type, it may be null
when the
@param
annotation did not specify a type.parameter
- the parameter's nameboolean declareTemplateTypeName(java.lang.String newTemplateTypeName)
@template
annotation.newTemplateTypeName
- the template type name.private boolean isTemplateTypeName(java.lang.String name)
private boolean isTypeTransformationName(java.lang.String name)
boolean declareTypeTransformation(java.lang.String newName, Node expr)
@template
annotation of the form
@template T := TTL-Expr =:
newName
- The name associated to the type transformation.expr
- The type transformation expression.boolean declareThrows(JSTypeExpression jsType)
jsType
- The type that can be thrown by the method.public JSDocInfo.Visibility getVisibility()
@private
, @protected
or
@public
annotation. If no visibility is specified, visibility
is inherited from the base class.public JSTypeExpression getParameterType(java.lang.String parameter)
parameter
- the parameter's namenull
if this parameter is not
defined or has a null
typepublic boolean hasParameter(java.lang.String parameter)
public boolean hasParameterType(java.lang.String parameter)
true
if the parameter has an attached type, false
if the parameter has no attached type or does not exist.public java.util.Set<java.lang.String> getParameterNames()
public java.lang.String getParameterNameAt(int index)
public int getParameterCount()
void setType(JSTypeExpression type)
void setInlineType()
void setReturnType(JSTypeExpression type)
void setEnumParameterType(JSTypeExpression type)
boolean declareTypedefType(JSTypeExpression type)
private void setType(JSTypeExpression type, int mask)
public java.util.List<JSTypeExpression> getThrownTypes()
public java.lang.String getThrowsDescriptionForType(JSTypeExpression type)
public boolean hasType()
@type
annotation, is
present on this JSDoc.public boolean hasEnumParameterType()
@enum
annotation, is present on this JSDoc.public boolean hasTypedefType()
@typedef
annotation, is present on this JSDoc.public boolean hasReturnType()
JSDocInfo
contains a type for @return
annotation.private boolean hasType(int mask)
public boolean hasTypeInformation()
public JSTypeExpression getType()
@type
annotation.public boolean isInlineType()
public JSTypeExpression getReturnType()
@return
annotation.public JSTypeExpression getEnumParameterType()
@enum
annotation.public JSTypeExpression getTypedefType()
@type
annotation.private JSTypeExpression getType(int typefield)
public JSTypeExpression getThisType()
@this
annotation.void setThisType(JSTypeExpression type)
@this
annotation.public boolean hasThisType()
JSDocInfo
contains a type for @this
annotation.void setBaseType(JSTypeExpression type)
public JSTypeExpression getBaseType()
@extends
annotation.public java.lang.String getDescription()
@desc
annotation.void setDescription(java.lang.String desc)
public java.lang.String getMeaning()
@meaning
annotation.
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 @meaning
annotation.
void setMeaning(java.lang.String meaning)
public java.lang.String getLendsName()
@lends
annotation.
In many reflection APIs, you pass an anonymous object to a function,
and that function mixes the anonymous object into another object.
The @lends
annotation allows the type system to track
those property assignments.
void setLendsName(java.lang.String name)
public boolean isNgInject()
@ngInject
annotation.void setNgInject(boolean ngInject)
public boolean isJaggerInject()
@jaggerInject
annotation.void setJaggerInject(boolean jaggerInject)
public boolean isJaggerProvide()
@jaggerProvidePromise
annotation.void setJaggerProvide(boolean jaggerProvide)
public boolean isJaggerProvidePromise()
@jaggerProvidePromise
annotation.void setJaggerProvidePromise(boolean jaggerProvidePromise)
public boolean isJaggerModule()
@jaggerModule
annotation.void setJaggerModule(boolean jaggerModule)
public boolean isWizaction()
@wizaction
annotation.void setWizaction(boolean wizaction)
public boolean isPolymerBehavior()
@polymerBehavior
annotation.void setPolymerBehavior(boolean polymerBehavior)
public boolean isDisposes()
@disposes
annotation.boolean setDisposedParameter(java.lang.String parameterName)
public boolean disposesOf(java.lang.String parameterName)
public java.lang.String getLicense()
@license
annotation.void setLicense(java.lang.String license)
license
- String containing new license text.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringVerbose()
public boolean hasBaseType()
JSDocInfo
contains a type for @extends
annotation.boolean addImplementedInterface(JSTypeExpression interfaceName)
public java.util.List<JSTypeExpression> getImplementedInterfaces()
@implements
annotation.public int getImplementedInterfaceCount()
@implements
annotation.boolean addExtendedInterface(JSTypeExpression type)
public java.util.List<JSTypeExpression> getExtendedInterfaces()
public int getExtendedInterfacesCount()
public java.lang.String getDeprecationReason()
public java.util.Set<java.lang.String> getSuppressions()
public java.util.Set<java.lang.String> getModifies()
private java.lang.Integer getPropertyBitField()
void mergePropertyBitfieldFrom(JSDocInfo other)
public boolean hasDescriptionForParameter(java.lang.String name)
public java.lang.String getDescriptionForParameter(java.lang.String name)
public java.util.Collection<java.lang.String> getAuthors()
public java.util.Collection<java.lang.String> getReferences()
public java.lang.String getVersion()
public java.lang.String getReturnDescription()
public java.lang.String getBlockDescription()
public boolean hasFileOverview()
public java.lang.String getFileOverview()
public java.util.Collection<JSDocInfo.Marker> getMarkers()
public com.google.common.collect.ImmutableList<java.lang.String> getTemplateTypeNames()
public com.google.common.collect.ImmutableMap<java.lang.String,Node> getTypeTransformations()
public java.util.Collection<Node> getTypeNodes()
public boolean hasModifies()
public java.lang.String getOriginalCommentString()
void setOriginalCommentString(java.lang.String sourceComment)
public int getOriginalCommentPosition()
void setOriginalCommentPosition(int position)