int len = comment.getParameterCount(); if (len == 0)
int len = comment.getParameterCount(); if (len == 0)
int len = comment.getParameterCount(); if (len == 0)
private String toParameterString() { if (paramNode != null) { return FunctionUtils.toParameterString(getContext(), getContext().getComment(), paramNode, outputJS); } StringBuilder sb = new StringBuilder(); sb.append("("); int len = comment.getParameterCount(); for (int i = 0; i < len; i++) { String parameterName = comment.getParameterNameAt(i); JSTypeExpression parameterType = comment.getParameterType(parameterName); sb.append(FunctionUtils.toParameter(getContext(), comment, parameterName, parameterType, outputJS)); if (i < len - 1) sb.append(", "); } sb.append(")"); return sb.toString(); }
private String toParameterString() { if (paramNode != null) { return FunctionUtils.toParameterString(getContext(), getContext().getComment(), paramNode, outputJS); } StringBuilder sb = new StringBuilder(); sb.append("("); int len = comment.getParameterCount(); for (int i = 0; i < len; i++) { String parameterName = comment.getParameterNameAt(i); JSTypeExpression parameterType = comment.getParameterType(parameterName); sb.append(FunctionUtils.toParameter(getContext(), comment, parameterName, parameterType, outputJS)); if (i < len - 1) sb.append(", "); } sb.append(")"); return sb.toString(); }
private String toParameterString() { if (paramNode != null) { return FunctionUtils.toParameterString(getContext(), getContext().getComment(), paramNode, outputJS); } StringBuilder sb = new StringBuilder(); sb.append("("); int len = comment.getParameterCount(); for (int i = 0; i < len; i++) { String parameterName = comment.getParameterNameAt(i); JSTypeExpression parameterType = comment.getParameterType(parameterName); sb.append(FunctionUtils.toParameter(getContext(), comment, parameterName, parameterType, outputJS)); if (i < len - 1) sb.append(", "); } sb.append(")"); return sb.toString(); }
/** * Determines whether the given JsDoc info declares a function type. */ static boolean isFunctionTypeDeclaration(JSDocInfo info) { return info.getParameterCount() > 0 || info.hasReturnType() || info.hasThisType() || info.isConstructor() || info.isInterface(); }
final boolean isDocumented = comment.getParameterCount() > 0; List<String> parameterNames = null; else if(comment.getParameterCount() > 0 || comment.getReturnType() != null) for (int i = 0; i < comment.getParameterCount(); i++) System.out.println(getQualifiedName() + " parameters not found! " + " " + comment.getParameterCount());
private void addParameterReferences() { parameters = new ArrayList<ParameterReference>(); if (paramNode != null) { final boolean isDocumented = comment.getParameterCount() > 0; List<String> parameterNames = null; if (isDocumented) { parameterNames = Lists.newArrayList(comment.getParameterNames()); } for (Node param : paramNode.children()) { ParameterReference parameterReference; if ((parameterNames != null) && parameterNames.contains(param.getString())) { final String qualifiedName = FunctionUtils.toParameterType(this, param.getString()); parameterReference = new ParameterReference(getModel(), param, qualifiedName); } else { parameterReference = new ParameterReference(getModel(), param); } parameters.add(parameterReference); } } }
private void addParameterReferences() { parameters = new ArrayList<ParameterReference>(); if (paramNode != null) { final boolean isDocumented = comment.getParameterCount() > 0; List<String> parameterNames = null; if (isDocumented) { parameterNames = Lists.newArrayList(comment.getParameterNames()); } for (Node param : paramNode.children()) { ParameterReference parameterReference; if ((parameterNames != null) && parameterNames.contains(param.getString())) { final String qualifiedName = FunctionUtils.toParameterType(this, param.getString()); parameterReference = new ParameterReference(getModel(), param, qualifiedName); } else { parameterReference = new ParameterReference(getModel(), param); } parameters.add(parameterReference); } } }
/** * Determines whether the given JsDoc info declares a function type. */ static boolean isFunctionTypeDeclaration(JSDocInfo info) { return info.getParameterCount() > 0 || info.hasReturnType() || info.hasThisType() || info.isConstructor() || info.isInterface() || info.isAbstract(); }
private void addParameterReferences() { parameters = new ArrayList<ParameterReference>(); if (paramNode != null) { final boolean isDocumented = comment.getParameterCount() > 0; List<String> parameterNames = null; if (isDocumented) { parameterNames = Lists.newArrayList(comment.getParameterNames()); } for (Node param : paramNode.children()) { ParameterReference parameterReference; if ((parameterNames != null) && parameterNames.contains(param.getString())) { final String qualifiedName = FunctionUtils.toParameterType(this, param.getString()); parameterReference = new ParameterReference(getModel(), param, qualifiedName); } else { parameterReference = new ParameterReference(getModel(), param); } parameters.add(parameterReference); } } }
static boolean hasAnnotatedType(JSDocInfo jsdoc) { if (jsdoc == null) { return false; } return jsdoc.hasType() || jsdoc.hasReturnType() || jsdoc.getParameterCount() > 0 || jsdoc.isConstructorOrInterface() || jsdoc.hasTypedefType() || jsdoc.hasThisType() || jsdoc.hasEnumParameterType(); }
/** * @deprecated This method is quite heuristic, looking for @type annotations that start with * "function". Other methods like containsDeclaration() and containsTypeDefinition are generally * preferred. * @return Whether there is a declaration of a callable type. */ @Deprecated public boolean containsFunctionDeclaration() { boolean hasFunctionType = hasType() && getType().getRoot().isFunction(); return hasFunctionType || hasReturnType() || hasThisType() || getParameterCount() > 0 || getFlag(MASK_CONSTRUCTOR) || (getFlag(MASK_NOSIDEEFFECTS) && !hasType()); }
/** * @return Whether there is a declaration present on this {@link JSDocInfo}. */ public boolean containsDeclaration() { return (hasType() || hasReturnType() || hasEnumParameterType() || hasTypedefType() || hasThisType() || getParameterCount() > 0 || visibility != Visibility.INHERITED || getFlag(MASK_CONSTANT | MASK_CONSTRUCTOR | MASK_DEFINE | MASK_OVERRIDE | MASK_EXPORT | MASK_EXPOSE | MASK_DEPRECATED | MASK_INTERFACE | MASK_IMPLICITCAST | MASK_NOSIDEEFFECTS | MASK_RECORD)); }
/** * @return Whether there is a declaration present on this {@link JSDocInfo}. */ public boolean containsDeclaration() { return (hasType() || hasReturnType() || hasEnumParameterType() || hasTypedefType() || hasThisType() || getParameterCount() > 0 || visibility != Visibility.INHERITED || getFlag(MASK_CONSTANT | MASK_CONSTRUCTOR | MASK_DEFINE | MASK_OVERRIDE | MASK_NOALIAS | MASK_EXPORT | MASK_EXPOSE | MASK_DEPRECATED | MASK_INTERFACE | MASK_IMPLICITCAST | MASK_NOSIDEEFFECTS | MASK_RECORD)); }
/** * @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()); }
/** * Whether the current doc info has other type tags, like * {@code @param} or {@code @return} or {@code @type} or etc. */ private boolean hasAnyTypeRelatedTags() { return currentInfo.isConstructor() || currentInfo.isInterface() || currentInfo.getParameterCount() > 0 || currentInfo.hasReturnType() || currentInfo.hasBaseType() || currentInfo.getExtendedInterfacesCount() > 0 || currentInfo.getLendsName() != null || currentInfo.hasThisType() || hasAnySingletonTypeTags(); }
/** * Whether the current doc info has other type tags, like * {@code @param} or {@code @return} or {@code @type} or etc. */ private boolean hasAnyTypeRelatedTags() { return currentInfo.isConstructor() || currentInfo.isInterface() || currentInfo.isAbstract() || currentInfo.getParameterCount() > 0 || currentInfo.hasReturnType() || currentInfo.hasBaseType() || currentInfo.getExtendedInterfacesCount() > 0 || currentInfo.hasLendsName() || currentInfo.hasThisType() || hasAnySingletonTypeTags(); }
if (info != null) { boolean isUntypedOverride = info.isOverride() && info.getParameterCount() == 0 && info.getReturnType() == null; if (opts.partialInput && isUntypedOverride && propName.equals("then")) { horribleHackForPartialModeWithOverrides = true;