congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
YAMLKeyValue.getName
Code IndexAdd Tabnine to your IDE (free)

How to use
getName
method
in
org.jetbrains.yaml.psi.YAMLKeyValue

Best Java code snippets using org.jetbrains.yaml.psi.YAMLKeyValue.getName (Showing top 5 results out of 315)

origin: zalando/intellij-swagger

private boolean hasRootKey(final String keyName, final PsiFile psiFile) {
 return getRootChildrenOfType(psiFile, YAMLKeyValue.class)
   .stream()
   .anyMatch(yamlKeyValue -> keyName.equals(yamlKeyValue.getName()));
}
origin: zalando/intellij-swagger

public Optional<? extends PsiElement> getRootChildByName(
  final String keyName, final PsiFile psiFile) {
 return getRootChildrenOfType(psiFile, YAMLKeyValue.class)
   .stream()
   .filter(yamlKeyValue -> keyName.equals(yamlKeyValue.getName()))
   .findFirst();
}
origin: zalando/intellij-swagger

@Override
public List<PsiElement> getTags(final PsiFile psiFile) {
 return getRootChildrenOfType(psiFile, YAMLKeyValue.class)
   .stream()
   .filter(yamlKeyValue -> "tags".equals(yamlKeyValue.getName()))
   .map(YAMLKeyValue::getValue)
   .map(YAMLPsiElement::getYAMLElements)
   .flatMap(Collection::stream)
   .filter(el -> el instanceof YAMLSequenceItem)
   .map(YAMLSequenceItem.class::cast)
   .map(YAMLSequenceItem::getYAMLElements)
   .flatMap(Collection::stream)
   .filter(el -> el instanceof YAMLMapping)
   .map(YAMLMapping.class::cast)
   .map(yamlMapping -> yamlMapping.getKeyValueByKey("name"))
   .map(YAMLKeyValue::getValue)
   .filter(Objects::nonNull)
   .collect(Collectors.toList());
}
origin: zalando/intellij-swagger

@Override
public List<String> getSecurityScopesIfOAuth2(final PsiElement securityDefinitionItem) {
 final List<YAMLKeyValue> properties = getChildProperties(securityDefinitionItem);
 final boolean isOAuth2 =
   properties
     .stream()
     .anyMatch(
       prop -> {
        final Optional<String> value =
          Optional.ofNullable(prop.getValue())
            .map(YAMLValue::getText)
            .map(StringUtils::removeAllQuotes);
        return "type".equals(prop.getName()) && Optional.of("oauth2").equals(value);
       });
 if (isOAuth2) {
  return properties
    .stream()
    .filter(prop -> "scopes".equals(prop.getName()))
    .map(this::getChildProperties)
    .flatMap(Collection::stream)
    .map(YAMLKeyValue::getName)
    .collect(Collectors.toList());
 }
 return ImmutableList.of();
}
origin: Haehnchen/idea-php-symfony2-plugin

/**
 * acme_demo.form.type.gender:
 *  class: espend\Form\TypeBundle\Form\FooType
 *  tags:
 *   - { name: form.type, alias: foo_type_alias  }
 *   - { name: foo  }
 */
@NotNull
public static Map<String, Set<String>> getTags(@NotNull YAMLFile yamlFile) {
  Map<String, Set<String>> map = new HashMap<>();
  for(YAMLKeyValue yamlServiceKeyValue : YamlHelper.getQualifiedKeyValuesInFile(yamlFile, "services")) {
    String serviceName = yamlServiceKeyValue.getName();
    Set<String> serviceTagMap = YamlHelper.collectServiceTags(yamlServiceKeyValue);
    if(serviceTagMap != null && serviceTagMap.size() > 0) {
      map.put(serviceName, serviceTagMap);
    }
  }
  return map;
}
org.jetbrains.yaml.psiYAMLKeyValuegetName

Popular methods of YAMLKeyValue

  • getKeyText
  • getKey
  • getValue
  • getValueText
  • getContainingFile
  • getFirstChild
  • getLastChild
  • getParent
  • getParentMapping
  • getProject
  • getText
  • getTextRange
  • getText,
  • getTextRange,
  • getYAMLElements

Popular in Java

  • Parsing JSON documents to java classes using gson
  • requestLocationUpdates (LocationManager)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • addToBackStack (FragmentTransaction)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now