Examples of YAMLDocument


Examples of org.jetbrains.yaml.psi.YAMLDocument

      public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) {
        final YAMLKeyValue keyValue = ObjectUtils.tryCast(element, YAMLKeyValue.class);
        if (keyValue == null) {
          return PsiReference.EMPTY_ARRAY;
        }
        final YAMLDocument yamlDocument = ObjectUtils.tryCast(keyValue.getParent(), YAMLDocument.class);
        if (yamlDocument == null) {
          return PsiReference.EMPTY_ARRAY;
        }
        final BasePathInfo basePathInfo = new BasePathInfo(yamlDocument);
        if (BasePathInfo.isBasePathKey(keyValue)) {
View Full Code Here

Examples of org.jetbrains.yaml.psi.YAMLDocument

        }

        // espend\Doctrine\ModelBundle\Entity\Bike:
        // ...
        // targetEntity: Foo
        YAMLDocument yamlDocument = PsiTreeUtil.getChildOfType(yamlFile, YAMLDocument.class);
        if(yamlDocument != null) {
            YAMLKeyValue entityKeyValue = PsiTreeUtil.getChildOfType(yamlDocument, YAMLKeyValue.class);
            if(entityKeyValue != null) {
                String entityName = entityKeyValue.getKeyText();
                if(entityName != null) {
View Full Code Here

Examples of org.jetbrains.yaml.psi.YAMLDocument

        return super.buildVisitor(holder, isOnTheFly);
    }

    protected void visitRoot(PsiFile psiFile, String rootName, @NotNull ProblemsHolder holder) {
        YAMLDocument document = PsiTreeUtil.findChildOfType(psiFile, YAMLDocument.class);
        if(document != null) {
            YAMLKeyValue yamlKeyValue = YamlHelper.getYamlKeyValue(document, rootName);
            if(yamlKeyValue != null) {
                YAMLCompoundValue yaml = PsiTreeUtil.findChildOfType(yamlKeyValue, YAMLCompoundValue.class);
                if(yaml != null) {
View Full Code Here

Examples of org.jetbrains.yaml.psi.YAMLDocument

                    if(!isValidForIndex(inputData, psiFile)) {
                        return map;
                    }

                    YAMLDocument yamlDocument = PsiTreeUtil.getChildOfType(psiFile, YAMLDocument.class);
                    if(yamlDocument == null) {
                        return map;
                    }

                    for(StubIndexedRoute indexedRoutes: RouteHelper.getYamlRouteDefinitions(yamlDocument)) {
View Full Code Here

Examples of org.jetbrains.yaml.psi.YAMLDocument

        // @TODO: detection of routing files in right way
        // routing.yml
        // comment.routing.yml
        // routing/foo.yml
        if(YamlHelper.isRoutingFile(psiFile)) {
            YAMLDocument document = PsiTreeUtil.findChildOfType(psiFile, YAMLDocument.class);
            if(document != null) {
                YamlHelper.attachDuplicateKeyInspection(document, holder);
            }
        }
View Full Code Here

Examples of org.jetbrains.yaml.psi.YAMLDocument

    }

    @Nullable
    public static YAMLKeyValue getRootKey(PsiFile psiFile, String keyName) {

        YAMLDocument yamlDocument = PsiTreeUtil.getChildOfType(psiFile, YAMLDocument.class);
        if(yamlDocument != null) {
            return YamlKeyFinder.find(yamlDocument, keyName);
        }

        return null;
View Full Code Here

Examples of org.jetbrains.yaml.psi.YAMLDocument

        public Map<String, String> getLocalParameterMap(PsiFile psiFile) {

            Map<String, String> map = new HashMap<String, String>();

            YAMLDocument yamlDocument = PsiTreeUtil.getChildOfType(psiFile, YAMLDocument.class);
            if(yamlDocument == null) {
                return map;
            }

            // get services or parameter key
View Full Code Here

Examples of org.jetbrains.yaml.psi.YAMLDocument

            if(!(psiFile.getFirstChild() instanceof YAMLDocument)) {
                return null;
            }

            YAMLDocument yamlDocument = (YAMLDocument) psiFile.getFirstChild();

            // get services or parameter key
            YAMLKeyValue[] yamlKeys = PsiTreeUtil.getChildrenOfType(yamlDocument, YAMLKeyValue.class);
            if(yamlKeys == null) {
                return null;
View Full Code Here

Examples of org.jetbrains.yaml.psi.YAMLDocument

        @NotNull
        public Map<String, ContainerService> getLocalServiceMap(PsiFile psiFile) {

            Map<String, ContainerService> services = new HashMap<String, ContainerService>();

            YAMLDocument yamlDocument = PsiTreeUtil.getChildOfType(psiFile, YAMLDocument.class);
            if(yamlDocument == null) {
                return services;
            }

            // get services or parameter key
View Full Code Here

Examples of org.yaml.snakeyaml.YamlDocument

*/
public class OmapTagTest extends AbstractTest {

    @SuppressWarnings("unchecked")
    public void testOmap() {
        YamlDocument document = new YamlDocument("types/omap.yaml");
        Map<String, Map<String, String>> map = (Map<String, Map<String, String>>) document
                .getNativeData();
        assertEquals(2, map.size());
        Map<String, String> map1 = (Map<String, String>) map.get("Bestiary");
        assertEquals(3, map1.size());
        assertEquals("African pig-like ant eater. Ugly.", map1.get("aardvark"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.