KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > javacore > jmiimpl > javamodel > TagDefinitionImpl


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-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.javacore.jmiimpl.javamodel;
20
21 import java.util.Collections JavaDoc;
22 import java.util.List JavaDoc;
23 import javax.jmi.model.MofClass;
24 import javax.jmi.model.NameNotFoundException;
25 import javax.jmi.reflect.ConstraintViolationException;
26 import javax.jmi.reflect.RefObject;
27 import org.netbeans.jmi.javamodel.Element;
28 import org.netbeans.jmi.javamodel.ElementPartKind;
29 import org.netbeans.jmi.javamodel.Resource;
30 import org.netbeans.jmi.javamodel.TagDefinition;
31 import org.netbeans.mdr.handlers.InstanceHandler;
32 import org.netbeans.mdr.storagemodel.StorableObject;
33
34 /** TagDefinition object instance interface implementation
35  *
36  * @author Vladimir Hudec
37  */

38 public abstract class TagDefinitionImpl extends InstanceHandler implements TagDefinition {
39     protected String JavaDoc name = null;
40     
41     /** Creates a new instance of PackageImpl */
42     public TagDefinitionImpl(StorableObject s) {
43         super(s);
44     }
45     
46     /**
47      * Returns the value of attribute name.
48      * @return Value of attribute name.
49      */

50     public java.lang.String JavaDoc getName() {
51         return name;
52     }
53     
54     /**
55      * Sets the value of name attribute. See {@link #getName} for description
56      * on the attribute.
57      * @param newValue New value to be set.
58      */

59     public void setName() {
60         RefObject nameAttr = null;
61         try {
62             nameAttr = ((MofClass) refMetaObject()).lookupElementExtended("name"); // NOI18N
63
} catch (NameNotFoundException e) {
64             // ignore
65
}
66         throw new ConstraintViolationException(this, nameAttr, "Name is readonly."); // NOI18N
67
}
68
69     public int getStartOffset() {
70         throw new UnsupportedOperationException JavaDoc();
71     }
72     
73     public int getEndOffset() {
74         throw new UnsupportedOperationException JavaDoc();
75     }
76     
77     public int getPartStartOffset(ElementPartKind part) {
78         throw new UnsupportedOperationException JavaDoc();
79     }
80
81     public int getPartEndOffset(ElementPartKind part) {
82         throw new UnsupportedOperationException JavaDoc();
83     }
84     
85     public Element duplicate() {
86         throw new UnsupportedOperationException JavaDoc();
87     }
88     
89     public boolean isValid() {
90         return true;
91     }
92     
93     public List JavaDoc getChildren() {
94         return Collections.EMPTY_LIST;
95     }
96     
97     public void replaceChild(Element oldElement, Element newElement) {
98     }
99     
100     public Resource getResource() {
101         return null;
102     }
103 }
104
Popular Tags