1 19 24 25 package org.netbeans.modules.javacore.jmiimpl.javamodel; 26 27 import java.util.List ; 28 import org.netbeans.jmi.javamodel.ClassDefinition; 29 import org.netbeans.jmi.javamodel.ClassDefinitionClass; 30 import org.netbeans.jmi.javamodel.JavaModelPackage; 31 import org.netbeans.jmi.javamodel.MultipartId; 32 import org.netbeans.mdr.storagemodel.StorableClass; 33 34 38 public abstract class ClassDefinitionClassImpl extends SemiPersistentClass implements ClassDefinitionClass { 39 40 41 public ClassDefinitionClassImpl(StorableClass s) { 42 super(s); 43 } 44 45 public ClassDefinition createClassDefinition(String name, List contents, MultipartId superClassName, List interfaceNames){ 46 ClassDefinitionImpl result = create(contents); 47 result.setSuperClassName(superClassName); 48 result.getInterfaceNames().addAll(interfaceNames); 49 result.setName(name); 50 return result; 51 } 52 53 public ClassDefinition createClassDefinition() { 54 return create(null); 55 } 56 57 private ClassDefinitionImpl create(List features) { 58 ClassDefinitionImpl result = create(); 59 result.setNew(); 60 result.setData(features); 61 return result; 62 } 63 64 ClassDefinitionImpl create() { 65 return (ClassDefinitionImpl) createTransient(); 66 } 67 68 public org.netbeans.jmi.javamodel.Type resolve(java.lang.String name) { 69 JavaModelPackage pkg = (JavaModelPackage) refImmediatePackage(); 70 return pkg.getType().resolve(name); 71 } 72 } 73 | Popular Tags |