1 19 package org.netbeans.modules.javacore.jmiimpl.javamodel; 20 21 import java.util.List ; 22 import org.netbeans.jmi.javamodel.JavaModelPackage; 23 import org.openide.ErrorManager; 24 import org.netbeans.jmi.javamodel.AnnotationClass; 25 import org.netbeans.jmi.javamodel.Annotation; 26 import org.netbeans.jmi.javamodel.MultipartId; 27 import org.netbeans.mdr.persistence.StorageException; 28 import org.netbeans.mdr.storagemodel.StorableClass; 29 30 33 public abstract class AnnotationClassImpl extends SemiPersistentClass implements AnnotationClass { 34 35 protected AnnotationClassImpl(StorableClass s) { 36 super(s); 37 } 38 39 public Annotation createAnnotation() { 40 return createAnn(null, null); 41 } 42 43 public Annotation createAnnotation(MultipartId type, List attributeValues) { 44 return createAnn(type, attributeValues); 45 } 46 47 private AnnotationImpl createAnn(MultipartId type, List attributeValues) { 48 AnnotationImpl result = create(false); 49 result.setNew(); 50 result.setData(type, attributeValues); 51 return result; 52 } 53 54 AnnotationImpl create(boolean isTransient) { 55 AnnotationImpl result; 56 if (isTransient) { 57 result = (AnnotationImpl) createTransient(); 58 } else { 59 result = (AnnotationImpl) super_createAnnotation(); 60 } 61 return result; 62 } 63 64 protected abstract Annotation super_createAnnotation(); 65 } 66 | Popular Tags |