1 19 package org.netbeans.modules.javacore.jmiimpl.javamodel; 20 21 import org.netbeans.jmi.javamodel.*; 22 import org.netbeans.mdr.storagemodel.StorableClass; 23 import java.util.List ; 24 25 29 public abstract class EnumConstantClassImpl extends SemiPersistentClass implements EnumConstantClass { 30 31 protected EnumConstantClassImpl(StorableClass s) { 32 super(s); 33 } 34 35 public EnumConstant createEnumConstant() { 36 return create(null, null, null, null, null, null, null); 37 } 38 39 public EnumConstant createEnumConstant(String name, List annotations, int modifiers, String javadocText, JavaDoc javadoc, boolean isFinal, TypeReference typeName, int dimCount, InitialValue initialValue, String initialValueText, ClassDefinition body) { 40 return create(name, annotations, javadocText, javadoc, initialValue, initialValueText, body); 41 } 42 43 private EnumConstantImpl create(String name, List annotations, String javadocText, JavaDoc javadoc, InitialValue initialValue, String initialValueText, ClassDefinition body) { 44 EnumConstantImpl result = create(name, false); 45 result.setNew(); 46 result.setData(annotations, javadocText, javadoc, initialValue, initialValueText, body); 47 return result; 48 } 49 50 public EnumConstantImpl create(String name, boolean isTransient) { 51 if (isTransient) { 52 EnumConstantImpl result = (EnumConstantImpl) createTransient(); 53 boolean changes = result.disableChanges; 54 result.disableChanges = true; 55 try { 56 result.setName(name); 57 } finally { 58 result.disableChanges = changes; 59 } 60 return result; 61 } else { 62 return (EnumConstantImpl) super_createEnumConstant(name, null, 0, null, null, false, null, 0, null, null, null); 63 } 64 } 65 66 protected abstract EnumConstant super_createEnumConstant(); 67 protected abstract EnumConstant super_createEnumConstant(String name, List annotations, int modifiers, String javadocText, JavaDoc javadoc, boolean isFinal, TypeReference typeName, int dimCount, InitialValue initialValue, String initialValueText, ClassDefinition body); 68 } 69 | Popular Tags |