Package com.dotcms.repackage.org.dom4j

Examples of com.dotcms.repackage.org.dom4j.Attribute


  public Map<String, String> attributes() {
    Node node = node();
    if (node instanceof Element) {
      Map<String, String> attrs = new HashMap<String, String>();
      for (Iterator i = ((Element) node).attributeIterator(); i.hasNext();) {
        Attribute a = (Attribute) i.next();
        attrs.put(a.getName(), a.getValue());
      }
      return attrs;
    }
    return null;
  }
View Full Code Here


    else if (el1Attrs.size() > el2Attrs.size()) {
      return 1;
    }

    for (int i = 0; i < el1Attrs.size(); i++) {
      Attribute attr = (Attribute)el1Attrs.get(i);

      int value = _compare(el2Attrs, attr, new AttributeComparator());

      if (value != 0) {
        return value;
View Full Code Here

*
*/
public class AttributeComparator implements Comparator {

  public int compare(Object obj1, Object obj2) {
    Attribute attr1 = (Attribute)obj1;
    Attribute attr2 = (Attribute)obj2;

    String attr1Value = attr1.getValue();
    String attr2Value = attr2.getValue();

    return attr1Value.compareTo(attr2Value);
  }
View Full Code Here

    else if (el1Attrs.size() > el2Attrs.size()) {
      return 1;
    }

    for (int i = 0; i < el1Attrs.size(); i++) {
      Attribute attr = (Attribute)el1Attrs.get(i);

      int value = _contains(el2Attrs, attr, new AttributeComparator());
      if (value != 0) {
        return value;
      }
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.dom4j.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.