gpt4 book ai didi

org.jetbrains.yaml.psi.YAMLKeyValue.getValueText()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 01:41:31 32 4
gpt4 key购买 nike

本文整理了Java中org.jetbrains.yaml.psi.YAMLKeyValue.getValueText()方法的一些代码示例,展示了YAMLKeyValue.getValueText()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YAMLKeyValue.getValueText()方法的具体详情如下:
包路径:org.jetbrains.yaml.psi.YAMLKeyValue
类名称:YAMLKeyValue
方法名:getValueText

YAMLKeyValue.getValueText介绍

暂无

代码示例

代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin

@Nullable
public static String getYamlKeyValueAsString(@NotNull YAMLMapping yamlHash, @NotNull String keyName) {
  YAMLKeyValue yamlKeyValue = getYamlKeyValue(yamlHash, keyName, false);
  if(yamlKeyValue == null) {
    return null;
  }
  final String valueText = yamlKeyValue.getValueText();
  if(StringUtils.isBlank(valueText)) {
    return null;
  }
  return valueText;
}

代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin

@Nullable
public static String getYamlKeyValueAsString(@Nullable YAMLCompoundValue yamlCompoundValue, String keyName, boolean ignoreCase) {
  YAMLKeyValue yamlKeyValue1 = getYamlKeyValue(yamlCompoundValue, keyName, ignoreCase);
  if(yamlKeyValue1 == null) {
    return null;
  }
  String valueText = yamlKeyValue1.getValueText();
  if (StringUtils.isBlank(valueText)) {
    return null;
  }
  return valueText;
}

代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin

