Package org.jdom

Examples of org.jdom.Attribute


    // For now, everything's specified as an attribute so this should
    // take care of everything.
    java.util.List attrs = configElement.getAttributes();
    for (int i=0; i<attrs.size(); i++) {
      Attribute attr = (Attribute)attrs.get(i);
      String key = attr.getName();
      String value = attr.getValue();
      logger.debug("Adding " + key + " - " + value);
      addProperty(key, value);
    }

    // Should be none, for now as everything is specified as attributes.
View Full Code Here


    else if (fieldType.equals("Attribute")) {
      StringBuffer sBuf = new StringBuffer();
      sBuf.append(fieldName.substring(0,1).toLowerCase());
      sBuf.append(fieldName.substring(1));
      String attrName = new String(sBuf);
      Attribute anAttr = eInput.getAttribute(attrName);
      if (anAttr == null) {
        if (isRequired && xeo.getEnterpriseFields().ignoreValidation() == false) {
          throw new EnterpriseLayoutException(fieldName +
             " is a required field but could not be found in the " +
            objectName + " Element passed in.");
        }
      }
      else {
        fieldValue = anAttr.getValue();
        if (fieldValue == null || fieldValue.trim().length() == 0) {
          if (isRequired && xeo.getEnterpriseFields().ignoreValidation() == false) {
            throw new EnterpriseLayoutException(fieldName +
                                                " is a required field but could not be found in the " +
                                                objectName + " Element passed in.");
View Full Code Here

  private boolean elementIsEmpty(Element e) {
    boolean retVal = true;

    java.util.List attrs = e.getAttributes();
    for (int i=0; i<attrs.size(); i++) {
      Attribute a = (Attribute)attrs.get(i);
      if (a.getValue().length() > 0) {
        logger.debug(e.getName() + " has attributes with values, must instantiate.");
        return false;
      }
    }
View Full Code Here

    public void writeSchema(Element root)
    {
        Namespace xsd = Namespace.getNamespace(SoapConstants.XSD_PREFIX, SoapConstants.XSD);
       
        Element simple = new Element("simpleType",xsd );
        simple.setAttribute(new Attribute("name", getSchemaType().getLocalPart()));
        root.addContent(simple);
       
        Element restriction = new Element("restriction", xsd);
        restriction.setAttribute(new Attribute("base", SoapConstants.XSD_PREFIX + ":string"));
        simple.addContent(restriction);
       
        Object[] constants = getTypeClass().getEnumConstants();

        for (Object constant : constants)
        {
            Element enumeration = new Element("enumeration", xsd);
            enumeration.setAttribute(new Attribute("value", ((Enum) constant).toString()));
            restriction.addContent(enumeration);
        }
    }
View Full Code Here

    String start = configElement.getAttribute("startOnInitialization").getValue();

    // Add all attributes as 'Properties'
    java.util.List attrs = configElement.getAttributes();
    for (int i=0; i<attrs.size(); i++) {
      Attribute attr = (Attribute)attrs.get(i);
      String key = attr.getName();
      String value = attr.getValue();
      logger.debug("ProducerConfig, Adding " + key + " - " + value);
      addProperty(key, value);
    }

    // Add all elements as 'Properties'
View Full Code Here

    // For now, everything's specified as an attribute so this should
    // take care of everything.
    java.util.List attrs = configElement.getAttributes();
    for (int i=0; i<attrs.size(); i++) {
      Attribute attr = (Attribute)attrs.get(i);
      String key = attr.getName();
      String value = attr.getValue();
      logger.debug("Adding " + key + " - " + value);
      addProperty(key, value);
    }

    // Should be none, for now as everything is specified as attributes.
View Full Code Here

   * @param configElement Element the configuration element that AppConfig has pulled from the configuration document
   * relevant to the configuration object being configured.  Or, the element that was found in the init() method.
   * @throws EnterpriseConfigurationObjectException if errors occur processing the configuration Element.
   */
  public void init(Element configElement) throws EnterpriseConfigurationObjectException {
    Attribute aRefresh = configElement.getAttribute("refresh");
    if (aRefresh != null) {
      boolean refresh = new Boolean(aRefresh.getValue()).booleanValue();
      setRefresh(refresh);
    }

    Attribute aName = configElement.getAttribute("name");
    if (aName != null) {
      setName(aName.getValue());
    }
  }
View Full Code Here

    java.util.List eChildren1 = e.getChildren();
    for (int i=0; i<eChildren1.size(); i++) {
      Element e1 = (Element)eChildren1.get(i);
      java.util.List aChildren = e1.getAttributes();
      for (int j=0; j<aChildren.size(); j++) {
        Attribute a1 = (Attribute)aChildren.get(j);
        if (a1.getName().equals(attrName)) {
          if (a1.getValue() != null && a1.getValue().trim().equals(attrValue)) {
            return e1;
          }
        }
      }
      Element e2 = matchItByAttributeNameValue(e1,attrName,attrValue);
View Full Code Here

      java.util.List ec = e.getChildren();
      for (int i=0; i<ec.size(); i++) {
        Element e1 = (Element)ec.get(i);
        java.util.List ac = e1.getAttributes();
        for (int j=0; j<ac.size(); j++) {
          Attribute a1 = (Attribute)ac.get(j);
          if (a1.getName().equals(attrName)) {
            if (a1.getValue() != null && a1.getValue().trim().equals(attrValue)) {
              return e1;
            }
          }
        }
        Element e2 = matchItByAttributeNameValue(e1,attrName,attrValue);
        if (e2 == null) {
          return null;
        }
        if (e2 != null) {
          java.util.List ac2 = e2.getAttributes();
          for (int j=0; j<ac2.size(); j++) {
            Attribute a2 = (Attribute)ac2.get(j);
            if (a2.getName().equals(attrName)) {
              if (a2.getValue() != null && a2.getValue().trim().equals(attrValue)) {
                return e2;
              }
            }
          }
        }
View Full Code Here

    java.util.List eChildren1 = e.getChildren();
    for (int i=0; i<eChildren1.size(); i++) {
      Element e1 = (Element)eChildren1.get(i);
      java.util.List aChildren = e1.getAttributes();
      for (int j=0; j<aChildren.size(); j++) {
        Attribute a1 = (Attribute)aChildren.get(j);
        if (a1.getName().equals(attrName)) {
          if (a1.getValue() != null && a1.getValue().trim().equalsIgnoreCase(attrValue)) {
            return e1;
          }
        }
      }
      Element e2 = matchItByAttributeNameValueRecursive(e1,attrName,attrValue);
View Full Code Here

TOP

Related Classes of org.jdom.Attribute

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.