@Override public T visitElement(Element element) { List<Attribute> attributes = element.attributes(); List<T> attributeResults = new ArrayList<>(attributes.size()); for (int i = 0, size = element.attributeCount(); i < size; i++) { Attribute attribute = element.attribute(i); T atrributeResult = attribute.accept(this); attributeResults.add(atrributeResult); } List<T> nodeResults = new ArrayList<>(element.nodeCount()); for (int i = 0, size = element.nodeCount(); i < size; i++) { Node node = element.node(i); T nodeResult = node.accept(this); if (nodeResult != null) { nodeResults.add(nodeResult); } } return handleElement(element, attributeResults, nodeResults); }
Attribute missingAttribute = referenceElement.attribute("missing");
protected void removeAttribute(Element element, String attributeName) { Attribute attribute = element.attribute(attributeName); if (attribute == null) { return; } element.remove(attribute); }
@Override public boolean isMissingReference(Element referenceElement) { Attribute missingAttribute = referenceElement.attribute("missing");
@Override public Object getZipEntryAsObject(Element element, String path) { Object object = fromXML(getZipEntryAsString(path)); Attribute classNameAttribute = element.attribute("attached-class-name"); if ((object != null) && (classNameAttribute != null)) { String className = classNameAttribute.getText(); BeanPropertiesUtil.setProperty(object, "className", className); BeanPropertiesUtil.setProperty( object, "classNameId", PortalUtil.getClassNameId(className)); } return object; }
private static void _mergeArticleContentUpdate( Element curElement, Element newElement, String defaultLocale) { Attribute curTypeAttribute = curElement.attribute("type"); Attribute newTypeAttribute = newElement.attribute("type"); Attribute newIndexTypeAttribute = newElement.attribute("index-type"); Attribute curIndexTypeAttribute = curElement.attribute( "index-type");
Attribute assetPriorityAttribute = element.attribute( "asset-entry-priority");