Examples of XmlAttribute


Examples of com.adobe.epubcheck.xml.XMLAttribute

    HashSet<String> scriptEvents = getScriptEvents();
    HashSet<String> mouseEvents = getMouseEvents();

    for (int i = 0; i < e.getAttributeCount(); ++i)
    {
      XMLAttribute attr = e.getAttribute(i);
      String name = attr.getName().toLowerCase();
      if (scriptEvents.contains(name) || mouseEvents.contains(name))
      {
        propertiesSet.add(ITEM_PROPERTIES.SCRIPTED);
        return;
      }
View Full Code Here

Examples of com.alexgilleran.icesoap.xml.XMLAttribute

    getXMLObject().setType(type);

    // Now get the attributes
    Collection<XMLAttribute> attributes = getXMLObject().getAttributes();
    assertEquals(1, attributes.size());
    XMLAttribute typeAtt = attributes.iterator().next();

    // Ensure the attribute is correct
    assertEquals(type, typeAtt.getValue());
    assertEquals(XMLNode.NS_URI_XSI, typeAtt.getNamespace());
    assertEquals(typeName, typeAtt.getName());

    // Test the type is toStringing properly
    String asString = getXMLObject().toString();
    assertTrue(asString, asString.contains(XMLNode.NS_PREFIX_XSI + ":" + typeName + "=\"" + type + "\""));

    // Set the type again
    getXMLObject().setType(anotherType);

    // Get the type attribute again
    attributes = getXMLObject().getAttributes();
    assertEquals(1, attributes.size());
    typeAtt = attributes.iterator().next();

    // Ensure the attribute is still correct and has the new value
    assertEquals(anotherType, typeAtt.getValue());
    assertEquals(XMLNode.NS_URI_XSI, typeAtt.getNamespace());
    assertEquals(typeName, typeAtt.getName());

    asString = getXMLObject().toString();
    assertTrue(asString.contains(XMLNode.NS_PREFIX_XSI + ":" + typeName + "=\"" + anotherType + "\""));
  }
View Full Code Here

Examples of com.google.gwt.uibinder.rebind.XMLAttribute

    // Now go through the element and dispatch its attributes, remembering
    // that constructor arguments get first dibs
    for (int i = elem.getAttributeCount() - 1; i >= 0; i--) {
      // Backward traversal b/c we're deleting attributes from the xml element

      XMLAttribute attribute = elem.getAttribute(i);

      // Ignore xmlns attributes
      if (attribute.getName().startsWith("xmlns:")) {
        continue;
      }

      String propertyName = attribute.getLocalName();
      if (setterValues.keySet().contains(propertyName)
          || requiredValues.containsKey(propertyName)) {
        writer.die(elem, "Duplicate attribute name: %s", propertyName);
      }

      if (unfilledRequiredParams.keySet().contains(propertyName)) {
        JType paramType = unfilledRequiredParams.get(propertyName);
        String value = elem.consumeAttributeWithDefault(attribute.getName(),
            null, paramType);
        if (value == null) {
          writer.die(elem, "Unable to parse %s as constructor argument "
              + "of type %s", attribute, paramType.getSimpleSourceName());
        }
        requiredValues.put(propertyName, value);
        unfilledRequiredParams.remove(propertyName);
      } else {
        JMethod setter = ownerFieldClass.getSetter(propertyName);
        if (setter == null) {
          writer.die(elem, "Class %s has no appropriate set%s() method",
              elem.getLocalName(), initialCap(propertyName));
        }
        String n = attribute.getName();
        String value = elem.consumeAttributeWithDefault(n, null,
            getParamTypes(setter));

        if (value == null) {
          writer.die(elem, "Unable to parse %s.", attribute);
View Full Code Here

Examples of com.google.gwt.uibinder.rebind.XMLAttribute

    // Now go through the element and dispatch its attributes, remembering
    // that constructor arguments get first dibs
    for (int i = elem.getAttributeCount() - 1; i >= 0; i--) {
      // Backward traversal b/c we're deleting attributes from the xml element

      XMLAttribute attribute = elem.getAttribute(i);

      // Ignore xmlns attributes
      if (attribute.getName().startsWith("xmlns:")) {
        continue;
      }

      String propertyName = attribute.getLocalName();
      if (setterValues.keySet().contains(propertyName)
          || requiredValues.containsKey(propertyName)) {
        writer.die("Duplicate attribute name: %s", propertyName);
      }

      if (unfilledRequiredParams.keySet().contains(propertyName)) {
        JType paramType = unfilledRequiredParams.get(propertyName);
        String value = elem.consumeAttributeWithDefault(attribute.getName(),
            null, paramType);
        if (value == null) {
          writer.die("In %s, unable to parse %s as constructor argument "
              + "of type %s", elem, attribute, paramType.getSimpleSourceName());
        }
        requiredValues.put(propertyName, value);
        unfilledRequiredParams.remove(propertyName);
      } else {
        JMethod setter = ownerFieldClass.getSetter(propertyName);
        if (setter == null) {
          writer.die("In %s, class %s has no appropriate set%s() method", elem,
              elem.getLocalName(), initialCap(propertyName));
        }

        String value = elem.consumeAttributeWithDefault(attribute.getName(),
            null,getParamTypes(setter));

        if (value == null) {
          writer.die("In %s, unable to parse %s.", elem, attribute);
        }
View Full Code Here

Examples of com.google.gwt.uibinder.rebind.XMLAttribute

  public String interpretElement(XMLElement elem)
      throws UnableToCompleteException {
    Map<String, String> attNameToToken = new HashMap<String, String>();

    for (int i = elem.getAttributeCount() - 1; i >= 0; i--) {
      XMLAttribute att = elem.getAttribute(i);
      AttributeParser parser = writer.getBundleAttributeParser(att);

      if (parser != null) {
        // Legacy res:style='style.pretty'
        String parsedValue = parser.parse(att.consumeRawValue(),
            writer.getLogger());
        String attToken = writer.tokenForExpression(parsedValue);

        // Use localName so <div res:style='...'> becomes <div style='...'>
        attNameToToken.put(att.getLocalName(), attToken);
        continue;
      }

      if (att.hasComputedValue()) {
        String attToken = writer.tokenForExpression(att.consumeStringValue());
        attNameToToken.put(att.getName(), attToken);
      } else {
        /*
         * No computed value, but make sure that any {{ madness gets escaped.
         * TODO(rjrjr) Move this to XMLElement RSN
         */
        String n = att.getName();
        String v = att.consumeRawValue().replace("{{", "{");
        elem.setAttribute(n, v);
      }
    }

    for (Map.Entry<String, String> attr : attNameToToken.entrySet()) {
View Full Code Here

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

Examples of com.intellij.psi.xml.XmlAttribute

    @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

Examples of com.intellij.psi.xml.XmlAttribute

      ((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

Examples of com.intellij.psi.xml.XmlAttribute

    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

Examples of com.sun.xml.internal.txw2.annotation.XmlAttribute

            } catch (InvocationTargetException e) {
                throw e.getTargetException();
            }
        }

        XmlAttribute xa = method.getAnnotation(XmlAttribute.class);
        XmlValue xv = method.getAnnotation(XmlValue.class);
        XmlElement xe = method.getAnnotation(XmlElement.class);


        if(xa!=null) {
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.