public List operate(Object node) { // With 2.1 semantics it makes more sense to just return a null and let the core // throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR) if (!(node instanceof Element)) { return null; } return ((Element) node).getAttributes(); /* else throw new TemplateModelException("_allAttributes can not be applied on " + node.getClass()); */ } }
public Iterator getAttributeAxisIterator(Object contextNode) { if ( ! ( contextNode instanceof Element ) ) { return JaxenConstants.EMPTY_ITERATOR; } Element elem = (Element) contextNode; return elem.getAttributes().iterator(); }
public int getAttributeCount() { return currentElement.getAttributes().size(); }
public String getAttribute(int index) { return ((Attribute) currentElement.getAttributes().get(index)).getValue(); }
public String getAttributeName(int index) { return decodeAttribute(((Attribute) currentElement.getAttributes().get(index)).getQualifiedName()); }
Element e = (Element) node; if (localName == null) { result.addAll(e.getAttributes()); } else { Attribute attr = e.getAttribute(localName, Namespace.getNamespace("", namespaceUri));
Iterator attributes = current.getAttributes().iterator();
@Override public int getAttributeCount() { return currentElement.getAttributes().size(); }
@Override public String getAttribute(final int index) { return ((Attribute)currentElement.getAttributes().get(index)).getValue(); }
private void parseAndAddColor(final Map<Integer, Map<String, String>> colorsAttributes, final List<Element> listOfRows, final int rowNum) { Element node = listOfRows.get(rowNum); @SuppressWarnings("unchecked") List<Attribute> listOfAtributes = node.getAttributes(); Map<String, String> colorAttributes = Maps.newHashMap(); for (int attributeNum = 0; attributeNum < listOfAtributes.size(); attributeNum++) { colorAttributes.put(listOfAtributes.get(attributeNum).getName().toLowerCase(Locale.ENGLISH), listOfAtributes.get(attributeNum).getValue()); } colorsAttributes.put(rowNum, colorAttributes); }
private void parseAndAddAddressType(final Map<Integer, Map<String, String>> addressTypesAttributes, final List<Element> listOfRows, final int rowNum) { Element node = listOfRows.get(rowNum); @SuppressWarnings("unchecked") List<Attribute> listOfAtributes = node.getAttributes(); Map<String, String> addressTypeAttributes = Maps.newHashMap(); for (int attributeNum = 0; attributeNum < listOfAtributes.size(); attributeNum++) { addressTypeAttributes.put(listOfAtributes.get(attributeNum).getName().toLowerCase(Locale.ENGLISH), listOfAtributes .get(attributeNum).getValue()); } addressTypesAttributes.put(rowNum, addressTypeAttributes); }
private void parseAndAddTypeOfPallet(final Map<Integer, Map<String, String>> typeOfPalletsAttributes, final List<Element> listOfRows, final int rowNum) { Element node = listOfRows.get(rowNum); @SuppressWarnings("unchecked") List<Attribute> listOfAtributes = node.getAttributes(); Map<String, String> typeOfPalletAttributes = Maps.newHashMap(); for (int attributeNum = 0; attributeNum < listOfAtributes.size(); attributeNum++) { typeOfPalletAttributes.put(listOfAtributes.get(attributeNum).getName().toLowerCase(Locale.ENGLISH), listOfAtributes.get(attributeNum).getValue()); } typeOfPalletsAttributes.put(rowNum, typeOfPalletAttributes); }
protected void processAttributes(Element el, DefaultMutableTreeNode dmtn) { Iterator atts = el.getAttributes().iterator(); while (atts.hasNext()) { Attribute att = (Attribute)atts.next(); DefaultMutableTreeNode node = new DefaultMutableTreeNode("@" + att.getName()); node.add(new DefaultMutableTreeNode(att.getValue())); dmtn.add(node); } } }
protected java.util.Map extractAttributes (org.jdom.Element elt) { java.util.Map result = new java.util.HashMap(); java.util.Iterator it = elt.getAttributes().iterator(); while (it.hasNext()) { org.jdom.Attribute a = (org.jdom.Attribute)it.next(); result.put(a.getName(), a.getValue()); } return result; }
@Override public String getAttributeName(final int index) { return decodeAttribute(((Attribute)currentElement.getAttributes().get(index)).getQualifiedName()); }
private void parseAndAddCountry(final Element node) { @SuppressWarnings("unchecked") List<Attribute> attributes = node.getAttributes(); Map<String, String> values = Maps.newHashMap(); for (Attribute attribute : attributes) { values.put(attribute.getName().toLowerCase(Locale.ENGLISH), attribute.getValue()); } addCountry(values); }
private void parseAndAddFaultType(final Element node) { @SuppressWarnings("unchecked") List<Attribute> attributes = node.getAttributes(); Map<String, String> values = new HashMap<String, String>(); for (Attribute attribute : attributes) { values.put(attribute.getName().toLowerCase(Locale.ENGLISH), attribute.getValue()); } addAction(values); }
private void parseAndAddReportColumnWidth(final Element node) { @SuppressWarnings("unchecked") List<Attribute> attributes = node.getAttributes(); Map<String, String> values = Maps.newHashMap(); for (Attribute attribute : attributes) { values.put(attribute.getName().toLowerCase(Locale.ENGLISH), attribute.getValue()); } addReportColumnWidth(values); }
private void parseAndAddFaultType(final Element node) { @SuppressWarnings("unchecked") List<Attribute> attributes = node.getAttributes(); Map<String, String> values = Maps.newHashMap(); for (Attribute attribute : attributes) { values.put(attribute.getName().toLowerCase(Locale.ENGLISH), attribute.getValue()); } addFaultType(values); }
private void parseAndAddCurrency(final Element node) { @SuppressWarnings("unchecked") List<Attribute> attributes = node.getAttributes(); Map<String, String> values = Maps.newHashMap(); for (Attribute attribute : attributes) { values.put(attribute.getName().toLowerCase(Locale.ENGLISH), attribute.getValue()); } addCurrency(values); }