Java Code Examples for com.google.javascript.rhino.JSDocInfo#getParameterNames()

The following examples show how to use com.google.javascript.rhino.JSDocInfo#getParameterNames() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DeclarationGenerator.java    From clutz with MIT License 5 votes vote down vote up
private void maybeEmitJsDoc(JSDocInfo docs, boolean ignoreParams) {
  if (docs == null) {
    return;
  }
  String desc = docs.getBlockDescription();
  if (desc == null) {
    return;
  }
  emit("/**");
  emitBreak();
  for (String line : Splitter.on('\n').split(desc)) {
    emit(" *");
    if (!line.isEmpty()) emit(line);
    emitBreak();
  }
  if (!ignoreParams) {
    for (String name : docs.getParameterNames()) {
      if (docs.getDescriptionForParameter(name) == null) continue;
      emit(" * @param");
      emit(name);
      emit(docs.getDescriptionForParameter(name));
      emitBreak();
    }
  }
  emit(" */");
  emitBreak();
}
 
Example 2
Source File: Closure_90_FunctionTypeBuilder_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Infer the parameter types from the doc info alone.
 */
FunctionTypeBuilder inferParameterTypes(JSDocInfo info) {
  // Create a fake args parent.
  Node lp = new Node(Token.LP);
  for (String name : info.getParameterNames()) {
    lp.addChildToBack(Node.newString(Token.NAME, name));
  }

  return inferParameterTypes(lp, info);
}
 
Example 3
Source File: Closure_90_FunctionTypeBuilder_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Infer the parameter types from the doc info alone.
 */
FunctionTypeBuilder inferParameterTypes(JSDocInfo info) {
  // Create a fake args parent.
  Node lp = new Node(Token.LP);
  for (String name : info.getParameterNames()) {
    lp.addChildToBack(Node.newString(Token.NAME, name));
  }

  return inferParameterTypes(lp, info);
}
 
Example 4
Source File: Closure_41_FunctionTypeBuilder_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Infer the parameter types from the doc info alone.
 */
FunctionTypeBuilder inferParameterTypes(JSDocInfo info) {
  // Create a fake args parent.
  Node lp = IR.paramList();
  for (String name : info.getParameterNames()) {
    lp.addChildToBack(IR.name(name));
  }

  return inferParameterTypes(lp, info);
}
 
Example 5
Source File: Closure_41_FunctionTypeBuilder_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Infer the parameter types from the doc info alone.
 */
FunctionTypeBuilder inferParameterTypes(JSDocInfo info) {
  // Create a fake args parent.
  Node lp = IR.paramList();
  for (String name : info.getParameterNames()) {
    lp.addChildToBack(IR.name(name));
  }

  return inferParameterTypes(lp, info);
}
 
Example 6
Source File: FunctionTypeBuilder.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Infer the parameter types from the doc info alone.
 */
FunctionTypeBuilder inferParameterTypes(JSDocInfo info) {
  // Create a fake args parent.
  Node lp = IR.paramList();
  for (String name : info.getParameterNames()) {
    lp.addChildToBack(IR.name(name));
  }

  return inferParameterTypes(lp, info);
}