String valueText = ((YAMLKeyValue) element).getValueText();
if(StringUtils.isBlank(valueText)) {
  continue;

代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin

public static void attachYamlFieldTypeName(String keyName, DoctrineModelField doctrineModelField, YAMLKeyValue yamlKeyValue) {
  if("fields".equals(keyName) || "id".equals(keyName)) {
    YAMLKeyValue yamlType = YamlHelper.getYamlKeyValue(yamlKeyValue, "type");
    if(yamlType != null) {
      doctrineModelField.setTypeName(yamlType.getValueText());
    }
    YAMLKeyValue yamlColumn = YamlHelper.getYamlKeyValue(yamlKeyValue, "column");
    if(yamlColumn != null) {
      doctrineModelField.setColumn(yamlColumn.getValueText());
    }
    return;
  }
  if(RELATIONS.contains(keyName.toLowerCase())) {
    YAMLKeyValue targetEntity = YamlHelper.getYamlKeyValue(yamlKeyValue, "targetEntity");
    if(targetEntity != null) {
      doctrineModelField.setRelationType(keyName);
      doctrineModelField.setRelation(getOrmClass(yamlKeyValue.getContainingFile(), targetEntity.getValueText()));
    }
  }
}

代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin

/**
 * Find controller definition in yaml structure
 *
 * foo:
 *   defaults: { _controller: "Bundle:Foo:Bar" }
 *   defaults:
 *      _controller: "Bundle:Foo:Bar"
 *   controller: "Bundle:Foo:Bar"
 */
@Nullable
public static String getYamlController(@NotNull YAMLKeyValue psiElement) {
  YAMLKeyValue yamlKeyValue = YamlHelper.getYamlKeyValue(psiElement, "defaults");
  if(yamlKeyValue != null) {
    final YAMLValue container = yamlKeyValue.getValue();
    if(container instanceof YAMLMapping) {
      YAMLKeyValue yamlKeyValueController = YamlHelper.getYamlKeyValue(container, "_controller", true);
      if(yamlKeyValueController != null) {
        String valueText = yamlKeyValueController.getValueText();
        if(StringUtils.isNotBlank(valueText)) {
          return valueText;
        }
      }
    }
  }
  String controller = YamlHelper.getYamlKeyValueAsString(psiElement, "controller");
  if(controller != null && StringUtils.isNotBlank(controller)) {
    return controller;
  }
  return null;
}

代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin

/**
 * Symfony 3.3: "class" is optional; use service name for its it
 *
 * Foo\Bar:
 *  arguments: ~
 */
@Nullable
public static String getServiceClassFromServiceMapping(@NotNull YAMLMapping yamlMapping) {
  YAMLKeyValue classKeyValue = yamlMapping.getKeyValueByKey("class");
  // Symfony 3.3: "class" is optional; use service id for class
  // Foo\Bar:
  //   arguments: ~
  if(classKeyValue != null) {
    return classKeyValue.getValueText();
  }
  PsiElement parent = yamlMapping.getParent();
  if(parent instanceof YAMLKeyValue) {
    String keyText = ((YAMLKeyValue) parent).getKeyText();
    if(YamlHelper.isClassServiceId(keyText)) {
      return keyText;
    }
  }
  return null;
}

代码示例来源:origin: zalando/intellij-swagger

@Override
public void visitElement(final PsiElement element) {
 if (element instanceof YAMLKeyValue) {
  final YAMLKeyValue yamlKeyValue = (YAMLKeyValue) element;
  if (OpenApiConstants.REF_KEY.equals(yamlKeyValue.getKeyText())) {
   final String refValue = StringUtils.removeAllQuotes(yamlKeyValue.getValueText());
   if (isYamlFile(refValue)) {
    result.add(
      extractFileNameFromFileRefValue(refValue)
        + DELIMITER
        + getOpenApiFileTypeFromRefElement(yamlKeyValue.getValue(), refValue));
   }
  }
 }
 super.visitElement(element);
}

代码示例来源:origin: zalando/intellij-swagger

@Override
public void visitElement(final PsiElement element) {
 if (element instanceof YAMLKeyValue) {
  final YAMLKeyValue yamlKeyValue = (YAMLKeyValue) element;
  if (SwaggerConstants.REF_KEY.equals(yamlKeyValue.getKeyText())) {
   final String refValue = StringUtils.removeAllQuotes(yamlKeyValue.getValueText());
   if (isYamlFile(refValue)) {
    result.add(
      extractFileNameFromFileRefValue(refValue)
        + DELIMITER
        + getSwaggerFileType(yamlKeyValue.getValue(), refValue));
   }
  }
 }
 super.visitElement(element);
}

代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin

/**
 * foo:
 *   resources: 'FOO'
 */
private static void visitYamlFile(@NotNull YAMLFile yamlFile, @NotNull Consumer<FileResourceConsumer> consumer) {
  for (YAMLKeyValue yamlKeyValue : YamlHelper.getTopLevelKeyValues(yamlFile)) {
    YAMLKeyValue resourceKey = YamlHelper.getYamlKeyValue(yamlKeyValue, "resource", true);
    if(resourceKey == null) {
      continue;
    }
    String resource = PsiElementUtils.trimQuote(resourceKey.getValueText());
    if(StringUtils.isBlank(resource)) {
      continue;
    }
    consumer.consume(new FileResourceConsumer(resourceKey, yamlKeyValue, normalize(resource)));
  }
}

代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin

private static void addYamlClassMethods(@Nullable PsiElement psiElement, CompletionResultSet completionResultSet, String classTag) {
  if(psiElement == null) {
    return;
  }
  YAMLKeyValue classKeyValue = PsiElementUtils.getChildrenOfType(psiElement, PlatformPatterns.psiElement(YAMLKeyValue.class).withName(classTag));
  if(classKeyValue == null) {
    return;
  }
  PhpClass phpClass = ServiceUtil.getResolvedClassDefinition(psiElement.getProject(), classKeyValue.getValueText());
  if(phpClass != null) {
    PhpElementsUtil.addClassPublicMethodCompletion(completionResultSet, phpClass);
  }
}

代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin

YAMLKeyValue classKeyValue = parentMapping.getKeyValueByKey("class");
if (classKeyValue != null) {
  String valueText = classKeyValue.getValueText();
  if (StringUtils.isNotBlank(valueText)) {
    return valueText;

代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin

valueText = ((YAMLKeyValue) element).getValueText();
} else {

代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin

String routePath = path.getValueText();
if(StringUtils.isNotBlank(routePath)) {
  route.setPath(routePath);

代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin

String valueText = ((YAMLKeyValue) yamlKeyValue).getValueText();
if(StringUtils.isBlank(valueText)) {
  return;

代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin

if(classKeyValue != null) {
  String valueText = classKeyValue.getValueText();
  if(StringUtils.isNotBlank(valueText)) {
    consumer.consume(valueText);

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com