private Map<String, String> collectAttributes(Tag currentTag) { Map<String, String> attribsMap = new HashMap<String, String>(); NamedNodeMap attribsNodeMap = currentTag.getAttributes(); for(int i = 0; i < attribsNodeMap.getLength(); i++) { Node n = attribsNodeMap.item(i); attribsMap.put(n.getNodeName(), n.getNodeValue()); } return Collections.unmodifiableMap(attribsMap); }
if(!BeansElements.BEAN.equals(beanTag.getNodeName())) { return false; NodeList nl = beanTag.getChildNodes(); for(int i=0; i < nl.getLength(); i++) { Node n = nl.item(i); if(StringUtils.hasText(name) && propertyName.equals(name)) { Tag propertyTag = (Tag) n; AttributeValueFinder delegate = new AttributeValueFinder(syntaxSupport, propertyTag.getElementOffset()); boolean retVal = delegate.find(BeansAttributes.NAME); foundOffset = delegate.getFoundOffset();
String tagName = ((Tag)node).getTagName(); String prefix = prefixesMap.get(tagName); if (prefix == null) { prefix = SpringXMLConfigEditorUtils.getPNamespacePrefix(document, ((Tag)node).getElementOffset()); if (prefix == null) {
beanTagOffset = beanTag.getElementOffset(); beanAttribs = collectAttributes(beanTag); tagName = currentTag.getNodeName();
if(element instanceof StartTag || element instanceof EmptyTag) { Tag tag = (Tag) element; if(tag.getParentNode() instanceof org.w3c.dom.Document) { return tag;
private void parseBean(Node node, Map<String, String> prefixesMap) { String id = getTrimmedAttr(node, BeansAttributes.ID); String name = getTrimmedAttr(node, BeansAttributes.NAME); List<String> names; if (name != null) { names = Collections.unmodifiableList(StringUtils.tokenize(name, SpringXMLConfigEditorUtils.BEAN_NAME_DELIMITERS)); } else { names = Collections.<String>emptyList(); } String clazz = getTrimmedAttr(node, BeansAttributes.CLASS); String parent = getTrimmedAttr(node, BeansAttributes.PARENT); String factoryBean = getTrimmedAttr(node, BeansAttributes.FACTORY_BEAN); String factoryMethod = getTrimmedAttr(node, BeansAttributes.FACTORY_METHOD); Tag tag = (Tag)node; Location location = new ConfigFileLocation(FileUtil.toFileObject(file), tag.getElementOffset()); Set<SpringBeanProperty> properties = parseBeanProperties(node, prefixesMap); ConfigFileSpringBean bean = new ConfigFileSpringBean(id, names, clazz, parent, factoryBean, factoryMethod, properties, location); if (id != null) { addBeanID(id, bean); } for (String each : names) { addBeanName(each, bean); } if (clazz != null) { beans.add(bean); } }
while (node != null) { if (node instanceof StartTag || node instanceof EmptyTag) { NamedNodeMap attributes = ((Tag)node).getAttributes(); for (int index = 0; index < attributes.getLength(); index++) { Attr attr = (Attr) attributes.item(index);
while (node != null) { if (node instanceof StartTag || node instanceof EmptyTag) { NamedNodeMap attributes = ((Tag)node).getAttributes(); for (int index = 0; index < attributes.getLength(); index++) { Attr attr = (Attr) attributes.item(index);