当前位置: 首页>>代码示例>>Java>>正文


Java Builder.setDesc方法代码示例

本文整理汇总了Java中com.google.javascript.jscomp.JsMessage.Builder.setDesc方法的典型用法代码示例。如果您正苦于以下问题:Java Builder.setDesc方法的具体用法?Java Builder.setDesc怎么用?Java Builder.setDesc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.javascript.jscomp.JsMessage.Builder的用法示例。


在下文中一共展示了Builder.setDesc方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: maybeInitMetaDataFromHelpVar

import com.google.javascript.jscomp.JsMessage.Builder; //导入方法依赖的package包/类
/**
 * Initializes the meta data in a JsMessage by examining a node just before or
 * after a message VAR node.
 *
 * @param builder the message builder whose meta data will be initialized
 * @param sibling a node adjacent to the message VAR node
 * @return true iff message has corresponding description variable
 */
private boolean maybeInitMetaDataFromHelpVar(Builder builder,
    @Nullable Node sibling) throws MalformedException {
  if ((sibling != null) && (sibling.getType() == Token.VAR)) {
    Node nameNode = sibling.getFirstChild();
    String name = nameNode.getString();
    if (name.equals(builder.getKey() + DESC_SUFFIX)) {
      Node valueNode = nameNode.getFirstChild();
      String desc = extractStringFromStringExprNode(valueNode);
      if (desc.startsWith(HIDDEN_DESC_PREFIX)) {
        builder.setDesc(desc.substring(HIDDEN_DESC_PREFIX.length()).trim());
        builder.setIsHidden(true);
      } else {
        builder.setDesc(desc);
      }
      return true;
    }
  }
  return false;
}
 
开发者ID:ehsan,项目名称:js-symbolic-executor,代码行数:28,代码来源:JsMessageVisitor.java

示例2: maybeInitMetaDataFromJsDoc

import com.google.javascript.jscomp.JsMessage.Builder; //导入方法依赖的package包/类
/**
 * Initializes the meta data in a message builder given a node that may
 * contain JsDoc properties.
 *
 * @param builder the message builder whose meta data will be initialized
 * @param node the node with the message's JSDoc properties
 * @return true if message has JsDoc with valid description in @desc
 *         annotation
 */
private boolean maybeInitMetaDataFromJsDoc(Builder builder, Node node) {
  boolean messageHasDesc = false;
  JSDocInfo info = node.getJSDocInfo();
  if (info != null) {
    String desc = info.getDescription();
    if (desc != null) {
      builder.setDesc(desc);
      messageHasDesc = true;
    }
    if (info.isHidden()) {
      builder.setIsHidden(true);
    }
  }

  return messageHasDesc;
}
 
开发者ID:ehsan,项目名称:js-symbolic-executor,代码行数:26,代码来源:JsMessageVisitor.java

示例3: maybeInitMetaDataFromHelpVar

import com.google.javascript.jscomp.JsMessage.Builder; //导入方法依赖的package包/类
/**
 * Initializes the meta data in a JsMessage by examining a node just before or
 * after a message VAR node.
 *
 * @param builder the message builder whose meta data will be initialized
 * @param sibling a node adjacent to the message VAR node
 * @return true iff message has corresponding description variable
 */
private boolean maybeInitMetaDataFromHelpVar(Builder builder,
    @Nullable Node sibling) throws MalformedException {
  if ((sibling != null) && (sibling.isVar())) {
    Node nameNode = sibling.getFirstChild();
    String name = nameNode.getString();
    if (name.equals(builder.getKey() + DESC_SUFFIX)) {
      Node valueNode = nameNode.getFirstChild();
      String desc = extractStringFromStringExprNode(valueNode);
      if (desc.startsWith(HIDDEN_DESC_PREFIX)) {
        builder.setDesc(desc.substring(HIDDEN_DESC_PREFIX.length()).trim());
        builder.setIsHidden(true);
      } else {
        builder.setDesc(desc);
      }
      return true;
    }
  }
  return false;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:28,代码来源:JsMessageVisitor.java

示例4: maybeInitMetaDataFromJsDoc

import com.google.javascript.jscomp.JsMessage.Builder; //导入方法依赖的package包/类
/**
 * Initializes the meta data in a message builder given a node that may
 * contain JsDoc properties.
 *
 * @param builder the message builder whose meta data will be initialized
 * @param node the node with the message's JSDoc properties
 * @return true if message has JsDoc with valid description in @desc
 *         annotation
 */
private boolean maybeInitMetaDataFromJsDoc(Builder builder, Node node) {
  boolean messageHasDesc = false;
  JSDocInfo info = node.getJSDocInfo();
  if (info != null) {
    String desc = info.getDescription();
    if (desc != null) {
      builder.setDesc(desc);
      messageHasDesc = true;
    }
    if (info.isHidden()) {
      builder.setIsHidden(true);
    }
    if (info.getMeaning() != null) {
      builder.setMeaning(info.getMeaning());
    }
  }

  return messageHasDesc;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:29,代码来源:JsMessageVisitor.java

示例5: maybeInitMetaDataFromHelpVar

import com.google.javascript.jscomp.JsMessage.Builder; //导入方法依赖的package包/类
/**
 * Initializes the meta data in a JsMessage by examining a node just before or
 * after a message VAR node.
 *
 * @param builder the message builder whose meta data will be initialized
 * @param sibling a node adjacent to the message VAR node
 * @return true iff message has corresponding description variable
 */
private static boolean maybeInitMetaDataFromHelpVar(Builder builder,
    @Nullable Node sibling) throws MalformedException {
  if ((sibling != null) && (sibling.isVar())) {
    Node nameNode = sibling.getFirstChild();
    String name = nameNode.getString();
    if (name.equals(builder.getKey() + DESC_SUFFIX)) {
      Node valueNode = nameNode.getFirstChild();
      String desc = extractStringFromStringExprNode(valueNode);
      if (desc.startsWith(HIDDEN_DESC_PREFIX)) {
        builder.setDesc(desc.substring(HIDDEN_DESC_PREFIX.length()).trim());
        builder.setIsHidden(true);
      } else {
        builder.setDesc(desc);
      }
      return true;
    }
  }
  return false;
}
 
开发者ID:google,项目名称:closure-compiler,代码行数:28,代码来源:JsMessageVisitor.java

示例6: maybeInitMetaDataFromJsDoc

import com.google.javascript.jscomp.JsMessage.Builder; //导入方法依赖的package包/类
/**
 * Initializes the meta data in a message builder given a node that may
 * contain JsDoc properties.
 *
 * @param builder the message builder whose meta data will be initialized
 * @param node the node with the message's JSDoc properties
 * @return true if message has JsDoc with valid description in @desc
 *         annotation
 */
private static boolean maybeInitMetaDataFromJsDoc(Builder builder, Node node) {
  boolean messageHasDesc = false;
  JSDocInfo info = node.getJSDocInfo();
  if (info != null) {
    String desc = info.getDescription();
    if (desc != null) {
      builder.setDesc(desc);
      messageHasDesc = true;
    }
    if (info.isHidden()) {
      builder.setIsHidden(true);
    }
    if (info.getMeaning() != null) {
      builder.setMeaning(info.getMeaning());
    }
  }

  return messageHasDesc;
}
 
开发者ID:google,项目名称:closure-compiler,代码行数:29,代码来源:JsMessageVisitor.java


注:本文中的com.google.javascript.jscomp.JsMessage.Builder.setDesc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。