2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com
.intellij
.xml
.util
.documentation
;
18 import com
.intellij
.psi
.xml
.XmlTag
;
19 import com
.intellij
.xml
.util
.documentation
.HtmlAttributeDescriptor
;
21 import java
.util
.List
;
22 import java
.util
.LinkedList
;
23 import java
.util
.Iterator
;
26 * Created by IntelliJ IDEA.
30 * To change this template use File | Settings | File Templates.
32 class CompositeAttributeTagDescriptor
extends HtmlAttributeDescriptor
{
33 List
<HtmlAttributeDescriptor
> attributes
= new LinkedList
<HtmlAttributeDescriptor
>();
35 HtmlAttributeDescriptor
findHtmlAttributeInContext(XmlTag tag
) {
36 if (tag
== null) return null;
37 String contextName
= tag
.getName();
39 for (Iterator
<HtmlAttributeDescriptor
> iterator
= attributes
.iterator(); iterator
.hasNext();) {
40 HtmlAttributeDescriptor attributeDescriptor
= iterator
.next();
42 if (attributeDescriptor
.isValidParentTagName(contextName
)) {
43 return attributeDescriptor
;