Package com.intellij.psi.xml

Examples of com.intellij.psi.xml.XmlAttribute


    file.accept(visitor);

    if (ContainerUtil.exists(visitor.getResult(), new Condition<XmlTag>() {
      @Override
      public boolean value(XmlTag tag) {
        final XmlAttribute ifAttribute = tag.getAttribute("if");
        return "debug".equals(ifAttribute != null ? ifAttribute.getValue() : null);
      }
    })) {
      // all good
      return ProblemDescriptor.EMPTY_ARRAY;
    }
View Full Code Here


    @Override
    public void visitXmlTag(XmlTag tag) {
      super.visitXmlTag(tag);
      if ("set".equals(tag.getName())) {
        final XmlAttribute name = tag.getAttribute("name");
        if ("BUILD_DIR".equals(name != null ? name.getValue() : null)) {
          myResult.add(tag);
        }
      }
    }
View Full Code Here

      ((XmlTag)debugTag).setAttribute("if", "debug");
    }

    private void appendValue(XmlTag element, String release) {
      XmlAttribute outAttribute = ((XmlTag)element).getAttribute("value");
      if (outAttribute != null) {
        outAttribute.setValue(outAttribute.getValue() + "/" + release);
      }
    }
View Full Code Here

    if (startNode == -1)
    {
      if (startAtt == 0)
      {
        mappingExp = mappingExp.substring(1);
        XmlAttribute attribute = xmlTag.getAttribute(mappingExp);
        if (attribute == null)
        {
          return "";
        }

        return attribute.getValue();
      }

      if (startAtt > 0)
      {
        throw new XMappingException("Bad expression, attribute should be declared as @att : "
View Full Code Here

        }
        XmlAttributeValue attributeValue = (XmlAttributeValue) position.getParent();
        if (!(attributeValue.getParent() instanceof XmlAttribute)) {
            return null;
        }
        XmlAttribute attribute = (XmlAttribute) attributeValue.getParent();
        return Constants.WICKET_ID.equals(attribute.getName()) ? attributeValue : null;
    }
View Full Code Here

        }
        XmlAttributeValue attributeValue = (XmlAttributeValue) position.getParent();
        if (!(attributeValue.getParent() instanceof XmlAttribute)) {
            return false;
        }
        XmlAttribute attribute = (XmlAttribute) attributeValue.getParent();
        String name = attribute.getName();
        return "key".equalsIgnoreCase(name);
    }
View Full Code Here

    if (!(parent instanceof XmlTag)) {
      return PsiReference.EMPTY_ARRAY;
    }

    final XmlTag tag = (XmlTag) parent;
    final XmlAttribute action = tag.getAttribute("action");
    if (action == null) {
      return PsiReference.EMPTY_ARRAY;
    }

    final XmlAttributeValue valueElement = action.getValueElement();
    if (valueElement == null) {
      return PsiReference.EMPTY_ARRAY;
    }

    for (final PsiReference psiReference : valueElement.getReferences()) {
View Full Code Here

    if (psiFile instanceof XmlFile) {
      psiFile.accept(new XmlRecursiveElementVisitor() {
        @Override
        public void visitXmlTag(XmlTag tag) {
          if (HtmlUtil.isScriptTag(tag) && "text/ng-template".equals(tag.getAttributeValue("type"))) {
            final XmlAttribute id = tag.getAttribute("id");
            if (id != null) {
              processor.process(id);
              return;
            }
          }
View Full Code Here

        if(name.equals("service")) {

            // service/argument[id]

            XmlAttribute classAttribute = parentXmlTag.getAttribute("class");
            if(classAttribute != null) {

                String serviceDefName = classAttribute.getValue();
                PhpClass phpClass = ServiceUtil.getResolvedClassDefinition(psiElement.getProject(), serviceDefName);

                // check type hint on constructor
                if(phpClass != null) {
                    Method constructor = phpClass.getConstructor();
                    if(constructor != null) {
                        String serviceName = ((XmlAttributeValue) psiElement).getValue();
                        attachMethodInstances(psiElement, serviceName, constructor, getArgumentIndex(currentXmlTag), holder);
                    }
                }

            }
        } else if (name.equals("call")) {

            // service/call/argument[id]

            XmlAttribute methodAttribute = parentXmlTag.getAttribute("method");
            if(methodAttribute != null) {
                String methodName = methodAttribute.getValue();
                XmlTag serviceTag = parentXmlTag.getParentTag();

                // get service class
                if(serviceTag != null && "service".equals(serviceTag.getName())) {
                    XmlAttribute classAttribute = serviceTag.getAttribute("class");
                    if(classAttribute != null) {

                        String serviceDefName = classAttribute.getValue();
                        PhpClass phpClass = ServiceUtil.getResolvedClassDefinition(psiElement.getProject(), serviceDefName);

                        // finally check method type hint
                        if(phpClass != null) {
                            Method method = PhpElementsUtil.getClassMethod(phpClass, methodName);
View Full Code Here

            if(xmlTag.getName().equals("container")) {
                for(XmlTag servicesTag: xmlTag.getSubTags()) {
                    if(servicesTag.getName().equals(root)) {
                        for(XmlTag parameterTag: servicesTag.getSubTags()) {
                            if(parameterTag.getName().equals(child)) {
                                XmlAttribute keyAttr = parameterTag.getAttribute(tagName);
                                if(keyAttr != null) {
                                    String parameterName = keyAttr.getValue();
                                    if(parameterName != null && StringUtils.isNotBlank(parameterName)) {
                                        if(psiElementMap.containsKey(parameterName)) {
                                            yamlKeyValues.add(psiElementMap.get(parameterName));
                                            yamlKeyValues.add(keyAttr);
                                        } else {
View Full Code Here

TOP

Related Classes of com.intellij.psi.xml.XmlAttribute

Copyright © 2018 www.massapicom. 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.