1 19 package org.netbeans.modules.javacore.jmiimpl.javamodel; 20 21 import org.netbeans.jmi.javamodel.FieldGroup; 22 import org.netbeans.jmi.javamodel.FieldGroupClass; 23 import org.netbeans.jmi.javamodel.TypeReference; 24 import org.netbeans.mdr.storagemodel.StorableClass; 25 import java.util.List ; 26 import org.netbeans.modules.javacore.parser.TypeRef; 27 28 34 public abstract class FieldGroupClassImpl extends SemiPersistentClass implements FieldGroupClass { 35 36 protected FieldGroupClassImpl(StorableClass s) { 37 super(s); 38 } 39 40 45 public FieldGroup createFieldGroup() { 46 return create(0, null, null); 47 } 48 49 58 public FieldGroup createFieldGroup(java.lang.String name, java.util.List annotations, int modifiers, java.lang.String javadocText, org.netbeans.jmi.javamodel.JavaDoc javadoc, org.netbeans.jmi.javamodel.TypeReference typeName, java.util.List fields) { 59 return create(modifiers, typeName, fields); 60 } 61 62 public FieldGroupImpl create(int modifiers, TypeRef type, boolean isTransient) { 63 FieldGroupImpl result; 64 if (isTransient) { 65 result = (FieldGroupImpl) createTransient(); 66 boolean changes = result.disableChanges; 67 result.disableChanges = true; 68 try { 69 result.setModifiers(modifiers); 70 } finally { 71 result.disableChanges = changes; 72 } 73 } else { 74 result = (FieldGroupImpl) super_createFieldGroup(null, null, modifiers, null, null, null, null); 75 } 76 result.setTypeRef(type); 77 return result; 78 } 79 80 protected abstract FieldGroup super_createFieldGroup(); 81 protected abstract FieldGroup super_createFieldGroup(java.lang.String name, java.util.List annotations, int modifiers, java.lang.String javadocText, org.netbeans.jmi.javamodel.JavaDoc javadoc, org.netbeans.jmi.javamodel.TypeReference typeName, java.util.List fields); 82 83 private FieldGroup create(int modifiers, TypeReference typeName, List fields) { 87 FieldGroupImpl result = create(modifiers, null, false); 88 result.setNew(); 89 result.setData(typeName, fields); 90 return result; 91 } 92 } 93 | Popular Tags |