KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xslt > model > impl > AttributeSetImpl


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.xslt.model.impl;
20
21 import java.util.List JavaDoc;
22
23 import org.netbeans.modules.xslt.model.Attribute;
24 import org.netbeans.modules.xslt.model.AttributeSet;
25 import org.netbeans.modules.xslt.model.XslComponent;
26 import org.netbeans.modules.xslt.model.XslReference;
27 import org.netbeans.modules.xslt.model.XslVisitor;
28 import org.w3c.dom.Element JavaDoc;
29
30
31 /**
32  * @author ads
33  *
34  */

35 class AttributeSetImpl extends QNameableImpl implements AttributeSet {
36
37
38     AttributeSetImpl( XslModelImpl model, Element JavaDoc element ) {
39         super( model , element );
40     }
41     
42     AttributeSetImpl( XslModelImpl model ){
43         super( model , XslElements.ATTRIBUTE_SET );
44     }
45
46     /* (non-Javadoc)
47      * @see org.netbeans.modules.xslt.model.impl.XslComponentImpl#accept(org.netbeans.modules.xslt.model.XslVisitor)
48      */

49     @Override JavaDoc
50     public void accept( XslVisitor visitor )
51     {
52         visitor.visit( this );
53     }
54
55     /* (non-Javadoc)
56      * @see org.netbeans.modules.xslt.model.impl.XslComponentImpl#getComponentType()
57      */

58     @Override JavaDoc
59     public Class JavaDoc<? extends XslComponent> getComponentType()
60     {
61         return AttributeSet.class;
62     }
63
64     /* (non-Javadoc)
65      * @see org.netbeans.modules.xslt.model.AttributeSet#addAttribute(org.netbeans.modules.xslt.model.Attribute, int)
66      */

67     public void addAttribute( Attribute attr, int position ) {
68         insertAtIndex( ATTRIBUTE_PROPERTY, attr, position,
69                 Attribute.class);
70     }
71
72     /* (non-Javadoc)
73      * @see org.netbeans.modules.xslt.model.AttributeSet#appendAttribute(org.netbeans.modules.xslt.model.Attribute)
74      */

75     public void appendAttribute( Attribute attr ) {
76         appendChild( ATTRIBUTE_PROPERTY , attr );
77     }
78
79     /* (non-Javadoc)
80      * @see org.netbeans.modules.xslt.model.AttributeSet#getAttributes()
81      */

82     public List JavaDoc<Attribute> getAttributes() {
83         return getChildren( Attribute.class );
84     }
85
86     /* (non-Javadoc)
87      * @see org.netbeans.modules.xslt.model.AttributeSet#removeAttribute(org.netbeans.modules.xslt.model.Attribute)
88      */

89     public void removeAttribute( Attribute attr ) {
90         removeChild( ATTRIBUTE_PROPERTY, attr);
91     }
92
93     /* (non-Javadoc)
94      * @see org.netbeans.modules.xslt.model.UseAttributesSetsSpec#getUseAttributeSets()
95      */

96     public List JavaDoc<XslReference<AttributeSet>> getUseAttributeSets() {
97         return resolveGlobalReferenceList( AttributeSet.class ,
98                 XslAttributes.USE_ATTRIBUTE_SETS);
99     }
100
101     /* (non-Javadoc)
102      * @see org.netbeans.modules.xslt.model.UseAttributesSetsSpec#setUseAttributeSets(java.util.Collection)
103      */

104     public void setUseAttributeSets( List JavaDoc<XslReference<AttributeSet>> collection ) {
105         setAttributeList( XslAttributes.USE_ATTRIBUTE_SETS, collection);
106     }
107
108 }
109
Popular Tags