1 19 package org.netbeans.modules.javacore.jmiimpl.javamodel; 20 21 import java.util.Collection ; 22 import java.util.Collections ; 23 import java.util.List ; 24 import javax.jmi.model.MofClass; 25 import javax.jmi.model.NameNotFoundException; 26 import javax.jmi.reflect.ConstraintViolationException; 27 import javax.jmi.reflect.RefObject; 28 import org.netbeans.jmi.javamodel.Element; 29 import org.netbeans.jmi.javamodel.ElementPartKind; 30 import org.netbeans.jmi.javamodel.PrimitiveType; 31 import org.netbeans.jmi.javamodel.PrimitiveTypeKind; 32 import org.netbeans.jmi.javamodel.Resource; 33 import org.netbeans.mdr.handlers.InstanceHandler; 34 import org.netbeans.mdr.storagemodel.StorableObject; 35 36 40 public abstract class PrimitiveTypeImpl extends InstanceHandler implements PrimitiveType { 41 PrimitiveTypeKind kind = null; 42 43 44 public PrimitiveTypeImpl(StorableObject s) { 45 super(s); 46 } 47 48 public PrimitiveTypeKind getKind() { 49 return kind; 50 } 51 52 public String getName() { 53 return kind.toString(); 54 } 55 56 public void setName() { 57 RefObject nameAttr = null; 58 try { 59 nameAttr = ((MofClass) refMetaObject()).lookupElementExtended("name"); } catch (NameNotFoundException e) { 61 } 63 throw new ConstraintViolationException(this, nameAttr, "Name is readonly."); } 65 66 public void replaceChild(Element oldChild, Element newChild) { 67 throw new UnsupportedOperationException (); 68 } 69 70 public int getPartStartOffset(ElementPartKind part) { 71 throw new UnsupportedOperationException (); 72 } 73 74 public int getPartEndOffset(ElementPartKind part) { 75 throw new UnsupportedOperationException (); 76 } 77 78 public Resource getResource() { 79 return null; 80 } 81 82 public void setName(String newValue) { 83 throw new UnsupportedOperationException (); 84 } 85 86 public boolean isValid() { 87 return true; 88 } 89 90 public Collection getReferences() { 91 return Collections.EMPTY_LIST; 92 } 93 94 public Element duplicate() { 95 throw new UnsupportedOperationException (); 96 } 97 98 public int getStartOffset() { 99 throw new UnsupportedOperationException (); 100 } 101 102 public List getChildren() { 103 return Collections.EMPTY_LIST; 104 } 105 106 public int getEndOffset() { 107 throw new UnsupportedOperationException (); 108 } 109 } 110 | Popular Tags |