/** * Gets the return type specified by the {@code @return} annotation. */ public JSTypeExpression getReturnType() { return getType(TYPEFIELD_RETURN); }
/** * Gets the enum parameter type specified by the {@code @enum} annotation. */ public JSTypeExpression getEnumParameterType() { return getType(TYPEFIELD_ENUM); }
/** * Gets the typedef type specified by the {@code @type} annotation. */ public JSTypeExpression getTypedefType() { return getType(TYPEFIELD_TYPEDEF); }
/** * Gets the type specified by the {@code @type} annotation. */ public JSTypeExpression getType() { return getType(TYPEFIELD_TYPE); }
/** * Gets the enum parameter type specified by the {@code @enum} annotation. */ public JSTypeExpression getEnumParameterType() { return getType(TYPEFIELD_ENUM); }
/** * Gets the type specified by the {@code @type} annotation. */ public JSTypeExpression getType() { return getType(TYPEFIELD_TYPE); }
/** * Gets the return type specified by the {@code @return} annotation. */ public JSTypeExpression getReturnType() { return getType(TYPEFIELD_RETURN); }
/** * Gets the typedef type specified by the {@code @type} annotation. */ public JSTypeExpression getTypedefType() { return getType(TYPEFIELD_TYPEDEF); }
private JSType getDeclaredTypeOfNode(JSDocInfo jsdoc, DeclaredTypeRegistry registry, ImmutableList<String> typeParameters) { if (jsdoc == null) { return null; } return getTypeFromJSTypeExpression( jsdoc.getType(), registry, typeParameters); }
static JSDocInfo mergeJsdocs(@Nullable JSDocInfo classicJsdoc, @Nullable JSDocInfo inlineJsdoc) { if (inlineJsdoc == null || !inlineJsdoc.hasType()) { return classicJsdoc; } JSDocInfoBuilder builder = JSDocInfoBuilder.maybeCopyFrom(classicJsdoc); builder.recordType(inlineJsdoc.getType()); return builder.build(); }
public static String toFieldTypeString(BaseReference reference) { JSTypeExpression expression = reference.getComment().getType(); if (expression == null) return "Object"; String type = toTypeExpressionString(reference, expression); type = transformType(type); return type; }
public static String toConstantTypeString(ConstantReference reference) { JSTypeExpression expression = reference.getComment().getType(); if (expression == null) return "Object"; String type = toTypeExpressionString(reference, expression); type = transformType(type); return type; }
public static String toFieldTypeString(BaseReference reference) { JSTypeExpression expression = reference.getComment().getType(); if (expression == null) return "Object"; String type = toTypeExpressionString(reference, expression); type = transformType(type); return type; }
public static String toConstantTypeString(ConstantReference reference) { JSTypeExpression expression = reference.getComment().getType(); if (expression == null) return "Object"; String type = toTypeExpressionString(reference, expression); type = transformType(type); return type; }
public static String toFieldTypeString(BaseReference reference) { JSTypeExpression expression = reference.getComment().getType(); if (expression == null) return "Object"; String type = toTypeExpressionString(reference, expression); type = transformType(type); return type; }
public static String toConstantTypeString(ConstantReference reference) { JSTypeExpression expression = reference.getComment().getType(); if (expression == null) return "Object"; String type = toTypeExpressionString(reference, expression); type = transformType(type); return type; }
/** * @return Whether there is a declaration of a callable type. */ public boolean containsFunctionDeclaration() { boolean hasFunctionType = hasType() && getType().getRoot().isFunction(); return hasFunctionType || hasReturnType() || hasThisType() || getParameterCount() > 0 || getFlag(MASK_CONSTRUCTOR) || (getFlag(MASK_NOSIDEEFFECTS) && !hasType()); }