use of net.sourceforge.pmd.lang.ast.xpath.AttributeAxisIterator in project pmd by pmd.
the class NodeInfoPanelController method getAttributes.
/**
* Gets the XPath attributes of the node for display within a listview.
*/
private static ObservableList<String> getAttributes(Node node) {
ObservableList<String> result = FXCollections.observableArrayList();
AttributeAxisIterator attributeAxisIterator = new AttributeAxisIterator(node);
while (attributeAxisIterator.hasNext()) {
Attribute attribute = attributeAxisIterator.next();
result.add(attribute.getName() + " = " + ((attribute.getValue() != null) ? attribute.getStringValue() : "null"));
}
if (node instanceof TypeNode) {
result.add("typeof() = " + ((TypeNode) node).getType());
}
Collections.sort(result);
return result;
}
use of net.sourceforge.pmd.lang.ast.xpath.AttributeAxisIterator in project pmd by pmd.
the class AttributeAxisIteratorTest method testRemove.
@Test(expected = UnsupportedOperationException.class)
public void testRemove() {
DummyNode n = new DummyNode(0);
n.testingOnlySetBeginColumn(1);
n.testingOnlySetBeginLine(1);
AttributeAxisIterator iter = new AttributeAxisIterator(n);
iter.remove();
}
use of net.sourceforge.pmd.lang.ast.xpath.AttributeAxisIterator in project pmd by pmd.
the class AttributesSubMenu method init.
private void init() {
AttributeAxisIterator i = new AttributeAxisIterator(node);
while (i.hasNext()) {
Attribute attribute = i.next();
add(new XPathFragmentAddingItem(attribute.getName() + " = " + attribute.getValue(), model, AttributeToolkit.constructPredicate(attribute)));
}
}
Aggregations